Class ConfigurationParameters
- java.lang.Object
-
- com.filenet.api.util.ConfigurationParameters
-
- All Implemented Interfaces:
- java.io.Serializable
public class ConfigurationParameters extends java.lang.Object implements java.io.SerializableRepresents a group of parameters that define the behavior of the client API. This class is a map ofConfigurationParameterkeys toObjectvalues. Instances are initially empty; they are not pre-populated with default values.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description ConfigurationParameters()Constructs an empty map of configuration parameters.ConfigurationParameters(ConfigurationParameters parameters)Constructs a map of configuration parameters toObjectvalues.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.ObjectgetParameter(ConfigurationParameter parameter)Retrieves a configured value.voidloadMap(java.util.Map map)Parses a map of key/value pairs into validConfigurationParameterkeys andObjectvalues.java.lang.ObjectsetParameter(ConfigurationParameter parameter, java.lang.Object value)Sets a configuration parameter.voidsetParameters(ConfigurationParameters parameters)Sets the connection parameters specified in theparametersargument.java.lang.StringtoString()Returns a string representation of this instance.
-
-
-
Constructor Detail
-
ConfigurationParameters
public ConfigurationParameters()
Constructs an empty map of configuration parameters.
-
ConfigurationParameters
public ConfigurationParameters(ConfigurationParameters parameters)
Constructs a map of configuration parameters toObjectvalues. The parameters are populated with the values specified in the input collection.- Parameters:
parameters- A collection ofConfigurationParameterobjects. Cannot benull.
-
-
Method Detail
-
getParameter
public java.lang.Object getParameter(ConfigurationParameter parameter)
Retrieves a configured value.A returned value of
nullindicates that no value has been explicitly configured for the requested parameter and an appropriate default value for the parameter in question is used instead.- Parameters:
parameter- The parameter for which the value is to be retrieved. SeeConfigurationParameter.- Returns:
- The
Objectassociated with the requested parameter value. If no value has been configured for the requested parameter, this method returnsnull.
-
setParameter
public java.lang.Object setParameter(ConfigurationParameter parameter, java.lang.Object value)
Sets a configuration parameter. If the value of thevalueargument isnull, this method removes the value. Defaults are used for removed values.- Parameters:
parameter- The configuration parameter value to set.value- The value of the parameter to set, ornull.- Returns:
- The previous value, if any.
- Throws:
EngineRuntimeException- if the type or value of the object are invalid.- See Also:
ExceptionCode.API_INVALID_CONFIGURATION_PARAMETER
-
setParameters
public void setParameters(ConfigurationParameters parameters)
Sets the connection parameters specified in theparametersargument. Other connection parameters are unchanged. This is equivalent to callingsetParameter(parameter, value)for each parameter with a non-nullvalue in theparametersargument.- Parameters:
parameters- AConnectionParameterscollection.- Throws:
EngineRuntimeException- if one or more parameters are invalid.- See Also:
ExceptionCode.API_INVALID_CONFIGURATION_PARAMETER
-
loadMap
public void loadMap(java.util.Map map)
Parses a map of key/value pairs into validConfigurationParameterkeys andObjectvalues. The resulting configuration values are used to populate thisConfigurationParametersclass.The standard
java.util.Propertiesclass implements theMapinterface. A common usage of this method is to load a properties file into aPropertiesobject and call this method to parse the properties into valid configuration parameters.Each key must be a
ConfigurationParameteror aString. The key is used as-is if it is already aConfigurationParameter; otherwise, theStringis parsed for a validConfigurationParameterstring value.All string comparisons and lookups are case-insensitive.
If a
Stringkey does not start with "FileNet.", the key/value pair is logged at the debug level but otherwise skipped and ignored. The entire key is then used to look up the correspondingConfigurationParameterconstant; an exception is thrown if it is not found.The value for a valid key is then parsed. If the value is already of the required type, it is used as-is; otherwise, it is transformed into one of the required types. The type of transformation depends on the parameter and type of value. An exception is thrown if the transformation fails. An exception is also thrown if the given or transformed valued is invalid for the parameter.
- Parameters:
map- A JavaMapobject containing configuration key/value pairs. Cannot benull
-
toString
public java.lang.String toString()
Returns a string representation of this instance.- Overrides:
toStringin classjava.lang.Object- Returns:
- A
Stringrepresenting the instance.
-
-