Package com.ibm.di.config.base
Class ContainerConfigImpl
- java.lang.Object
-
- com.ibm.di.config.base.BaseConfigurationImpl
-
- com.ibm.di.config.base.ContainerConfigImpl
-
- All Implemented Interfaces:
BaseConfiguration
,ContainerConfig
,MetamergeConfigChangeListener
,java.io.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
Fields Modifier and Type Field Description protected java.util.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
Constructors Constructor Description ContainerConfigImpl()
Constructor for the ContainerConfigImpl objectContainerConfigImpl(java.lang.Object data)
Constructor for the ContainerConfigImpl object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
addConfig(BaseConfiguration config)
This method adds a configuration object to the containerboolean
containsConfig(java.lang.String name, boolean recursive)
Returns true if there is a config having the provided name.BaseConfiguration
getChild(java.lang.Object name)
java.util.List<java.lang.String>
getChildNames()
Returns a list of names for all child configuration objectjava.lang.Object
getClone()
BaseConfiguration
getConfig(int index)
This method returns the configuration object, which is at position indexBaseConfiguration
getConfig(java.lang.String name)
Returns the config with the specified nameBaseConfiguration
getConfig(java.lang.String name, boolean recursive)
Returns the config with the specified namejava.util.List<BaseConfiguration>
getConfigurations(java.util.List<BaseConfiguration> list)
Returns a flattened list of the entire tree of config items.java.util.List<BaseConfiguration>
getInheritedConfigurations(java.util.List<BaseConfiguration> list)
Returns a list of config items from this object and inherited containersint
indexOf(BaseConfiguration config)
Returns the position of a configuration object in a containerint
indexOf(java.lang.String name)
Returns the index of the configint
insertConfig(BaseConfiguration config, int position)
This method inesrts a configuration object at the specified indexboolean
moveConfig(int position, boolean up)
Moves a connector one position up or downboolean
moveConfig(BaseConfiguration config, boolean up)
Moves a config one position up or downint
moveConfig(BaseConfiguration config, int position)
Moves a config from one position to anotherBaseConfiguration
removeConfig(int index)
This method removes a configuration object from the containerboolean
removeConfig(BaseConfiguration config)
This method removes a configuration object from the containerboolean
removeConfig(java.lang.String name, boolean recursive)
This method removes a configuration object from the containervoid
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, isProtectedParameter, 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, 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, isProtectedParameter, 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, setProtectedParameter, setScript, setScriptEngine, setStringParameter, setSubstitutionMap, setUseListeners, setUserComment, toEntry, updateInheritsFrom, willFlatten
-
-
-
-
Field Detail
-
items
protected java.util.Vector<BaseConfiguration> items
Collection of config objects in the container
-
-
Method Detail
-
size
public int size()
This method returns the number of config objects in the container- Specified by:
size
in interfaceBaseConfiguration
- Specified by:
size
in interfaceContainerConfig
- Overrides:
size
in classBaseConfigurationImpl
- Returns:
- Number of config objects
-
getInheritedConfigurations
public java.util.List<BaseConfiguration> getInheritedConfigurations(java.util.List<BaseConfiguration> list)
Returns a list of config items from this object and inherited containers- Specified by:
getInheritedConfigurations
in interfaceContainerConfig
- 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 java.util.List<BaseConfiguration> getConfigurations(java.util.List<BaseConfiguration> list)
Returns a flattened list of the entire tree of config items.- Specified by:
getConfigurations
in interfaceContainerConfig
- 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 interfaceContainerConfig
- 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(java.lang.String name)
Returns the index of the config- Specified by:
indexOf
in interfaceContainerConfig
- 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 interfaceContainerConfig
- Parameters:
index
- The position of the configuration object- Returns:
- Class representing the configuration of the object
-
getConfig
public BaseConfiguration getConfig(java.lang.String name)
Returns the config with the specified name- Specified by:
getConfig
in interfaceContainerConfig
- Parameters:
name
- The config's name- Returns:
- The connector configuration object or null if config wasn't found
-
getConfig
public BaseConfiguration getConfig(java.lang.String name, boolean recursive)
Returns the config with the specified name- Specified by:
getConfig
in interfaceContainerConfig
- Parameters:
name
- The config's namerecursive
- 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 interfaceContainerConfig
- 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 interfaceContainerConfig
- Parameters:
config
- The configuration objectposition
- 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 interfaceContainerConfig
- 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 interfaceContainerConfig
- Parameters:
config
- The configuration object to remove- Returns:
- true if the remove operation is successful. Otherwise, returns false.
-
removeConfig
public boolean removeConfig(java.lang.String name, boolean recursive)
This method removes a configuration object from the container- Specified by:
removeConfig
in interfaceContainerConfig
- Parameters:
name
- The name of the configuration to removerecursive
- 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 interfaceContainerConfig
- Parameters:
position
- Current connector positionup
- 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 interfaceContainerConfig
- 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 interfaceContainerConfig
- Parameters:
position
- New positionconfig
- The configuration object to move- Returns:
- The current position of the configuration
-
containsConfig
public boolean containsConfig(java.lang.String name, boolean recursive)
Returns true if there is a config having the provided name.- Specified by:
containsConfig
in interfaceContainerConfig
- Parameters:
name
- The name of the config itemrecursive
- 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(java.lang.Object name)
Description copied from class:BaseConfigurationImpl
- Specified by:
getChild
in interfaceBaseConfiguration
- Overrides:
getChild
in classBaseConfigurationImpl
- Parameters:
name
- The name of the configuration object- Returns:
- the configuration object named name.
-
getChildNames
public java.util.List<java.lang.String> getChildNames()
Description copied from class:BaseConfigurationImpl
Returns a list of names for all child configuration object- Specified by:
getChildNames
in interfaceBaseConfiguration
- Overrides:
getChildNames
in classBaseConfigurationImpl
- Returns:
- list of names
-
setupInheritanceChain
public void setupInheritanceChain() throws java.lang.Exception
Description copied from class:BaseConfigurationImpl
Established the inheritance chain for this object.- Specified by:
setupInheritanceChain
in interfaceBaseConfiguration
- Overrides:
setupInheritanceChain
in classBaseConfigurationImpl
- Throws:
java.lang.Exception
- if the operation could not be performed
-
getClone
public java.lang.Object getClone() throws java.lang.Exception
Description copied from class:BaseConfigurationImpl
- Specified by:
getClone
in interfaceBaseConfiguration
- Overrides:
getClone
in classBaseConfigurationImpl
- Returns:
- a cloned version of this object.
- Throws:
java.lang.Exception
-
-