Package com.ibm.di.config.base
Class AttributeMapConfigImpl
- java.lang.Object
-
- com.ibm.di.config.base.BaseConfigurationImpl
-
- com.ibm.di.config.base.AttributeMapConfigImpl
-
- All Implemented Interfaces:
AttributeMapConfig
,BaseConfiguration
,MetamergeConfigChangeListener
,java.io.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
Constructors Constructor Description AttributeMapConfigImpl()
ConstructorAttributeMapConfigImpl(java.lang.Object config)
Constructor providing a TreeMap of attribute/value pairs.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configurationChanged(MetamergeConfigChange mcc)
boolean
flatten(java.util.List<java.lang.String> excludedNS)
This method combines all values from this object and its inherited objects into one single config object.AttributeMapItem
getAttributeMapItem(java.lang.Object attrName)
Returns the AttributeMapItem for attributejava.util.List<java.lang.String>
getAttributeNames()
Returns a list of attribute names in this object.BaseConfiguration
getChild(java.lang.Object name)
java.util.List<java.lang.String>
getChildNames()
Returns a list of names for all child configuration objectboolean
hasAttributeMapItem(java.lang.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(java.lang.Object name)
Creates and adds a new attribute map item to this object.void
removeAttributeMapItem(java.lang.Object attribute)
Removes a named attribute from this map.void
renameAttributeMapItem(java.lang.Object newName, AttributeMapItem map)
Changes the name of an existing attributemapitemvoid
setAttributeMapItem(AttributeMapItem map)
Sets a attributeMapItem attribute of the AttributeMapConfig objectvoid
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, getClone, 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, isExpression, isParameterLocal, isProtectedParameter, nameForChild, notifyChange, notifyChange, notifyChange, performNotifyChange, reattachToParent, removeListener, removeParameter, search, search, setBooleanParameter, setChild, setData, setDebug, setDebugBreak, setEnabled, setFlags, 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, 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, getClone, 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, isExpression, isParameterLocal, isProtectedParameter, nameForChild, notifyChange, notifyChange, notifyChange, reattachToParent, removeListener, removeParameter, search, search, setBooleanParameter, setChild, setData, setDebug, setDebugBreak, setEnabled, setFlags, setInheritsFromRef, setIntegerParameter, setLogEnabled, setMetamergeConfig, setModified, setModTS, setName, setName, setNullBehavior, setNullBehaviorValue, setNullDefinition, setNullDefinitionValue, setParameter, setParameter, setParameterPropertySource, setParent, setProtectedParameter, setProtectedParameter, setScript, setScriptEngine, setStringParameter, setSubstitutionMap, setUseListeners, setUserComment, size, toEntry, updateInheritsFrom, willFlatten
-
-
-
-
Method Detail
-
init
public void init() throws java.lang.Exception
Called after internal data structure is set.- Specified by:
init
in interfaceBaseConfiguration
- Overrides:
init
in classBaseConfigurationImpl
- Throws:
java.lang.Exception
- if the initialization fails.
-
setupInheritanceChain
public void setupInheritanceChain() throws java.lang.Exception
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
-
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 interfaceBaseConfiguration
- Overrides:
setInheritsFrom
in classBaseConfigurationImpl
- Parameters:
inheritFrom
- if this isConnectorConfig
object we take his AttributeMap to inherit from else standard behavior.
-
configurationChanged
public void configurationChanged(MetamergeConfigChange mcc)
- Specified by:
configurationChanged
in interfaceMetamergeConfigChangeListener
- Overrides:
configurationChanged
in classBaseConfigurationImpl
-
newAttributeMapItem
public AttributeMapItem newAttributeMapItem(java.lang.Object name) throws java.lang.Exception
Creates and adds a new attribute map item to this object.- Specified by:
newAttributeMapItem
in interfaceAttributeMapConfig
- Parameters:
name
- The attribute name- Returns:
- The newly created AttributeMapItem
- Throws:
java.lang.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 interfaceAttributeMapConfig
- Parameters:
map
- The new AttributeMapItem
-
removeAttributeMapItem
public void removeAttributeMapItem(java.lang.Object attribute)
Removes a named attribute from this map.- Specified by:
removeAttributeMapItem
in interfaceAttributeMapConfig
- Parameters:
attribute
- The attribute name
-
renameAttributeMapItem
public void renameAttributeMapItem(java.lang.Object newName, AttributeMapItem map) throws java.lang.Exception
Changes the name of an existing attributemapitem- Specified by:
renameAttributeMapItem
in interfaceAttributeMapConfig
- Parameters:
newName
- The new namemap
- The existing AttributeMapItem- Throws:
java.lang.Exception
- Any errors encountered by the underlying driver
-
getAttributeMapItem
public AttributeMapItem getAttributeMapItem(java.lang.Object attrName)
Returns the AttributeMapItem for attribute- Specified by:
getAttributeMapItem
in interfaceAttributeMapConfig
- Parameters:
attrName
- The attribute name- Returns:
- The attributeMapItem value
-
hasAttributeMapItem
public boolean hasAttributeMapItem(java.lang.Object attribute)
Checks if a named attribute is local (not inherited or null) to this object.- Specified by:
hasAttributeMapItem
in interfaceAttributeMapConfig
- Parameters:
attribute
- The attribute name- Returns:
- True if this object contains the attribute
-
getAttributeNames
public java.util.List<java.lang.String> getAttributeNames()
Returns a list of attribute names in this object.- Specified by:
getAttributeNames
in interfaceAttributeMapConfig
- Returns:
- The list of attribute names including inherited attributes
-
flatten
public boolean flatten(java.util.List<java.lang.String> excludedNS) throws java.lang.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 interfaceBaseConfiguration
- Overrides:
flatten
in classBaseConfigurationImpl
- 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:
java.lang.Exception
-
getChild
public BaseConfiguration getChild(java.lang.Object name)
- 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()
Returns a list of names for all child configuration object- Specified by:
getChildNames
in interfaceBaseConfiguration
- Overrides:
getChildNames
in classBaseConfigurationImpl
- Returns:
- list of names
-
-