Package com.seeq.link.sdk
Class Configurable<TConfig>
java.lang.Object
com.seeq.link.sdk.Configurable<TConfig>
- Type Parameters:
TConfig
- The class for the top-level configuration object.
Facilitates a consistent implementation of configuration aspects of a connector or agent.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
protected TConfig
abstract String
getName()
protected void
initialize
(ConfigService configService, ConfigObject[] supportedConfigObjects) Initializes the Object with information necessary to load/save configuration objects.protected void
loadConfig
(String name) protected TConfig
migrateConfig
(Object configObject) protected void
void
Saves the current in-memory configuration to the configuration store via the ConfigService.
-
Constructor Details
-
Configurable
public Configurable()
-
-
Method Details
-
getName
-
getConfigService
-
getConfig
-
initialize
protected void initialize(ConfigService configService, ConfigObject[] supportedConfigObjects) throws IOException Initializes the Object with information necessary to load/save configuration objects.- Parameters:
configService
- The config service, as it was passed in by a higher-level coordinator.supportedConfigObjects
- 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).- Throws:
IOException
- Thrown if configuration file could not be successfully deserialized.
-
destroy
public void destroy() -
migrateConfig
-
saveConfig
public void saveConfig()Saves the current in-memory configuration to the configuration store via the ConfigService. -
loadConfig
- Throws:
IOException
-
onConfigChanged
protected void onConfigChanged()
-