public class ConfigurationHandlerImpl extends ComponentBase implements ConfigurationHandler, java.lang.Runnable
ConfigurationHandler
implementation.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONFIG_STORAGE_FILENAME
File name use for storage.
|
static java.lang.String |
CONFIG_STORAGE_SUBDIR
Directory name use for storage.
|
Constructor and Description |
---|
ConfigurationHandlerImpl(org.osgi.framework.BundleContext context) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
get(java.lang.String key,
java.lang.String defaultValue)
Retrieve the configuration value associated with the key, or the specified default.
|
boolean |
getBoolean(java.lang.String key,
boolean defaultValue)
Retrieve the configuration value associated with the key, or the specified default.
|
int |
getInt(java.lang.String key,
int defaultValue)
Retrieve the configuration value associated with the key, or the specified default.
|
long |
getLong(java.lang.String key,
long defaultValue)
Retrieve the configuration value associated with the key, or the specified default.
|
java.util.Set<java.lang.String> |
keySet()
Return an unmodifiable copy of the configuration keys.
|
protected void |
onInit() |
protected void |
onStart() |
protected void |
onStop() |
void |
putAll(java.util.Map<java.lang.String,java.lang.String> props)
Store a configuration value.
|
void |
run()
Called by
ResettableTimer when a certain timeout has exceeded. |
getAgentContext, getAgentUpdateHandler, getConfigurationHandler, getConnectionHandler, getDeploymentHandler, getDiscoveryHandler, getDownloadHandler, getEventsHandler, getExecutorService, getFeedbackHandler, getIdentificationHandler, getLoggingHandler, getWorkDir, init, logDebug, logDebug, logError, logError, logInfo, logInfo, logWarning, logWarning, start, stop
public static final java.lang.String CONFIG_STORAGE_SUBDIR
public static final java.lang.String CONFIG_STORAGE_FILENAME
public ConfigurationHandlerImpl(org.osgi.framework.BundleContext context)
public java.lang.String get(java.lang.String key, java.lang.String defaultValue)
ConfigurationHandler
get
in interface ConfigurationHandler
key
- The key, must not be null
defaultValue
- The default value, must not be null
public boolean getBoolean(java.lang.String key, boolean defaultValue)
ConfigurationHandler
getBoolean
in interface ConfigurationHandler
key
- The key, must not be null
defaultValue
- The default valuepublic int getInt(java.lang.String key, int defaultValue)
ConfigurationHandler
getInt
in interface ConfigurationHandler
key
- The key, must not be null
defaultValue
- The default valuepublic long getLong(java.lang.String key, long defaultValue)
ConfigurationHandler
getLong
in interface ConfigurationHandler
key
- The key, must not be null
defaultValue
- The default valuepublic java.util.Set<java.lang.String> keySet()
ConfigurationHandler
keySet
in interface ConfigurationHandler
public void putAll(java.util.Map<java.lang.String,java.lang.String> props)
ConfigurationHandler
putAll
in interface ConfigurationHandler
props
- the properties to put, cannot be null
.public void run()
ResettableTimer
when a certain timeout has exceeded.run
in interface java.lang.Runnable
protected void onInit() throws java.lang.Exception
onInit
in class ComponentBase
java.lang.Exception
protected void onStart() throws java.lang.Exception
onStart
in class ComponentBase
java.lang.Exception
protected void onStop() throws java.lang.Exception
onStop
in class ComponentBase
java.lang.Exception