Package com.ibm.di.config.base
Class HookConfigImpl
- java.lang.Object
-
- com.ibm.di.config.base.BaseConfigurationImpl
-
- com.ibm.di.config.base.HookConfigImpl
-
- All Implemented Interfaces:
BaseConfiguration
,HookConfig
,MetamergeConfigChangeListener
,java.io.Serializable
public class HookConfigImpl extends BaseConfigurationImpl implements HookConfig
This is the implementation class for the configuration of a single Hook.- 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 HookConfigImpl()
ConstructorHookConfigImpl(java.lang.Object config)
Constructor providing a TreeMap of attribute/value pairs.HookConfigImpl(java.lang.Object name, java.lang.String script)
Constructor providing hook name and script.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
couldInherit()
Could this hook inherit data from some other place, if it did not have local data?boolean
detachFromParent()
This method removes this objects from its parent container.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.boolean
getEnabled()
Gets the enabled attribute of this object.java.lang.Object
getHookName()
java.lang.String
getScript()
Gets the script attribute of this object.java.lang.String
getShortName()
Gets the shortName attribute of the BaseConfiguration object.boolean
reattachToParent(int position)
This method reattaches this object to its former parent.void
setEnabled(boolean enabled)
Sets the enabled attribute of this object.void
setHookName(java.lang.Object name)
Sets hook name.void
setInheritsFrom(BaseConfiguration inheritFrom)
Sets the object from which this object inherits data.void
setScript(java.lang.String script)
Sets the hook script.void
setupInheritanceChain()
Established the inheritance chain for this object.-
Methods inherited from class com.ibm.di.config.base.BaseConfigurationImpl
addListener, configurationChanged, deepClone, expandPropertyValue, expandPropertyValue, fromEntry, getBooleanParameter, getChild, getChildForPath, getChildNames, getClone, getData, getDataIterator, getDebug, getDebug, getDebugBreak, 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, getScriptEngine, getStringParameter, getSubstitutionMap, getUseConfigListeners, getUseListeners, getUserComment, hasParameter, init, isExpression, isParameterLocal, isProtectedParameter, nameForChild, notifyChange, notifyChange, notifyChange, performNotifyChange, removeListener, removeParameter, search, search, setBooleanParameter, setChild, setData, setDebug, setDebugBreak, setFlags, setInheritsFromRef, setIntegerParameter, setLogEnabled, setMetamergeConfig, setModified, setModTS, setName, setName, setNullBehavior, setNullBehaviorValue, setNullDefinition, setNullDefinitionValue, setParameter, setParameter, setParameterPropertySource, setParent, setProtectedParameter, setProtectedParameter, 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, fromEntry, getBooleanParameter, getChild, getChildForPath, getChildNames, getClone, getData, getDataIterator, getDebug, getDebug, getDebugBreak, getFlags, getInheritsFrom, getInheritsFromRef, getIntegerParameter, getKeys, getLogEnabled, getMetamergeConfig, getModified, getModTS, getName, getNamespace, getNullBehavior, getNullBehaviorValue, getNullDefinition, getNullDefinitionValue, getParameter, getParameter, getParameter, getParameterPropertySource, getParameterRaw, getParent, getPath, getReferences, getScriptEngine, getStringParameter, getSubstitutionMap, getUseListeners, getUserComment, hasParameter, init, isExpression, isParameterLocal, isProtectedParameter, nameForChild, notifyChange, notifyChange, notifyChange, removeListener, removeParameter, search, search, setBooleanParameter, setChild, setData, setDebug, setDebugBreak, setFlags, setInheritsFromRef, setIntegerParameter, setLogEnabled, setMetamergeConfig, setModified, setModTS, setName, setName, setNullBehavior, setNullBehaviorValue, setNullDefinition, setNullDefinitionValue, setParameter, setParameter, setParameterPropertySource, setParent, setProtectedParameter, setProtectedParameter, setScriptEngine, setStringParameter, setSubstitutionMap, setUseListeners, setUserComment, size, toEntry, updateInheritsFrom, willFlatten
-
-
-
-
Constructor Detail
-
HookConfigImpl
public HookConfigImpl()
Constructor
-
HookConfigImpl
public HookConfigImpl(java.lang.Object config)
Constructor providing a TreeMap of attribute/value pairs.- Parameters:
config
- initial config
-
HookConfigImpl
public HookConfigImpl(java.lang.Object name, java.lang.String script)
Constructor providing hook name and script. Creates enabled hook.- Parameters:
name
-script
-
-
-
Method Detail
-
getHookName
public java.lang.Object getHookName()
- Specified by:
getHookName
in interfaceHookConfig
- Returns:
- Hook name
-
setHookName
public void setHookName(java.lang.Object name)
Sets hook name.- Specified by:
setHookName
in interfaceHookConfig
- Parameters:
name
-
-
getEnabled
public boolean getEnabled()
Gets the enabled attribute of this object.- Specified by:
getEnabled
in interfaceBaseConfiguration
- Specified by:
getEnabled
in interfaceHookConfig
- Overrides:
getEnabled
in classBaseConfigurationImpl
- Returns:
- The nullBehaviorValue value.
-
setEnabled
public void setEnabled(boolean enabled)
Sets the enabled attribute of this object.- Specified by:
setEnabled
in interfaceBaseConfiguration
- Specified by:
setEnabled
in interfaceHookConfig
- Overrides:
setEnabled
in classBaseConfigurationImpl
- Parameters:
enabled
-true
for enabling;false
otherwise.
-
getScript
public java.lang.String getScript()
Gets the script attribute of this object.- Specified by:
getScript
in interfaceBaseConfiguration
- Overrides:
getScript
in classBaseConfigurationImpl
- Returns:
- The script value.
-
setScript
public void setScript(java.lang.String script)
Sets the hook script.- Specified by:
setScript
in interfaceBaseConfiguration
- Overrides:
setScript
in classBaseConfigurationImpl
- Parameters:
script
-
-
couldInherit
public boolean couldInherit()
Could this hook inherit data from some other place, if it did not have local data?- Specified by:
couldInherit
in interfaceHookConfig
- Returns:
- true if there is data that could be inherited
-
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
-
detachFromParent
public boolean detachFromParent()
This method removes this objects from its parent container. If this cannot be removed from the parent the contents should be cleared (default implementation) and true be returned as if it were removed. If the object cannot be cleared or removed it should return false.- Specified by:
detachFromParent
in interfaceBaseConfiguration
- Overrides:
detachFromParent
in classBaseConfigurationImpl
- Returns:
true
if this object was removed;false
if it could not be removed.
-
reattachToParent
public boolean reattachToParent(int position)
This method reattaches this object to its former parent.- Specified by:
reattachToParent
in interfaceBaseConfiguration
- Overrides:
reattachToParent
in classBaseConfigurationImpl
- Returns:
true
if this object was reattached;false
if not;
-
setInheritsFrom
public void setInheritsFrom(BaseConfiguration inheritFrom)
Sets the object from which this object inherits data.Note: Call this method to setup a temporary (non persistent) object for inheritance.
- Specified by:
setInheritsFrom
in interfaceBaseConfiguration
- Overrides:
setInheritsFrom
in classBaseConfigurationImpl
- Parameters:
inheritFrom
- The new inheritsFrom value.
-
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
-
getShortName
public java.lang.String getShortName()
Description copied from class:BaseConfigurationImpl
Gets the shortName attribute of the BaseConfiguration object. The short name is the last component in a multi component name. E.g.: AssemblyLines/MyName --> "MyName"- Specified by:
getShortName
in interfaceBaseConfiguration
- Overrides:
getShortName
in classBaseConfigurationImpl
- Returns:
- The shortName value
-
-