|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.config.base.BaseConfigurationImpl
public class BaseConfigurationImpl
Field Summary | |
---|---|
static String |
NAME
|
Fields inherited from interface com.ibm.di.config.interfaces.BaseConfiguration |
---|
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, SUBTREE |
Constructor Summary | |
---|---|
BaseConfigurationImpl()
Empty constructor |
|
BaseConfigurationImpl(Object data)
Constructor providing a TreeMap of attribute/value pairs |
Method Summary | |
---|---|
void |
addListener(MetamergeConfigChangeListener listener)
Registers an object to be notified of change events in this object. |
void |
configurationChanged(MetamergeConfigChange mcc)
|
TreeMap |
deepClone(TreeMap inputMap)
Clones the local data structure |
Object |
expandPropertyValue(Object name,
Object value)
Substitutes the parameter value with a user property value. |
Object |
expandPropertyValue(Object name,
Object value,
List cref)
|
boolean |
flatten(List excludedNS)
flatten - combines all values from this object and its inherited objects into one single config object. |
void |
fromEntry(Object entry)
This method should populate this object with data from a com.ibm.di.entry.Entry object. |
boolean |
getBooleanParameter(Object key,
boolean defval)
Converts value from getParameter call to a boolean |
BaseConfiguration |
getChild(Object name)
Named children support |
BaseConfiguration |
getChildForPath(String path)
This method traverses the child hierarchy (from the top) and returns the configuration object associated with the path. |
List |
getChildNames()
Returns a list of names for all child configuration object |
Object |
getClone()
Returns a cloned version of this object. |
TreeMap |
getData()
Returns the internal data structure for this object. |
Iterator |
getDataIterator()
Returns an Iterator for all keys in this object. |
boolean |
getDebug()
Common methods |
boolean |
getDebug(boolean defval)
Returns the debug flag for the object. |
boolean |
getDebugBreak(boolean defval)
Gets the debugBreak attribute of the BaseConfiguration object |
boolean |
getEnabled()
Gets the enabled attribute of the BaseConfiguration object |
int |
getFlags()
Returns flags |
BaseConfiguration |
getInheritsFrom()
Returns the configuration we inherit from. |
String |
getInheritsFromRef()
Returns the explictly inherited object name |
int |
getIntegerParameter(Object key,
int defval)
Converts value from getParameter call to an int |
List |
getKeys(int level)
Returns a list of keys in this object. |
boolean |
getLogEnabled()
Gets the log enabled attribute of the BaseConfiguration object |
MetamergeConfig |
getMetamergeConfig()
Gets the metamergeConfig objects to which this object belongs. |
boolean |
getModified()
Returns the modified state of this object. |
Name |
getName()
Returns the name of this object |
Object |
getNamespace()
Gets the namespace attribute of the BaseConfiguration object |
String |
getNullBehavior()
Gets the nullBehavior attribute of the BaseConfiguration object |
String |
getNullBehaviorValue()
Gets the nullBehaviorValue attribute of the BaseConfiguration object |
String |
getNullDefinition()
Gets the nullDefinition attribute of the BaseConfiguration object |
String |
getNullDefinitionValue()
Gets the nullDefinitionValue attribute of the BaseConfiguration object |
Object |
getParameter(Object name)
Returns the value for a given config item. |
Object |
getParameter(Object name,
Object createValue)
Gets the parameter attribute of the BaseConfiguration object. |
Object |
getParameter(Object name,
Object createValue,
List cref)
Returns the value for a given config item. |
String |
getParameterPropertySource(Object name)
Returns the property name source for a given parameter name. |
String |
getParameterPropertySourceFromValue(Object value)
|
Object |
getParameterRaw(Object name)
Returns the value for a given config item without expanding the property value. |
BaseConfiguration |
getParent()
Returns the parent configuration object |
String |
getParentName()
Returns a string giving the complete name of the parent, followed by a dot If no parent, return empty string |
String |
getPath()
This method returns the path to this object. |
List |
getReferences(List list)
Returns a list of all references to other object from which this object or its children inherit from. |
static ResourceHash |
getResHash()
|
String |
getScript()
Gets the script attribute of the BaseConfiguration object |
String |
getScriptEngine()
Gets the ScriptEngine attribute of the BaseConfiguration object |
String |
getShortName()
Gets the shortName attribute of the BaseConfiguration object. |
String |
getStringParameter(Object name)
Converts value from getParameter call to a string |
Map |
getSubstitutionMap()
Returns the Map object containing available objects for param substitution |
boolean |
getUseListeners()
|
String |
getUserComment()
Returns the user defined comment string |
boolean |
hasParameter(Object name)
Returns true if parameter name is local to this object. |
void |
init()
init - method called after internal data structure is set |
boolean |
isParameterLocal(Object name)
Returns true if either the parameter is local or false if the parameter does not exist either in this object or in any inherited object. |
String |
nameForChild(BaseConfiguration config)
Returns the name for a configuration object |
void |
notifyChange(Object source,
Object key,
int operation)
Signal a change event to listeners. |
void |
notifyChange(Object source,
Object key,
int operation,
Object userObject)
Signal a change event to listeners. |
protected void |
performNotifyChange(MetamergeConfigChange mcc)
|
void |
removeListener(MetamergeConfigChangeListener listener)
Removes a listener from the notification list. |
void |
removeParameter(Object name)
Get/Set parameter variants. |
List |
search(String text,
int options,
int sizelimit)
Searches a configuration object and optionally its children for a specific key or value. |
List |
search(String text,
int options,
int sizelimit,
List results)
Searches a configuration object and optionally its children for a specific key or value. |
void |
setBooleanParameter(Object name,
boolean value)
Calls setParameter converting value to a Boolean object |
void |
setChild(Object name,
BaseConfiguration config)
Associates a configuration object with a name in this configuration |
void |
setData(TreeMap obj)
Sets the internal data structure for this object. |
void |
setDebug(boolean debug)
Common method - Sets the debug flag for the object |
void |
setDebugBreak(boolean debug)
Sets the debugBreak attribute of the BaseConfiguration object |
void |
setEnabled(boolean autoStart)
Gets the enabled attribute of the BaseConfiguration object |
void |
setFlags(int flags)
Set flags ( like ignore inheritance ) |
void |
setInheritsFrom(BaseConfiguration inherit)
Sets the configuration we inherit from. |
void |
setInheritsFromRef(String ref)
Sets the name of the object from which this object should inherit its values. |
void |
setIntegerParameter(Object name,
int value)
Calls setParameter converting value to an Integer object |
void |
setLogEnabled(boolean enabled)
Sets the log enabled attribute of the BaseConfiguration object |
void |
setMetamergeConfig(MetamergeConfig mc)
Sets the Metamergeconfig object to which this object belongs. |
void |
setModified(boolean modified)
Sets the modified state of this object. |
void |
setName(Name name)
Sets the name of this object |
void |
setName(String name)
Sets the name attribute of the BaseConfiguration object |
void |
setNullBehavior(String nb)
Sets the nullBehavior attribute of the BaseConfiguration object |
void |
setNullBehaviorValue(String nbv)
Sets the nullBehaviorValue attribute of the BaseConfiguration object |
void |
setNullDefinition(String nb)
Sets the nullDefinition attribute of the BaseConfiguration object |
void |
setNullDefinitionValue(String nbv)
Sets the nullDefinitionValue attribute of the BaseConfiguration object |
void |
setParameter(Object name,
Object value)
Sets the value for a given config item |
void |
setParameter(Object name,
Object value,
boolean notify)
Sets the value for a given config item, optionally notifying the change. |
void |
setParameterPropertySource(Object name,
String propertySource)
Associates a parameter name with a user property. |
void |
setParent(BaseConfiguration parent)
Sets the parent object. |
void |
setProtectedParameter(Object name,
Object value)
Stores the parameter value in the default password store if one is configured. |
void |
setScript(String script)
Sets the script attribute of the BaseConfiguration object |
void |
setScriptEngine(String engine)
Sets the ScriptEngine attribute of the BaseConfiguration object |
void |
setStringParameter(Object name,
String value)
Calls setParameter |
void |
setSubstitutionMap(Map map)
Sets the substutition map for this configuration object |
void |
setupInheritanceChain()
Established the inheritance chain for this object. |
void |
setUseListeners(boolean value)
Event listener methods. |
void |
setUserComment(String comment)
v Sets the user defined comment string |
int |
size()
Returns the total number of keys in this configuration object. |
Object |
toEntry()
Object/State using Entry object. |
String |
toString()
|
void |
updateInheritsFrom(String ref)
Sets the name of the object from which this object should inherit its values and calls the setupInheritanceChain to activate the change. |
boolean |
willExpandProps()
|
boolean |
willFlatten(List excludedNS)
willFlatten - returns true if this object will attempt flattening given the provided excluded namespaces |
boolean |
willUseInherited()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String NAME
Constructor Detail |
---|
public BaseConfigurationImpl()
public BaseConfigurationImpl(Object data)
Method Detail |
---|
public static ResourceHash getResHash()
public void setupInheritanceChain() throws Exception
setupInheritanceChain
in interface BaseConfiguration
Exception
- if the operation does not succeedpublic BaseConfiguration getInheritsFrom()
getInheritsFrom
in interface BaseConfiguration
public String getInheritsFromRef()
getInheritsFromRef
in interface BaseConfiguration
public void setInheritsFrom(BaseConfiguration inherit)
setInheritsFrom
in interface BaseConfiguration
inherit
- The new inheritsFrom valuepublic void updateInheritsFrom(String ref) throws Exception
BaseConfiguration
updateInheritsFrom
in interface BaseConfiguration
ref
- The new inheritsFromRef value
Exception
public void setInheritsFromRef(String ref)
BaseConfiguration
setInheritsFromRef
in interface BaseConfiguration
ref
- The new inheritsFromRef valuepublic boolean getModified()
getModified
in interface BaseConfiguration
public void setModified(boolean modified)
setModified
in interface BaseConfiguration
modified
- The new modified valuepublic void setUseListeners(boolean value)
setUseListeners
in interface BaseConfiguration
public boolean getUseListeners()
getUseListeners
in interface BaseConfiguration
public void addListener(MetamergeConfigChangeListener listener)
BaseConfiguration
addListener
in interface BaseConfiguration
listener
- The listener object to notify.public void removeListener(MetamergeConfigChangeListener listener)
BaseConfiguration
removeListener
in interface BaseConfiguration
listener
- The listener object to removepublic void configurationChanged(MetamergeConfigChange mcc)
configurationChanged
in interface MetamergeConfigChangeListener
public void notifyChange(Object source, Object key, int operation)
BaseConfiguration
notifyChange
in interface BaseConfiguration
source
- The caller initiating the change eventkey
- The key that changedoperation
- The operation performed on keypublic void notifyChange(Object source, Object key, int operation, Object userObject)
BaseConfiguration
notifyChange
in interface BaseConfiguration
source
- The caller initiating the change eventkey
- The key that changedoperation
- The operation performed on keyuserObject
- Arbitrary object provided by callerprotected void performNotifyChange(MetamergeConfigChange mcc)
public int size()
size
in interface BaseConfiguration
public Name getName()
getName
in interface BaseConfiguration
public String getShortName()
BaseConfiguration
getShortName
in interface BaseConfiguration
public Object getNamespace()
BaseConfiguration
getNamespace
in interface BaseConfiguration
public void setName(Name name)
setName
in interface BaseConfiguration
name
- The new name valuepublic void setName(String name) throws Exception
BaseConfiguration
setName
in interface BaseConfiguration
name
- The new name value
Exception
- if the operation does not succeedpublic TreeMap getData()
getData
in interface BaseConfiguration
public TreeMap deepClone(TreeMap inputMap)
public void setData(TreeMap obj)
setData
in interface BaseConfiguration
obj
- The new data valuepublic void init() throws Exception
init
in interface BaseConfiguration
Exception
- if the initialization failspublic Iterator getDataIterator()
getDataIterator
in interface BaseConfiguration
public List getKeys(int level)
getKeys
in interface BaseConfiguration
level
- The level of keys returned.
public BaseConfiguration getParent()
getParent
in interface BaseConfiguration
public String getParentName()
public void setParent(BaseConfiguration parent)
setParent
in interface BaseConfiguration
parent
- The new parent valuepublic void setFlags(int flags)
setFlags
in interface BaseConfiguration
public int getFlags()
getFlags
in interface BaseConfiguration
public void removeParameter(Object name)
removeParameter
in interface BaseConfiguration
name
- Parameter namepublic boolean isParameterLocal(Object name)
BaseConfiguration
isParameterLocal
in interface BaseConfiguration
name
- Parameter name
public boolean hasParameter(Object name)
BaseConfiguration
hasParameter
in interface BaseConfiguration
name
- Parameter name
public Object getParameterRaw(Object name)
BaseConfiguration
getParameterRaw
in interface BaseConfiguration
name
- The parameter name
public Object getParameter(Object name)
BaseConfiguration
getParameter
in interface BaseConfiguration
name
- The parameter name
public Object getParameter(Object name, Object createValue)
BaseConfiguration
getParameter
in interface BaseConfiguration
name
- The parameter namecreateValue
- The value added to this object in case the parameter does not exist
public Object getParameter(Object name, Object createValue, List cref)
BaseConfiguration
getParameter
in interface BaseConfiguration
name
- The parameter namecreateValue
- The value added to this object in case the parameter does not exist
"@param cref The circular references list
public String getStringParameter(Object name)
BaseConfiguration
getStringParameter
in interface BaseConfiguration
name
- The parameter name
public boolean getBooleanParameter(Object key, boolean defval)
BaseConfiguration
getBooleanParameter
in interface BaseConfiguration
key
- The parameter namedefval
- The default value if parameter does not exist
public int getIntegerParameter(Object key, int defval)
BaseConfiguration
getIntegerParameter
in interface BaseConfiguration
key
- The parameter namedefval
- The default value if parameter does not exist
public void setParameter(Object name, Object value)
BaseConfiguration
setParameter
in interface BaseConfiguration
name
- Parameter namevalue
- Parameter valuepublic void setParameter(Object name, Object value, boolean notify)
BaseConfiguration
setParameter
in interface BaseConfiguration
name
- Parameter namevalue
- Parameter valuenotify
- If true, notify of the changepublic void setProtectedParameter(Object name, Object value) throws Exception
BaseConfiguration
setProtectedParameter
in interface BaseConfiguration
name
- Parameter namevalue
- Parameter value
Exception
public void setBooleanParameter(Object name, boolean value)
BaseConfiguration
setBooleanParameter
in interface BaseConfiguration
name
- Parameter namevalue
- Parameter valuepublic void setIntegerParameter(Object name, int value)
BaseConfiguration
setIntegerParameter
in interface BaseConfiguration
name
- Parameter namevalue
- Parameter valuepublic void setStringParameter(Object name, String value)
BaseConfiguration
setStringParameter
in interface BaseConfiguration
name
- Parameter namevalue
- Parameter valuepublic String getParameterPropertySource(Object name)
getParameterPropertySource
in interface BaseConfiguration
name
- Parameter name
public String getParameterPropertySourceFromValue(Object value)
public void setParameterPropertySource(Object name, String propertySource)
setParameterPropertySource
in interface BaseConfiguration
name
- Parameter namepropertySource
- User property namepublic Object expandPropertyValue(Object name, Object value)
public Object expandPropertyValue(Object name, Object value, List cref)
public Object toEntry() throws Exception
toEntry
in interface BaseConfiguration
Exception
- Any exception thrown by the implementing classpublic void fromEntry(Object entry) throws Exception
BaseConfiguration
fromEntry
in interface BaseConfiguration
entry
- The entry containing data
Exception
- Any exception thrown by the implementing classpublic String toString()
toString
in class Object
public void setMetamergeConfig(MetamergeConfig mc)
BaseConfiguration
setMetamergeConfig
in interface BaseConfiguration
mc
- The new metamergeConfig objectpublic MetamergeConfig getMetamergeConfig()
BaseConfiguration
getMetamergeConfig
in interface BaseConfiguration
public boolean getDebug()
getDebug
in interface BaseConfiguration
public boolean getDebug(boolean defval)
BaseConfiguration
getDebug
in interface BaseConfiguration
defval
- The value to be returned, if the debug parameter cannot be found
public void setDebug(boolean debug)
BaseConfiguration
setDebug
in interface BaseConfiguration
debug
- The new debug valuepublic boolean getDebugBreak(boolean defval)
BaseConfiguration
getDebugBreak
in interface BaseConfiguration
defval
- The value to be returned, if the debugBreak parameter cannot be found
public void setDebugBreak(boolean debug)
BaseConfiguration
setDebugBreak
in interface BaseConfiguration
debug
- The new debugBreak valuepublic String getScript()
BaseConfiguration
getScript
in interface BaseConfiguration
public void setScript(String script)
BaseConfiguration
setScript
in interface BaseConfiguration
script
- The new script valuepublic String getScriptEngine()
BaseConfiguration
getScriptEngine
in interface BaseConfiguration
public void setScriptEngine(String engine)
BaseConfiguration
setScriptEngine
in interface BaseConfiguration
engine
- The new ScriptEngine valuepublic String getNullBehavior()
BaseConfiguration
getNullBehavior
in interface BaseConfiguration
public String getNullBehaviorValue()
BaseConfiguration
getNullBehaviorValue
in interface BaseConfiguration
public void setNullBehavior(String nb)
BaseConfiguration
setNullBehavior
in interface BaseConfiguration
nb
- The new nullBehavior valuepublic void setNullBehaviorValue(String nbv)
BaseConfiguration
setNullBehaviorValue
in interface BaseConfiguration
nbv
- The new nullBehaviorValue valuepublic String getNullDefinition()
getNullDefinition
in interface BaseConfiguration
public String getNullDefinitionValue()
getNullDefinitionValue
in interface BaseConfiguration
public void setNullDefinition(String nb)
setNullDefinition
in interface BaseConfiguration
nb
- The new nullBehavior valuepublic void setNullDefinitionValue(String nbv)
setNullDefinitionValue
in interface BaseConfiguration
nbv
- The new nullBehaviorValue valuepublic boolean getEnabled()
BaseConfiguration
getEnabled
in interface BaseConfiguration
public void setEnabled(boolean autoStart)
BaseConfiguration
setEnabled
in interface BaseConfiguration
public boolean willExpandProps()
public boolean willUseInherited()
public Object getClone() throws Exception
BaseConfiguration
getClone
in interface BaseConfiguration
Exception
public boolean getLogEnabled()
BaseConfiguration
getLogEnabled
in interface BaseConfiguration
public void setLogEnabled(boolean enabled)
BaseConfiguration
setLogEnabled
in interface BaseConfiguration
public void setUserComment(String comment)
setUserComment
in interface BaseConfiguration
public String getUserComment()
getUserComment
in interface BaseConfiguration
public Map getSubstitutionMap()
getSubstitutionMap
in interface BaseConfiguration
public void setSubstitutionMap(Map map)
setSubstitutionMap
in interface BaseConfiguration
public boolean flatten(List excludedNS) throws Exception
flatten
in interface BaseConfiguration
excludedNS
- List of namespaces to exclude from flattening
Exception
public boolean willFlatten(List excludedNS)
willFlatten
in interface BaseConfiguration
public List getReferences(List list)
BaseConfiguration
getReferences
in interface BaseConfiguration
list
- If non-null, the object must use the provided list rather than creating its ownpublic List search(String text, int options, int sizelimit)
BaseConfiguration
search
in interface BaseConfiguration
text
- The search textoptions
- Search options (oneLevel=1, exactCase=2, regExp=4, paramName=8)sizelimit
- Max number of hits returnedpublic List search(String text, int options, int sizelimit, List results)
BaseConfiguration
search
in interface BaseConfiguration
text
- The search textoptions
- Search options (oneLevel=1, exactCase=2, regExp=4, paramName=8)sizelimit
- Max number of hits returnedresults
- A list of results.public BaseConfiguration getChild(Object name)
getChild
in interface BaseConfiguration
name
- The name of the configuration objectpublic void setChild(Object name, BaseConfiguration config)
BaseConfiguration
setChild
in interface BaseConfiguration
name
- The nameconfig
- The configuration objectpublic List getChildNames()
BaseConfiguration
getChildNames
in interface BaseConfiguration
public String nameForChild(BaseConfiguration config)
BaseConfiguration
nameForChild
in interface BaseConfiguration
config
- The configuration object
public BaseConfiguration getChildForPath(String path) throws NameNotFoundException
BaseConfiguration
getChildForPath
in interface BaseConfiguration
path
- The complete path to an object (as returned by getPath())
NameNotFoundException
public String getPath()
getPath
in interface BaseConfiguration
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |