public class ConfigurationManager
extends java.lang.Object
connector_config.txt.
When reading a setting it first look for it in the record store, if it is not there the configuration file is read.
The path of the configuration file can be provided as a parameter in the constructor of the object or specifying the system property "connector.config.file.path". If none of them is defined the file embedded in the jar will be used.
The methods in this class are used by the
PreferencesManager class to get the
Connector Configuration values and by the
DefaultConnectorLogger class to get the logging
configuration.
The list of parameters is found at
PreferencesConstants
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONNECTOR_CONFIGURATION_FILE_PATH_PROPERTY
System property to define the Cloud Connector configuration file absolute path: "connector.config.file.path".
|
| Constructor and Description |
|---|
ConfigurationManager(ConnectorLogger logger)
Class constructor.
|
ConfigurationManager(ConnectorLogger logger,
java.lang.String configurationFile)
Class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getParameter(java.lang.String parameter)
Reads the given parameter from the record store, if it does not exists
it read it from the configuration file and returns its value
if it exists,
null otherwise. |
void |
setParameter(java.lang.String parameter,
java.lang.String value)
Writes the given parameter with value in the configuration file.
|
public static final java.lang.String CONNECTOR_CONFIGURATION_FILE_PATH_PROPERTY
public ConfigurationManager(ConnectorLogger logger)
If the "connector.config.file.path" is defined and is valid, its value will be used as configuration file path, otherwise the file embedded in the jar will be used.
logger - Connector logger.CONNECTOR_CONFIGURATION_FILE_PATH_PROPERTYpublic ConfigurationManager(ConnectorLogger logger, java.lang.String configurationFile)
If the defined path in configurationFile is not valid, the
value of the "connector.config.file.path" system
property will be used as configuration file path. If this last one was
not specified the file embedded in the jar will be
used.
logger - Connector logger.configurationFile - Path of the Cloud Connector configuration file.public java.lang.String getParameter(java.lang.String parameter)
null otherwise.parameter - Parameter to read from configuration file.null if the parameter is not in the
record store, if the configuration file does not exists, if it
cannot be read or if the parameter is not defined.public void setParameter(java.lang.String parameter,
java.lang.String value)
parameter - Parameter to write in the configuration file.value - Parameter value.© Copyright 2014 Etherios, Inc. All rights reserved. Etherios, Inc. is a Division of Digi International Inc.