com.ibm.di.config.base
Class AttributeMapConfigImpl

java.lang.Object
  extended by com.ibm.di.config.base.BaseConfigurationImpl
      extended by com.ibm.di.config.base.AttributeMapConfigImpl
All Implemented Interfaces:
AttributeMapConfig, BaseConfiguration, MetamergeConfigChangeListener, Serializable
Direct Known Subclasses:
HooksConfigImpl

public class AttributeMapConfigImpl
extends BaseConfigurationImpl
implements AttributeMapConfig, MetamergeConfigChangeListener

The implementation class for the configuration of an AttributeMap

See Also:
Serialized Form

Field Summary
 
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
AttributeMapConfigImpl()
          Constructor
AttributeMapConfigImpl(Object config)
          Constructor providing a TreeMap of attribute/value pairs.
 
Method Summary
 void configurationChanged(MetamergeConfigChange mcc)
          
 boolean flatten(List<String> excludedNS)
          This method combines all values from this object and its inherited objects into one single config object.
 AttributeMapItem getAttributeMapItem(Object attrName)
          Returns the AttributeMapItem for attribute
 List<String> getAttributeNames()
          Returns a list of attribute names in this object.
 BaseConfiguration getChild(Object name)
          
 List<String> getChildNames()
          Returns a list of names for all child configuration object
 Object getClone()
          
 boolean hasAttributeMapItem(Object attribute)
          Checks if a named attribute is local (not inherited or null) to this object.
 void init()
          Called after internal data structure is set.
 AttributeMapItem newAttributeMapItem(Object name)
          Creates and adds a new attribute map item to this object.
 void removeAttributeMapItem(Object attribute)
          Removes a named attribute from this map.
 void renameAttributeMapItem(Object newName, AttributeMapItem map)
          Changes the name of an existing attributemapitem
 void setAttributeMapItem(AttributeMapItem map)
          Sets a attributeMapItem attribute of the AttributeMapConfig object
 void setInheritsFrom(BaseConfiguration inheritFrom)
          We override this method to change the inherited object if we inherit from a connector.
 void setupInheritanceChain()
          Established the inheritance chain for this object.
 
Methods inherited from class com.ibm.di.config.base.BaseConfigurationImpl
addListener, deepClone, detachFromParent, expandPropertyValue, expandPropertyValue, fromEntry, getBooleanParameter, getChildForPath, getData, getDataIterator, getDebug, getDebug, getDebugBreak, getEnabled, getFlags, getInheritsFrom, getInheritsFromRef, getIntegerParameter, getKeys, getLogEnabled, getLongName, getMetamergeConfig, getModified, 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, isExpression, isParameterLocal, nameForChild, notifyChange, notifyChange, notifyChange, performNotifyChange, reattachToParent, removeListener, removeParameter, search, search, setBooleanParameter, setChild, setData, setDebug, setDebugBreak, setEnabled, setFlags, setInheritsFromRef, setIntegerParameter, setLogEnabled, setMetamergeConfig, setModified, setName, setName, setNullBehavior, setNullBehaviorValue, setNullDefinition, setNullDefinitionValue, setParameter, setParameter, setParameterPropertySource, setParent, setProtectedParameter, setScript, setScriptEngine, setStringParameter, setSubstitutionMap, setUseConfigListeners, setUseListeners, setUserComment, size, 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, fromEntry, getBooleanParameter, getChildForPath, getData, getDataIterator, getDebug, getDebug, getDebugBreak, getEnabled, getFlags, getInheritsFrom, getInheritsFromRef, getIntegerParameter, getKeys, getLogEnabled, getMetamergeConfig, getModified, getName, getNamespace, getNullBehavior, getNullBehaviorValue, getNullDefinition, getNullDefinitionValue, getParameter, getParameter, getParameter, getParameterPropertySource, getParameterRaw, getParent, getPath, getReferences, getScript, getScriptEngine, getShortName, getStringParameter, getSubstitutionMap, getUseListeners, getUserComment, hasParameter, isExpression, isParameterLocal, nameForChild, notifyChange, notifyChange, notifyChange, reattachToParent, removeListener, removeParameter, search, search, setBooleanParameter, setChild, setData, setDebug, setDebugBreak, setEnabled, setFlags, setInheritsFromRef, setIntegerParameter, setLogEnabled, setMetamergeConfig, setModified, setName, setName, setNullBehavior, setNullBehaviorValue, setNullDefinition, setNullDefinitionValue, setParameter, setParameter, setParameterPropertySource, setParent, setProtectedParameter, setScript, setScriptEngine, setStringParameter, setSubstitutionMap, setUseListeners, setUserComment, size, toEntry, updateInheritsFrom, willFlatten
 

Constructor Detail

AttributeMapConfigImpl

public AttributeMapConfigImpl()
Constructor


AttributeMapConfigImpl

public AttributeMapConfigImpl(Object config)
Constructor providing a TreeMap of attribute/value pairs.

Parameters:
config - initial config
Method Detail

init

public void init()
          throws Exception
Called after internal data structure is set.

Specified by:
init in interface BaseConfiguration
Overrides:
init in class BaseConfigurationImpl
Throws:
Exception - if the initialization fails.

setupInheritanceChain

public void setupInheritanceChain()
                           throws Exception
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

setInheritsFrom

public void setInheritsFrom(BaseConfiguration inheritFrom)
We override this method to change the inherited object if we inherit from a connector. Also we need to set up inheritance for all the attribute map items.

Specified by:
setInheritsFrom in interface BaseConfiguration
Overrides:
setInheritsFrom in class BaseConfigurationImpl
Parameters:
inheritFrom - if this is ConnectorConfig object we take his AttributeMap to inherit from else standard behavior.

configurationChanged

public void configurationChanged(MetamergeConfigChange mcc)

Specified by:
configurationChanged in interface MetamergeConfigChangeListener
Overrides:
configurationChanged in class BaseConfigurationImpl

newAttributeMapItem

public AttributeMapItem newAttributeMapItem(Object name)
                                     throws Exception
Creates and adds a new attribute map item to this object.

Specified by:
newAttributeMapItem in interface AttributeMapConfig
Parameters:
name - The attribute name
Returns:
The newly created AttributeMapItem
Throws:
Exception - Any errors encountered by the underlying driver

setAttributeMapItem

public void setAttributeMapItem(AttributeMapItem map)
Sets a attributeMapItem attribute of the AttributeMapConfig object

Specified by:
setAttributeMapItem in interface AttributeMapConfig
Parameters:
map - The new AttributeMapItem

removeAttributeMapItem

public void removeAttributeMapItem(Object attribute)
Removes a named attribute from this map.

Specified by:
removeAttributeMapItem in interface AttributeMapConfig
Parameters:
attribute - The attribute name

renameAttributeMapItem

public void renameAttributeMapItem(Object newName,
                                   AttributeMapItem map)
                            throws Exception
Changes the name of an existing attributemapitem

Specified by:
renameAttributeMapItem in interface AttributeMapConfig
Parameters:
newName - The new name
map - The existing AttributeMapItem
Throws:
Exception - Any errors encountered by the underlying driver

getAttributeMapItem

public AttributeMapItem getAttributeMapItem(Object attrName)
Returns the AttributeMapItem for attribute

Specified by:
getAttributeMapItem in interface AttributeMapConfig
Parameters:
attrName - The attribute name
Returns:
The attributeMapItem value

hasAttributeMapItem

public boolean hasAttributeMapItem(Object attribute)
Checks if a named attribute is local (not inherited or null) to this object.

Specified by:
hasAttributeMapItem in interface AttributeMapConfig
Parameters:
attribute - The attribute name
Returns:
True if this object contains the attribute

getAttributeNames

public List<String> getAttributeNames()
Returns a list of attribute names in this object.

Specified by:
getAttributeNames in interface AttributeMapConfig
Returns:
The list of attribute names including inherited attributes

flatten

public boolean flatten(List<String> excludedNS)
                throws Exception
This method combines all values from this object and its inherited objects into one single config object. After flattening, the object is a complete object with no inherited values except those from the excludedNS list.

Specified by:
flatten in interface BaseConfiguration
Overrides:
flatten in class BaseConfigurationImpl
Parameters:
excludedNS - List of namespaces to exclude from flattening
Returns:
true if object attempted flattening, FALSE is this object inherits from an excluded namespace or has no inheritance
Throws:
Exception

getClone

public Object getClone()
                throws Exception

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

getChild

public BaseConfiguration getChild(Object name)

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()
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