com.ibm.di.config.base
Class HookConfigImpl

java.lang.Object
  extended by com.ibm.di.config.base.BaseConfigurationImpl
      extended by com.ibm.di.config.base.HookConfigImpl
All Implemented Interfaces:
BaseConfiguration, HookConfig, MetamergeConfigChangeListener, 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
HookConfigImpl()
          Constructor
HookConfigImpl(Object config)
          Constructor providing a TreeMap of attribute/value pairs.
HookConfigImpl(Object name, String script)
          Constructor providing hook name and script.
 
Method Summary
 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(List<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.
 Object getHookName()
           
 String getScript()
          Gets the script attribute of this object.
 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(Object name)
          Sets hook name.
 void setInheritsFrom(BaseConfiguration inheritFrom)
          Sets the object from which this object inherits data.
 void setScript(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, 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, 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, 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, setScriptEngine, setStringParameter, setSubstitutionMap, setUseListeners, setUserComment, size, toEntry, updateInheritsFrom, willFlatten
 

Constructor Detail

HookConfigImpl

public HookConfigImpl()
Constructor


HookConfigImpl

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

Parameters:
config - initial config

HookConfigImpl

public HookConfigImpl(Object name,
                      String script)
Constructor providing hook name and script. Creates enabled hook.

Parameters:
name -
script -
Method Detail

getHookName

public Object getHookName()
Specified by:
getHookName in interface HookConfig
Returns:
Hook name

setHookName

public void setHookName(Object name)
Sets hook name.

Specified by:
setHookName in interface HookConfig
Parameters:
name -

getEnabled

public boolean getEnabled()
Gets the enabled attribute of this object.

Specified by:
getEnabled in interface BaseConfiguration
Specified by:
getEnabled in interface HookConfig
Overrides:
getEnabled in class BaseConfigurationImpl
Returns:
The nullBehaviorValue value.

setEnabled

public void setEnabled(boolean enabled)
Sets the enabled attribute of this object.

Specified by:
setEnabled in interface BaseConfiguration
Specified by:
setEnabled in interface HookConfig
Overrides:
setEnabled in class BaseConfigurationImpl
Parameters:
enabled - true for enabling; false otherwise.

getScript

public String getScript()
Gets the script attribute of this object.

Specified by:
getScript in interface BaseConfiguration
Overrides:
getScript in class BaseConfigurationImpl
Returns:
The script value.

setScript

public void setScript(String script)
Sets the hook script.

Specified by:
setScript in interface BaseConfiguration
Overrides:
setScript in class BaseConfigurationImpl
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 interface HookConfig
Returns:
true if there is data that could be inherited

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

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 interface BaseConfiguration
Overrides:
detachFromParent in class BaseConfigurationImpl
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 interface BaseConfiguration
Overrides:
reattachToParent in class BaseConfigurationImpl
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 interface BaseConfiguration
Overrides:
setInheritsFrom in class BaseConfigurationImpl
Parameters:
inheritFrom - The new inheritsFrom value.

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

getShortName

public 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 interface BaseConfiguration
Overrides:
getShortName in class BaseConfigurationImpl
Returns:
The shortName value