Class DefaultConfigService

java.lang.Object
com.seeq.link.sdk.services.DefaultConfigService
All Implemented Interfaces:
ConfigService

public class DefaultConfigService extends Object implements ConfigService
See ConfigService for documentation.
  • Constructor Details

    • DefaultConfigService

      public DefaultConfigService()
  • Method Details

    • initialize

      public void initialize(FileConfigObjectProvider fileConfigObjectProvider, RemoteConfigObjectProvider remoteConfigObjectProvider)
      Description copied from interface: ConfigService
      Initializes the service with its FileConfigObjectProvider (used to retrieve configuration from disk) and its RemoteConfigObjectProvider (used to retrieve the remote configuration).
      Specified by:
      initialize in interface ConfigService
      Parameters:
      fileConfigObjectProvider - Interface used to retrieve configuration from disk.
      remoteConfigObjectProvider - Interface used to retrieve remote configuration.
    • getGlobalArgument

      @Deprecated public String getGlobalArgument(String argumentName)
      Deprecated.
      Deprecated: All configuration should now come from configuration files.
      Specified by:
      getGlobalArgument in interface ConfigService
      Parameters:
      argumentName - Name of the command line argument to retrieve.
      Returns:
      Value of the command line argument.
    • loadConfigObject

      public ConfigObject loadConfigObject(String name, ConfigObject[] defaultConfigObjects) throws IOException
      Description copied from interface: ConfigService
      Loads a configuration Object from the config data store. This function requires an array of config objects to use as a means of discovering what Object type is encoded in the store.
      Specified by:
      loadConfigObject in interface ConfigService
      Parameters:
      name - The name of configuration store, which will normally be the connector name.
      defaultConfigObjects - An array of ConfigObject instances that represent the possible Object types that can be successfully retrieved from the store. If the persisted Object type does not match anything in the list, then the first item in the array is passed back (being effectively a means to have a 'default' config).
      Returns:
      The configuration Object, which must be cast to a ConfigObject-derived class.
      Throws:
      IOException - Thrown if JSON file could not be successfully deserialized.
    • saveConfigObject

      public void saveConfigObject(String name, Object configObject)
      Description copied from interface: ConfigService
      Saves a configuration Object to the config data store. The config object's type will be encoded in 'Version' field in the data store.
      Specified by:
      saveConfigObject in interface ConfigService
      Parameters:
      name - The name of configuration store, which will normally be the connector name.
      configObject - The configuration Object to serialize to the store.
    • registerChangeCallback

      public void registerChangeCallback(String name, Consumer<String> callback)
      Description copied from interface: ConfigService
      Registers a callback for when the configuration has changed.
      Specified by:
      registerChangeCallback in interface ConfigService
      Parameters:
      name - Name of the configuration object you're interested in.
      callback - Callback function that takes the name as its only parameter.
    • unregisterChangeCallback

      public void unregisterChangeCallback(String name)
      Description copied from interface: ConfigService
      Unregisters a callback previously registered.
      Specified by:
      unregisterChangeCallback in interface ConfigService
      Parameters:
      name - Name of the configuration object you're interested in.