Callback: onGatewayUpdateSettingsRequest

Last modified: Jul 5, 2019 @ 06:41

This callback notifies the gateway implementation that settings have been updated for the gateway in DDM.

By default a settings file named appiot-gateway.settings is used to make the settings persistent. This file is located in the root of the APPIOT_HOME folder.

The appiot-gateway.settings file is managed by the AppIoTGatewayProperties class.

DDM provides a basic setting category for SDK usage named GatewaySDK. It allows to configure the following settings:

  • LogLevel – One of the following values:
    ALL
    CONFIG
    FINE
    FINER
    FINEST
    INFO
    OFF
    SEVERE
    WARNING
  • LogSearchString – A string used to filter out which logging messages to log.
  • EnableQueue – If true, an internal queue is used.
  • QueueSize – the amount of messages the internal queue is capable of handle.
  • ReportInterval – the interval in milliseconds the internal queue is drained and messages sent to DDM.

The SDK handles the response to DDM. No response action is needed by the implementation.

For example, the following callback implementation

@Override
public void onGatewayUpdateSettingsRequest(List<SettingCategory> settingCategories) {

  for(SettingCategory settingCategory : settingCategories) {
    logger.log(Level.INFO, String.format("### %s ###", settingCategory.getName()));
    for(Setting setting : settingCategory.getSettings()) {
      logger.log(Level.INFO, String.format("%s = %s", setting.getKey(), setting.getValue()));
    }
  }
}

produces the following log entries:

20170505 14:13:54 | INFO | com.ericsson.appiot.examples.gateway.simplegateway.MyAppIoTListener | onGatewayUpdateSettingsRequest | ### GatewaySDK ###
20170505 14:13:54 | INFO | com.ericsson.appiot.examples.gateway.simplegateway.MyAppIoTListener | onGatewayUpdateSettingsRequest | ReportInterval = 1000
20170505 14:13:54 | INFO | com.ericsson.appiot.examples.gateway.simplegateway.MyAppIoTListener | onGatewayUpdateSettingsRequest | LogLevel = INFO
20170505 14:13:54 | INFO | com.ericsson.appiot.examples.gateway.simplegateway.MyAppIoTListener | onGatewayUpdateSettingsRequest | LogSearchString = 
20170505 14:13:54 | INFO | com.ericsson.appiot.examples.gateway.simplegateway.MyAppIoTListener | onGatewayUpdateSettingsRequest | QueueSize = 1000
20170505 14:13:54 | INFO | com.ericsson.appiot.examples.gateway.simplegateway.MyAppIoTListener | onGatewayUpdateSettingsRequest | EnableQueue = false

The same settings are displayed in the GUI in the following example: