|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.ibm.di.connector.maximo.util.AbstractConfigurationParameters
public abstract class AbstractConfigurationParameters
Collection of configuration parameters.
Note: This class is thread-safe.
SimpleTpaeIFConnector| Field Summary | |
|---|---|
protected Log |
logger
Logger used by the TPAE IF Connector. |
| Constructor Summary | |
|---|---|
AbstractConfigurationParameters(Log log)
Constructs a new AbstractConfigurationParameters. |
|
| Method Summary | |
|---|---|
protected void |
checkParamAndThrow(java.lang.String key)
|
void |
clear()
Removes all configuration parameters. |
java.lang.String |
getParameter(java.lang.String key,
java.lang.String defaultValue)
Returns the value associated to the specified key. |
boolean |
getParameterAsBoolean(java.lang.String key)
Returns the value associated to the specified key as
boolean. |
int |
getParameterAsInt(java.lang.String key,
int defaultValue)
Returns the value associated to the specified key as
int. |
protected java.util.Map<java.lang.String,java.lang.String> |
getParams()
Returns the Map that stores all the configuration parameters. |
protected boolean |
isDefined(java.lang.String key)
Checks if the specified parameter is defined or not. |
protected boolean |
loadFromFile(java.lang.String fileName,
java.lang.String prefix)
Loads the properties from a file. |
protected boolean |
loadFromResource(java.lang.String resource,
java.lang.String prefix)
Loads the properties from a resource stream. |
void |
setParameter(java.lang.String key,
java.lang.String value)
Defines a configuration parameter. |
java.lang.String |
toString()
Returns a String with all defined properties. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Log logger
| Constructor Detail |
|---|
public AbstractConfigurationParameters(Log log)
AbstractConfigurationParameters.
| Method Detail |
|---|
public final void clear()
public final java.lang.String getParameter(java.lang.String key,
java.lang.String defaultValue)
key.
key - the key whose associated value is to be returneddefaultValue - the value that should be returned if the parameter specified
by key is not defined
key or
defaultValue if the parameter is not previously
definedpublic final boolean getParameterAsBoolean(java.lang.String key)
key as
boolean.
key - the key whose associated value is to be returned
true if value equals to "true",
otherwise false
public final int getParameterAsInt(java.lang.String key,
int defaultValue)
key as
int.
key - the key whose associated value is to be returneddefaultValue - the value that should be returned if the parameter specified
by key is not defined
key or
defaultValue if the parameter is not previously
definedprotected final boolean isDefined(java.lang.String key)
key - the key that identifies the parameter
true if the parameter has an associated value,
otherwise falseStringUtils.isBlank(String)protected void checkParamAndThrow(java.lang.String key)
public final void setParameter(java.lang.String key,
java.lang.String value)
key - configuration parameter keyvalue - configuration parameter valuepublic final java.lang.String toString()
String with all defined properties.
Note: Any property identified by a key that contains the word password will not have its value exposed.
toString in class java.lang.Objectprotected final java.util.Map<java.lang.String,java.lang.String> getParams()
Map that stores all the configuration parameters.
Map that stores all the configuration parameters
protected final boolean loadFromFile(java.lang.String fileName,
java.lang.String prefix)
fileName - path to the file containing the configuration propertiesprefix - prefix of the configuration properties that should be loaded
true if the configuration properties could be
loaded, otherwise false
protected final boolean loadFromResource(java.lang.String resource,
java.lang.String prefix)
resource - path to the resource stream that contains the configuration
propertiesprefix - prefix of the configuration properties that should be loaded
true if the configuration properties could be
loaded, otherwise false
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||