com.ibm.di.config.base
Class ContainerConfigImpl

java.lang.Object
  extended by com.ibm.di.config.base.BaseConfigurationImpl
      extended by com.ibm.di.config.base.ContainerConfigImpl
All Implemented Interfaces:
BaseConfiguration, ContainerConfig, MetamergeConfigChangeListener, Serializable
Direct Known Subclasses:
BranchingConfigImpl, SequenceConfigImpl, SolutionInterfaceImpl

public class ContainerConfigImpl
extends BaseConfigurationImpl
implements ContainerConfig

Implements a Container containing BaseConfiguration objects.

See Also:
Serialized Form

Field Summary
protected  Vector<BaseConfiguration> items
          Collection of config objects in the container
 
Fields inherited from class com.ibm.di.config.base.BaseConfigurationImpl
NAME
 
Fields inherited from interface com.ibm.di.config.interfaces.BaseConfiguration
CHILD_PATH_SEPARATOR, DISABLE_EXTPROPS, DISABLE_INHERITANCE, INHERIT_NONE, INHERIT_PARENT, ONE_LEVEL, RECURSIVE, RECURSIVE_ONELEVEL, RECURSIVE_SUBTREE, SEARCH_EXACTCASE, SEARCH_ONELEVEL, SEARCH_PARAMNAME, SEARCH_PARAMNAME_RE, SEARCH_PROPERTY, SEARCH_REGEX, SEARCH_SUBSTRING, SUBTREE
 
Constructor Summary
ContainerConfigImpl()
          Constructor for the ContainerConfigImpl object
ContainerConfigImpl(Object data)
          Constructor for the ContainerConfigImpl object
 
Method Summary
 int addConfig(BaseConfiguration config)
          This method adds a configuration object to the container
 boolean containsConfig(String name, boolean recursive)
          Returns true if there is a config having the provided name.
 BaseConfiguration getChild(Object name)
          
 List<String> getChildNames()
          Returns a list of names for all child configuration object
 Object getClone()
          
 BaseConfiguration getConfig(int index)
          This method returns the configuration object, which is at position index
 BaseConfiguration getConfig(String name)
          Returns the config with the specified name
 BaseConfiguration getConfig(String name, boolean recursive)
          Returns the config with the specified name
 List<BaseConfiguration> getConfigurations(List<BaseConfiguration> list)
          Returns a flattened list of the entire tree of config items.
 List<BaseConfiguration> getInheritedConfigurations(List<BaseConfiguration> list)
          Returns a list of config items from this object and inherited containers
 int indexOf(BaseConfiguration config)
          Returns the position of a configuration object in a container
 int indexOf(String name)
          Returns the index of the config
 int insertConfig(BaseConfiguration config, int position)
          This method inesrts a configuration object at the specified index
 boolean moveConfig(BaseConfiguration config, boolean up)
          Moves a config one position up or down
 int moveConfig(BaseConfiguration config, int position)
          Moves a config from one position to another
 boolean moveConfig(int position, boolean up)
          Moves a connector one position up or down
 boolean removeConfig(BaseConfiguration config)
          This method removes a configuration object from the container
 BaseConfiguration removeConfig(int index)
          This method removes a configuration object from the container
 boolean removeConfig(String name, boolean recursive)
          This method removes a configuration object from the container
 void setupInheritanceChain()
          Established the inheritance chain for this object.
 int size()
          This method returns the number of config objects in the container
 
Methods inherited from class com.ibm.di.config.base.BaseConfigurationImpl
addListener, configurationChanged, deepClone, detachFromParent, expandPropertyValue, expandPropertyValue, flatten, fromEntry, getBooleanParameter, getChildForPath, getData, getDataIterator, getDebug, getDebug, getDebugBreak, getEnabled, getFlags, getInheritsFrom, getInheritsFromRef, getIntegerParameter, getKeys, getLogEnabled, getLongName, getMetamergeConfig, getModified, getModTS, getName, getNamespace, getNullBehavior, getNullBehaviorValue, getNullDefinition, getNullDefinitionValue, getParameter, getParameter, getParameter, getParameterPropertySource, getParameterPropertySourceFromValue, getParameterRaw, getParent, getParentName, getPath, getReferences, getResHash, getScript, getScriptEngine, getShortName, getStringParameter, getSubstitutionMap, getUseConfigListeners, getUseListeners, getUserComment, hasParameter, init, isExpression, isParameterLocal, nameForChild, notifyChange, notifyChange, notifyChange, performNotifyChange, reattachToParent, removeListener, removeParameter, search, search, setBooleanParameter, setChild, setData, setDebug, setDebugBreak, setEnabled, setFlags, setInheritsFrom, setInheritsFromRef, setIntegerParameter, setLogEnabled, setMetamergeConfig, setModified, setModTS, setName, setName, setNullBehavior, setNullBehaviorValue, setNullDefinition, setNullDefinitionValue, setParameter, setParameter, setParameterPropertySource, setParent, setProtectedParameter, setScript, setScriptEngine, setStringParameter, setSubstitutionMap, setUseConfigListeners, setUseListeners, setUserComment, toEntry, toString, updateInheritsFrom, willExpandProps, willFlatten, willUseInherited
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.di.config.interfaces.BaseConfiguration
addListener, detachFromParent, flatten, fromEntry, getBooleanParameter, getChildForPath, getData, getDataIterator, getDebug, getDebug, getDebugBreak, getEnabled, getFlags, getInheritsFrom, getInheritsFromRef, getIntegerParameter, getKeys, getLogEnabled, getMetamergeConfig, getModified, getModTS, getName, getNamespace, getNullBehavior, getNullBehaviorValue, getNullDefinition, getNullDefinitionValue, getParameter, getParameter, getParameter, getParameterPropertySource, getParameterRaw, getParent, getPath, getReferences, getScript, getScriptEngine, getShortName, getStringParameter, getSubstitutionMap, getUseListeners, getUserComment, hasParameter, init, isExpression, isParameterLocal, nameForChild, notifyChange, notifyChange, notifyChange, reattachToParent, removeListener, removeParameter, search, search, setBooleanParameter, setChild, setData, setDebug, setDebugBreak, setEnabled, setFlags, setInheritsFrom, setInheritsFromRef, setIntegerParameter, setLogEnabled, setMetamergeConfig, setModified, setModTS, setName, setName, setNullBehavior, setNullBehaviorValue, setNullDefinition, setNullDefinitionValue, setParameter, setParameter, setParameterPropertySource, setParent, setProtectedParameter, setScript, setScriptEngine, setStringParameter, setSubstitutionMap, setUseListeners, setUserComment, toEntry, updateInheritsFrom, willFlatten
 

Field Detail

items

protected Vector<BaseConfiguration> items
Collection of config objects in the container

Constructor Detail

ContainerConfigImpl

public ContainerConfigImpl()
Constructor for the ContainerConfigImpl object


ContainerConfigImpl

public ContainerConfigImpl(Object data)
Constructor for the ContainerConfigImpl object

Parameters:
data - TreeMap of attribute/value pairs
Method Detail

size

public int size()
This method returns the number of config objects in the container

Specified by:
size in interface BaseConfiguration
Specified by:
size in interface ContainerConfig
Overrides:
size in class BaseConfigurationImpl
Returns:
Number of config objects

getInheritedConfigurations

public List<BaseConfiguration> getInheritedConfigurations(List<BaseConfiguration> list)
Returns a list of config items from this object and inherited containers

Specified by:
getInheritedConfigurations in interface ContainerConfig
Parameters:
list - If not null, BaseConfiguration items are added to this list
Returns:
The provided List or a new List object with the contents of inherited configurations

getConfigurations

public List<BaseConfiguration> getConfigurations(List<BaseConfiguration> list)
Returns a flattened list of the entire tree of config items.

Specified by:
getConfigurations in interface ContainerConfig
Parameters:
list - If not null, config items are added to this list
Returns:
The provided list or a new list object with the contents of this container and child containers

indexOf

public int indexOf(BaseConfiguration config)
Returns the position of a configuration object in a container

Specified by:
indexOf in interface ContainerConfig
Parameters:
config - Configuration object in the container
Returns:
The position of the Configuration object in the collection of configuration objects in the container

indexOf

public int indexOf(String name)
Returns the index of the config

Specified by:
indexOf in interface ContainerConfig
Parameters:
name - The name of the configuration object
Returns:
The position of the configuration object in the collection of configuration objects

getConfig

public BaseConfiguration getConfig(int index)
This method returns the configuration object, which is at position index

Specified by:
getConfig in interface ContainerConfig
Parameters:
index - The position of the configuration object
Returns:
Class representing the configuration of the object

getConfig

public BaseConfiguration getConfig(String name)
Returns the config with the specified name

Specified by:
getConfig in interface ContainerConfig
Parameters:
name - The config's name
Returns:
The connector configuration object or null if config wasn't found

getConfig

public BaseConfiguration getConfig(String name,
                                   boolean recursive)
Returns the config with the specified name

Specified by:
getConfig in interface ContainerConfig
Parameters:
name - The config's name
recursive - If true, searches through all the components in a container
Returns:
The connector configuration object or null if config wasn't found

addConfig

public int addConfig(BaseConfiguration config)
This method adds a configuration object to the container

Specified by:
addConfig in interface ContainerConfig
Parameters:
config - The configuration object
Returns:
Index of the new configuration object

insertConfig

public int insertConfig(BaseConfiguration config,
                        int position)
This method inesrts a configuration object at the specified index

Specified by:
insertConfig in interface ContainerConfig
Parameters:
config - The configuration object
position - Position of the new object
Returns:
Index of the new configuration object

removeConfig

public BaseConfiguration removeConfig(int index)
This method removes a configuration object from the container

Specified by:
removeConfig in interface ContainerConfig
Parameters:
index - Index of the configuration object
Returns:
The configuration object that is removed

removeConfig

public boolean removeConfig(BaseConfiguration config)
This method removes a configuration object from the container

Specified by:
removeConfig in interface ContainerConfig
Parameters:
config - The configuration object to remove
Returns:
true if the remove operation is successful. Otherwise, returns false.

removeConfig

public boolean removeConfig(String name,
                            boolean recursive)
This method removes a configuration object from the container

Specified by:
removeConfig in interface ContainerConfig
Parameters:
name - The name of the configuration to remove
recursive - If true, searches through all the components in a container
Returns:
true, if the remove operation is successful. Otherwise returns false.

moveConfig

public boolean moveConfig(int position,
                          boolean up)
Moves a connector one position up or down

Specified by:
moveConfig in interface ContainerConfig
Parameters:
position - Current connector position
up - Up (true) or down (false)
Returns:
true if the operation succeeded

moveConfig

public boolean moveConfig(BaseConfiguration config,
                          boolean up)
Moves a config one position up or down

Specified by:
moveConfig in interface ContainerConfig
Parameters:
up - Up (true) or down (false)
config - The configuration object to move.
Returns:
true if the operation succeeded

moveConfig

public int moveConfig(BaseConfiguration config,
                      int position)
Moves a config from one position to another

Specified by:
moveConfig in interface ContainerConfig
Parameters:
position - New position
config - The configuration object to move
Returns:
The current position of the configuration

containsConfig

public boolean containsConfig(String name,
                              boolean recursive)
Returns true if there is a config having the provided name.

Specified by:
containsConfig in interface ContainerConfig
Parameters:
name - The name of the config item
recursive - If true, a tree walk will be performed when checking for the name
Returns:
TRUE if there is an object with the provided name

getChild

public BaseConfiguration getChild(Object name)
Description copied from class: BaseConfigurationImpl

Specified by:
getChild in interface BaseConfiguration
Overrides:
getChild in class BaseConfigurationImpl
Parameters:
name - The name of the configuration object
Returns:
the configuration object named name.

getChildNames

public List<String> getChildNames()
Description copied from class: BaseConfigurationImpl
Returns a list of names for all child configuration object

Specified by:
getChildNames in interface BaseConfiguration
Overrides:
getChildNames in class BaseConfigurationImpl
Returns:
list of names

setupInheritanceChain

public void setupInheritanceChain()
                           throws Exception
Description copied from class: BaseConfigurationImpl
Established the inheritance chain for this object.

Specified by:
setupInheritanceChain in interface BaseConfiguration
Overrides:
setupInheritanceChain in class BaseConfigurationImpl
Throws:
Exception - if the operation could not be performed

getClone

public Object getClone()
                throws Exception
Description copied from class: BaseConfigurationImpl

Specified by:
getClone in interface BaseConfiguration
Overrides:
getClone in class BaseConfigurationImpl
Returns:
a cloned version of this object.
Throws:
Exception