org.apache.manifoldcf.core.interfaces
Class ConfigParams

java.lang.Object
  extended by org.apache.manifoldcf.core.interfaces.Configuration
      extended by org.apache.manifoldcf.core.interfaces.ConfigParams
All Implemented Interfaces:
IHierarchyParent

public class ConfigParams
extends Configuration

This class represents a set of configuration parameters, with structure, which is a generalized hierarchy of nodes that can be interpreted by a repository or authority connector in an appropriate way.


Field Summary
static java.lang.String _rcsid
           
protected static java.lang.String ATTR_NAME
           
protected static java.lang.String PARAMETER_TYPE
          The parameter type node
protected  java.util.HashMap params
           
 
Fields inherited from class org.apache.manifoldcf.core.interfaces.Configuration
children, JSON_ATTRIBUTE, JSON_CHILDREN, JSON_TYPE, JSON_VALUE, readOnly, rootNodeLabel
 
Constructor Summary
ConfigParams()
          Constructor.
ConfigParams(java.io.InputStream xmlstream)
          Construct from XML.
ConfigParams(java.util.Map map)
          Constructor.
ConfigParams(java.lang.String xml)
          Construct from XML.
 
Method Summary
protected  void addOuterNode(ConfigurationNode node)
          Note the addition of a new outer node.
protected  void clearOuterNodes()
          Note the removal of all outer nodes.
protected  Configuration createNew()
          Create a new object of the appropriate class.
protected  ConfigurationNode createNewNode(java.lang.String type)
          Create a new child node of the appropriate type and class.
 ConfigParams duplicate()
          Duplicate.
 ConfigNode getChild(int index)
          Get child node.
 java.lang.String getObfuscatedParameter(java.lang.String key)
          Get an obfuscated parameter value.
 java.lang.String getParameter(java.lang.String key)
          Get a parameter value.
 java.util.Iterator listParameters()
          List parameters.
protected  void removeOuterNode(ConfigurationNode node)
          Note the removal of an outer node.
 void setObfuscatedParameter(java.lang.String key, java.lang.String value)
          Set an obfuscated parameter.
 void setParameter(java.lang.String key, java.lang.String value)
          Set a parameter value.
 
Methods inherited from class org.apache.manifoldcf.core.interfaces.Configuration
addChild, clearChildren, createDuplicate, equals, findChild, fromJSON, fromXML, fromXML, getChildCount, hashCode, initializeFromDoc, makeReadOnly, processObject, processObject, readNode, readNode, removeChild, toJSON, toXML, writeNode, writeNode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_rcsid

public static final java.lang.String _rcsid
See Also:
Constant Field Values

PARAMETER_TYPE

protected static final java.lang.String PARAMETER_TYPE
The parameter type node

See Also:
Constant Field Values

ATTR_NAME

protected static final java.lang.String ATTR_NAME
See Also:
Constant Field Values

params

protected java.util.HashMap params
Constructor Detail

ConfigParams

public ConfigParams()
Constructor.


ConfigParams

public ConfigParams(java.util.Map map)
Constructor.

Parameters:
map - is the initialized (mutable) map describing the name/value configuration parameters. This method of setting up a ConfigParams object will go away when the parameters are all in XML.

ConfigParams

public ConfigParams(java.lang.String xml)
             throws ManifoldCFException
Construct from XML.

Parameters:
xml - is the input XML.
Throws:
ManifoldCFException

ConfigParams

public ConfigParams(java.io.InputStream xmlstream)
             throws ManifoldCFException
Construct from XML.

Parameters:
xmlstream - is the input XML stream. Does NOT close the stream.
Throws:
ManifoldCFException
Method Detail

createNew

protected Configuration createNew()
Create a new object of the appropriate class.

Overrides:
createNew in class Configuration
Returns:
the newly-created configuration object.

createNewNode

protected ConfigurationNode createNewNode(java.lang.String type)
Create a new child node of the appropriate type and class.

Overrides:
createNewNode in class Configuration
Returns:
the newly-created node.

clearOuterNodes

protected void clearOuterNodes()
Note the removal of all outer nodes.

Overrides:
clearOuterNodes in class Configuration

addOuterNode

protected void addOuterNode(ConfigurationNode node)
Note the addition of a new outer node.

Overrides:
addOuterNode in class Configuration
Parameters:
node - is the node that was just read.

removeOuterNode

protected void removeOuterNode(ConfigurationNode node)
Note the removal of an outer node.

Overrides:
removeOuterNode in class Configuration
Parameters:
node - is the node that was just removed.

getParameter

public java.lang.String getParameter(java.lang.String key)
Get a parameter value.

Parameters:
key - is the name of the parameter.
Returns:
the value.

getObfuscatedParameter

public java.lang.String getObfuscatedParameter(java.lang.String key)
Get an obfuscated parameter value.

Parameters:
key - is the name of the parameter.
Returns:
the unobfuscated value.

setParameter

public void setParameter(java.lang.String key,
                         java.lang.String value)
Set a parameter value.

Parameters:
key - is the name of the parameter.
value - is the new value, or null if we should delete the value.

setObfuscatedParameter

public void setObfuscatedParameter(java.lang.String key,
                                   java.lang.String value)
Set an obfuscated parameter.

Parameters:
key - is the name of the parameter.
value - is the unobfuscated new value, or null if delete request.

listParameters

public java.util.Iterator listParameters()
List parameters.


duplicate

public ConfigParams duplicate()
Duplicate.

Returns:
an exact duplicate

getChild

public ConfigNode getChild(int index)
Get child node.

Parameters:
index - is the node number.
Returns:
the node.