|
|||||||||||
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(String key)
|
void |
clear()
Removes all configuration parameters. |
String |
getParameter(String key,
String defaultValue)
Returns the value associated to the specified key . |
boolean |
getParameterAsBoolean(String key)
Returns the value associated to the specified key as
boolean . |
int |
getParameterAsInt(String key,
int defaultValue)
Returns the value associated to the specified key as
int . |
protected Map<String,String> |
getParams()
Returns the Map that stores all the configuration parameters. |
protected boolean |
isDefined(String key)
Checks if the specified parameter is defined or not. |
protected boolean |
loadFromFile(String fileName,
String prefix)
Loads the properties from a file. |
protected boolean |
loadFromResource(String resource,
String prefix)
Loads the properties from a resource stream. |
void |
setParameter(String key,
String value)
Defines a configuration parameter. |
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 String getParameter(String key, 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(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(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(String key)
key
- the key that identifies the parameter
true
if the parameter has an associated value,
otherwise false
StringUtils.isBlank(String)
protected void checkParamAndThrow(String key)
public final void setParameter(String key, String value)
key
- configuration parameter keyvalue
- configuration parameter valuepublic final 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 Object
protected final Map<String,String> getParams()
Map
that stores all the configuration parameters.
Map
that stores all the configuration parametersprotected final boolean loadFromFile(String fileName, 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(String resource, 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 |