Package com.ibm.di.config.base
Class BaseConfigurationImpl
- java.lang.Object
-
- com.ibm.di.config.base.BaseConfigurationImpl
-
- All Implemented Interfaces:
BaseConfiguration
,MetamergeConfigChangeListener
,java.io.Serializable
- Direct Known Subclasses:
AssemblyLineConfigImpl
,AttributeMapConfigImpl
,AttributeMapItemImpl
,BranchConditionImpl
,CallConfigImpl
,CallParamConfigImpl
,CheckpointConfigImpl
,ConnectorConfigImpl
,ConnectorSchemaConfigImpl
,ConnectorSchemaItemConfigImpl
,ContainerConfigImpl
,DeltaConfigImpl
,ExposedPropertyImpl
,ExternalPropertiesDelegator
,ExternalPropertiesImpl
,FormConfigImpl
,FormItemConfigImpl
,FormSectionImpl
,HookConfigImpl
,InheritConfigImpl
,InstanceConfigImpl
,LibraryConfigImpl
,LinkCriteriaConfigImpl
,LinkCriteriaItemImpl
,LogConfigImpl
,LogConfigItemImpl
,MetamergeConfigImpl
,MetamergeFolderImpl
,NamespaceConfigImpl
,OperationConfigImpl
,ParserConfigImpl
,PoolDefConfigImpl
,PoolInstanceConfigImpl
,PropertyConfigImpl
,PropertyManagerImpl
,PropertyStoreConfigImpl
,RawConnectorConfigImpl
,RawFunctionConfigImpl
,ReconnectConfigImpl
,ReconnectRuleConfigImpl
,SandboxConfigImpl
,SchedulerConfigImpl
,SchemaConfigImpl
,SchemaItemConfigImpl
,ScriptConfigImpl
,SimulationConfigImpl
,TombstonesConfigImpl
,ValidatorConfigImpl
public class BaseConfigurationImpl extends java.lang.Object implements BaseConfiguration, MetamergeConfigChangeListener
This class provides the basic methods for all the configuration classes.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NAME
Name used for notify events.-
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 BaseConfigurationImpl()
Empty constructorBaseConfigurationImpl(java.lang.Object data)
Constructor providing a TreeMap of attribute/value pairs
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addListener(MetamergeConfigChangeListener listener)
Registers an object to be notified of change events in this object.void
configurationChanged(MetamergeConfigChange mcc)
java.util.TreeMap
deepClone(java.util.TreeMap inputMap)
Clones the local data structure.boolean
detachFromParent()
This method removes this objects from its parent container.java.lang.Object
expandPropertyValue(java.lang.Object name, java.lang.Object value)
Substitutes the parameter value with a user property value.java.lang.Object
expandPropertyValue(java.lang.Object name, java.lang.Object value, java.util.List<java.lang.String> cref)
Substitutes the parameter value with a user property value.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.void
fromEntry(java.lang.Object entry)
This method populates this object's internal data with the data from aEntry
object.boolean
getBooleanParameter(java.lang.Object key, boolean defval)
Converts value from getParameter call to a booleanBaseConfiguration
getChild(java.lang.Object name)
BaseConfiguration
getChildForPath(java.lang.String path)
This method traverses the child hierarchy (from the top) and returns the configuration object associated with the path.java.util.List<java.lang.String>
getChildNames()
Returns a list of names for all child configuration objectjava.lang.Object
getClone()
java.util.TreeMap
getData()
Returns a TreeMap with key/value pairs for all local parameters.java.util.Iterator<java.lang.String>
getDataIterator()
Returns an Iterator for all keys in this object.boolean
getDebug()
Returns the debug flag for the object.boolean
getDebug(boolean defval)
Returns the debug flag for the object.boolean
getDebugBreak(boolean defval)
Gets the debugBreak attribute of this object.boolean
getEnabled()
Gets the enabled attribute of this object.int
getFlags()
Returns the flags which determines how the getParameter behaves in terms of inheritance and external properties.BaseConfiguration
getInheritsFrom()
Returns the object from which this object inherits data.java.lang.String
getInheritsFromRef()
Gets the name of the object this object should inherit its values.int
getIntegerParameter(java.lang.Object key, int defval)
Converts value from getParameter call to an intjava.util.List<java.lang.String>
getKeys(int level)
Returns a list of keys in this object.boolean
getLogEnabled()
Gets the log enabled attribute of this object.java.lang.String
getLongName()
MetamergeConfig
getMetamergeConfig()
Gets the MetamergeConfig object to which this object belongs.boolean
getModified()
Returns the modified state of this object.long
getModTS()
Returns the last time this BaseConfiguration was changed.javax.naming.Name
getName()
The object's full namejava.lang.Object
getNamespace()
Gets the namespace attribute of the BaseConfiguration objectjava.lang.String
getNullBehavior()
Gets the nullBehavior attribute of this object.java.lang.String
getNullBehaviorValue()
Gets the nullBehaviorValue attribute of this object.java.lang.String
getNullDefinition()
Gets the nullDefinition attribute of the BaseConfiguration objectjava.lang.String
getNullDefinitionValue()
Gets the nullDefinitionValue attribute of the BaseConfiguration objectjava.lang.Object
getParameter(java.lang.Object name)
Returns the value for a given config item.java.lang.Object
getParameter(java.lang.Object name, java.lang.Object createValue)
Gets the parameter attribute of this config object.java.lang.Object
getParameter(java.lang.Object name, java.lang.Object createValue, java.util.List<java.lang.String> cref)
Returns the value for a given config item.java.lang.String
getParameterPropertySource(java.lang.Object name)
Returns the user property name for a parameter.java.lang.String
getParameterPropertySourceFromValue(java.lang.Object value)
java.lang.Object
getParameterRaw(java.lang.Object name)
Returns the value for a given config item without expanding the property value.BaseConfiguration
getParent()
Returns the parent object to which this object belongs.java.lang.String
getParentName()
java.lang.String
getPath()
This method returns the path to this object.java.util.List<java.lang.String>
getReferences(java.util.List<java.lang.String> list)
static ResourceHash
getResHash()
java.lang.String
getScript()
Gets the script attribute of this object.java.lang.String
getScriptEngine()
Gets the ScriptEngine attribute of this object.java.lang.String
getShortName()
Gets the shortName attribute of the BaseConfiguration object.java.lang.String
getStringParameter(java.lang.Object name)
Converts value from getParameter call to a stringjava.util.Map<java.lang.String,java.lang.Object>
getSubstitutionMap()
static boolean
getUseConfigListeners()
boolean
getUseListeners()
Deprecated.java.lang.String
getUserComment()
boolean
hasParameter(java.lang.Object name)
Returnstrue
if parameter name is local to this object.void
init()
Called after internal data structure is set.boolean
isExpression(java.lang.Object parameter)
boolean
isParameterLocal(java.lang.Object name)
Returnstrue
if the parameter is local andfalse
if the parameter does not exist either in this object or in any inherited object.boolean
isProtectedParameter(java.lang.String name)
Returns true if this is a parameter that needs to be protected (a password)java.lang.String
nameForChild(BaseConfiguration config)
Returns the name for a configuration objectvoid
notifyChange(MetamergeConfigChange event)
Signal a change event to listeners.void
notifyChange(java.lang.Object source, java.lang.Object key, int operation)
Notifies listeners for a change event.void
notifyChange(java.lang.Object source, java.lang.Object key, int operation, java.lang.Object userObject)
Notifies listeners for a change event.protected void
performNotifyChange(MetamergeConfigChange mcc)
Notifies all registered listeners for a specified config for a change event.boolean
reattachToParent(int position)
This method reattaches this object to its former parent.void
removeListener(MetamergeConfigChangeListener listener)
Removes a listener from the notification list.void
removeParameter(java.lang.Object name)
Removes a local parameter from this object.java.util.List<javax.naming.Binding>
search(java.lang.String text, int options, int sizelimit)
Searches a configuration object and optionally its children for a specific key or value.java.util.List<javax.naming.Binding>
search(java.lang.String text, int options, int sizelimit, java.util.List<javax.naming.Binding> results)
Searches a configuration object and optionally its children for a specific key or value.void
setBooleanParameter(java.lang.Object name, boolean value)
Calls setParameter converting value to a Boolean object.void
setChild(java.lang.Object name, BaseConfiguration config)
Associates a configuration object with a name in this configurationvoid
setData(java.util.TreeMap obj)
Sets the data to be used by this object.void
setDebug(boolean debug)
Sets the debug flag for the object.void
setDebugBreak(boolean debug)
Sets the debugBreak attribute of this object.void
setEnabled(boolean autoStart)
Sets the enabled attribute of this object.void
setFlags(int flags)
Sets flags.void
setInheritsFrom(BaseConfiguration inherit)
Sets the object from which this object inherits data.void
setInheritsFromRef(java.lang.String ref)
Sets the name of the object from which this object should inherit its values.void
setIntegerParameter(java.lang.Object name, int value)
Calls setParameter converting value to an Integer object.void
setLogEnabled(boolean enabled)
Sets the log enabled attribute of this object.void
setMetamergeConfig(MetamergeConfig mc)
Sets the MetamergeConfig object to which this object belongs.void
setModified(boolean modified)
Sets the modified attribute of the BaseConfiguration objectvoid
setModTS(long time)
Sets the last time this BaseConfiguration was changed For internal use.void
setName(java.lang.String name)
Sets the name attribute of this object.void
setName(javax.naming.Name name)
Sets the name of this object.void
setNullBehavior(java.lang.String nb)
Sets the nullBehavior attribute of this object.void
setNullBehaviorValue(java.lang.String nbv)
Sets the nullBehaviorValue attribute of this object.void
setNullDefinition(java.lang.String nb)
Sets the nullDefinition attribute of the BaseConfiguration objectvoid
setNullDefinitionValue(java.lang.String nbv)
Sets the nullDefinitionValue attribute of the BaseConfiguration objectvoid
setParameter(java.lang.Object name, java.lang.Object value)
Sets the value for a given config itemvoid
setParameter(java.lang.Object name, java.lang.Object value, boolean notify)
Sets the value for a given config item, optionally notifying the change.void
setParameterPropertySource(java.lang.Object name, java.lang.String propertySource)
Associates a parameter name with a user property.void
setParent(BaseConfiguration parent)
Sets the parent object.void
setProtectedParameter(java.lang.Object name, java.lang.Object value)
Stores the parameter value in the default password store if one is configured.void
setProtectedParameter(java.lang.String name)
Marks a parameter as needing protection (a password)void
setScript(java.lang.String script)
Sets the script attribute of this object.void
setScriptEngine(java.lang.String engine)
Sets the ScriptEngine attribute of this object.void
setStringParameter(java.lang.Object name, java.lang.String value)
Calls setParameter.void
setSubstitutionMap(java.util.Map<java.lang.String,java.lang.Object> map)
Sets the substitution map for this configuration objectvoid
setupInheritanceChain()
Established the inheritance chain for this object.static void
setUseConfigListeners(boolean value)
Enable/disable the use of configuration listeners in the JVM.void
setUseListeners(boolean value)
Deprecated.void
setUserComment(java.lang.String comment)
Sets the user defined comment string.int
size()
Number of key/value pairs.java.lang.Object
toEntry()
This method returns aEntry
object constructed from the internal data structure.java.lang.String
toString()
Answers a string containing the name of the config.void
updateInheritsFrom(java.lang.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(java.util.List<java.lang.String> excludedNS)
boolean
willUseInherited()
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
Name used for notify events.- See Also:
- Constant Field Values
-
-
Method Detail
-
getResHash
public static ResourceHash getResHash()
- Returns:
- ResourceHash object used for access of the TMS messages.
-
setupInheritanceChain
public void setupInheritanceChain() throws java.lang.Exception
Established the inheritance chain for this object.- Specified by:
setupInheritanceChain
in interfaceBaseConfiguration
- Throws:
java.lang.Exception
- if the operation could not be performed
-
getInheritsFrom
public BaseConfiguration getInheritsFrom()
Returns the object from which this object inherits data.- Specified by:
getInheritsFrom
in interfaceBaseConfiguration
- Returns:
- The inherited object.
-
getInheritsFromRef
public java.lang.String getInheritsFromRef()
Gets the name of the object this object should inherit its values.- Specified by:
getInheritsFromRef
in interfaceBaseConfiguration
- Returns:
- The name of the inherited object.
-
setInheritsFrom
public void setInheritsFrom(BaseConfiguration inherit)
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
- Parameters:
inherit
- The new inheritsFrom value.
-
updateInheritsFrom
public void updateInheritsFrom(java.lang.String ref) throws java.lang.Exception
Sets the name of the object from which this object should inherit its values and calls the setupInheritanceChain to activate the change.- Specified by:
updateInheritsFrom
in interfaceBaseConfiguration
- Parameters:
ref
- The new inheritsFromRef value- Throws:
java.lang.Exception
- if the operation does not succeed
-
setInheritsFromRef
public void setInheritsFromRef(java.lang.String ref)
Sets the name of the object from which this object should inherit its values.- Specified by:
setInheritsFromRef
in interfaceBaseConfiguration
- Parameters:
ref
- The new inheritsFromRef value
-
getModified
public boolean getModified()
Returns the modified state of this object.- Specified by:
getModified
in interfaceBaseConfiguration
- Returns:
- the modified state.
-
setModified
public void setModified(boolean modified)
Sets the modified attribute of the BaseConfiguration object- Specified by:
setModified
in interfaceBaseConfiguration
- Parameters:
modified
- The new modified value
-
setUseListeners
@Deprecated public void setUseListeners(boolean value)
Deprecated.Specifies whether event listeners are used.- Specified by:
setUseListeners
in interfaceBaseConfiguration
- Parameters:
value
-true
indicates using event listeners;false
- not using
-
getUseListeners
@Deprecated public boolean getUseListeners()
Deprecated.Checks whether event listeners are used.- Specified by:
getUseListeners
in interfaceBaseConfiguration
- Returns:
true
if event listeners are used; otherwisefalse
.
-
setUseConfigListeners
public static void setUseConfigListeners(boolean value)
Enable/disable the use of configuration listeners in the JVM. This is an optimization to turn off listeners which the CE uses, but the Server does not need.- Parameters:
value
- False to disable configuration listeners.- Since:
- 7.0
-
getUseConfigListeners
public static boolean getUseConfigListeners()
- Returns:
- Whether configuration listeners are enabled or disabled in this JVM.
- Since:
- 7.0
- See Also:
setUseConfigListeners(boolean)
-
addListener
public void addListener(MetamergeConfigChangeListener listener)
Registers an object to be notified of change events in this object.- Specified by:
addListener
in interfaceBaseConfiguration
- Parameters:
listener
- The listener object to notify.
-
removeListener
public void removeListener(MetamergeConfigChangeListener listener)
Removes a listener from the notification list.- Specified by:
removeListener
in interfaceBaseConfiguration
- Parameters:
listener
- The listener object to remove.
-
configurationChanged
public void configurationChanged(MetamergeConfigChange mcc)
- Specified by:
configurationChanged
in interfaceMetamergeConfigChangeListener
-
notifyChange
public void notifyChange(java.lang.Object source, java.lang.Object key, int operation)
Notifies listeners for a change event.Note: This method is typically called by setParameter method but not from user code.
- Specified by:
notifyChange
in interfaceBaseConfiguration
- Parameters:
source
- The caller initiating the change eventkey
- The key that changedoperation
- The operation performed on key
-
notifyChange
public void notifyChange(java.lang.Object source, java.lang.Object key, int operation, java.lang.Object userObject)
Notifies listeners for a change event.Note: This method is typically called by setParameter method but not from user code.
- Specified by:
notifyChange
in interfaceBaseConfiguration
- Parameters:
source
- The caller initiating the change eventkey
- The key that changedoperation
- The operation performed on keyuserObject
- Arbitrary object provided by caller
-
notifyChange
public void notifyChange(MetamergeConfigChange event)
Signal a change event to listeners. This method is typically called by setParameter but not user code.- Specified by:
notifyChange
in interfaceBaseConfiguration
- Parameters:
event
- The event describing the change
-
performNotifyChange
protected void performNotifyChange(MetamergeConfigChange mcc)
Notifies all registered listeners for a specified config for a change event.- Parameters:
mcc
- the config object
-
size
public int size()
Description copied from interface:BaseConfiguration
Number of key/value pairs.- Specified by:
size
in interfaceBaseConfiguration
- Returns:
- the total number of keys in this configuration object.
-
getName
public javax.naming.Name getName()
Description copied from interface:BaseConfiguration
The object's full name- Specified by:
getName
in interfaceBaseConfiguration
- Returns:
- the name of this object.
-
getShortName
public java.lang.String getShortName()
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
- Returns:
- The shortName value
-
getLongName
public java.lang.String getLongName()
- Returns:
- a string giving the complete name of this object, including the name of all parents.
-
getNamespace
public java.lang.Object getNamespace()
Gets the namespace attribute of the BaseConfiguration object- Specified by:
getNamespace
in interfaceBaseConfiguration
- Returns:
- The namespace value
-
setName
public void setName(javax.naming.Name name)
Sets the name of this object.- Specified by:
setName
in interfaceBaseConfiguration
- Parameters:
name
- The new name value
-
setName
public void setName(java.lang.String name) throws java.lang.Exception
Sets the name attribute of this object.- Specified by:
setName
in interfaceBaseConfiguration
- Parameters:
name
- The new name value- Throws:
java.lang.Exception
- if the operation does not succeed
-
getData
public java.util.TreeMap getData()
Returns a TreeMap with key/value pairs for all local parameters.- Specified by:
getData
in interfaceBaseConfiguration
- Returns:
- The TreeMap object.
-
deepClone
public java.util.TreeMap deepClone(java.util.TreeMap inputMap)
Clones the local data structure.- Parameters:
inputMap
- TreeMap object to be cloned- Returns:
- clone of the
inputMap
parameter.
-
setData
public void setData(java.util.TreeMap obj)
Sets the data to be used by this object. The data is passed by a TreeMap object containing key/value pairs.Note: The TreeMap data is not cloned.
- Specified by:
setData
in interfaceBaseConfiguration
- Parameters:
obj
- The new data value.
-
init
public void init() throws java.lang.Exception
Called after internal data structure is set.- Specified by:
init
in interfaceBaseConfiguration
- Throws:
java.lang.Exception
-
getDataIterator
public java.util.Iterator<java.lang.String> getDataIterator()
Returns an Iterator for all keys in this object.- Specified by:
getDataIterator
in interfaceBaseConfiguration
- Returns:
- The dataIterator value.
-
getKeys
public java.util.List<java.lang.String> getKeys(int level)
Returns a list of keys in this object.- Specified by:
getKeys
in interfaceBaseConfiguration
- Parameters:
level
- can have these values:- ONE_LEVEL - only simple key/value items are returned.
- SUBTREE - all keys are returned regardless of whether they are complex (TreeMap) or simple (String, Boolean, Integer, Vector ).
- RECURSIVE - inherited keys are returned as well.
- Returns:
- The list of keys.
-
getParent
public BaseConfiguration getParent()
Returns the parent object to which this object belongs.- Specified by:
getParent
in interfaceBaseConfiguration
- Returns:
- The parent value.
-
getParentName
public java.lang.String getParentName()
- Returns:
- a string giving the complete name of the parent, followed by a dot; if no parent, return empty string
-
setParent
public void setParent(BaseConfiguration parent)
Sets the parent object.- Specified by:
setParent
in interfaceBaseConfiguration
- Parameters:
parent
- the new parent
-
setFlags
public void setFlags(int flags)
Sets flags. ( like ignore inheritance )- Specified by:
setFlags
in interfaceBaseConfiguration
- Parameters:
flags
- the new flags to set
-
getFlags
public int getFlags()
Returns the flags which determines how the getParameter behaves in terms of inheritance and external properties.- Specified by:
getFlags
in interfaceBaseConfiguration
- Returns:
- value of the flags
-
removeParameter
public void removeParameter(java.lang.Object name)
Removes a local parameter from this object.- Specified by:
removeParameter
in interfaceBaseConfiguration
- Parameters:
name
- Parameter name
-
isParameterLocal
public boolean isParameterLocal(java.lang.Object name)
Returnstrue
if the parameter is local andfalse
if the parameter does not exist either in this object or in any inherited object.- Specified by:
isParameterLocal
in interfaceBaseConfiguration
- Parameters:
name
- Parameter name- Returns:
true
if name is local; otherwisefalse
.
-
hasParameter
public boolean hasParameter(java.lang.Object name)
Returnstrue
if parameter name is local to this object.- Specified by:
hasParameter
in interfaceBaseConfiguration
- Parameters:
name
- Parameter name- Returns:
true
if name is local.
-
getParameterRaw
public java.lang.Object getParameterRaw(java.lang.Object name)
Returns the value for a given config item without expanding the property value.- Specified by:
getParameterRaw
in interfaceBaseConfiguration
- Parameters:
name
- The parameter name- Returns:
- The parameter value
-
getParameter
public java.lang.Object getParameter(java.lang.Object name)
Returns the value for a given config item. This method will call inherited object's getParameter if this object does not contain the named value. In case of returning an inherited value, the value from the inherited object will be cloned. It is up to the user to create a key/value local to this object by calling one of the setParameter methods.- Specified by:
getParameter
in interfaceBaseConfiguration
- Parameters:
name
- The parameter name- Returns:
- The parameter value
-
getParameter
public java.lang.Object getParameter(java.lang.Object name, java.lang.Object createValue)
Gets the parameter attribute of this config object. If the parameter is not present a default value is assigned to the parameter usingcreateValue
.- Specified by:
getParameter
in interfaceBaseConfiguration
- Parameters:
name
- The parameter namecreateValue
- The value added to this object in case the parameter does not exist- Returns:
- The parameter value
-
getParameter
public java.lang.Object getParameter(java.lang.Object name, java.lang.Object createValue, java.util.List<java.lang.String> cref)
Returns the value for a given config item. This method will call inherited object's getParameter if this object does not contain the named value. In case of returning an inherited value, the value from the inherited object will be cloned. It is up to the user to create a key/value local to this object by calling one of the setParameter methods.This method also conveys the List object to ParameterSubstitution calls to resolve circular references. If the parameter is not present even after calling inherited object's getParameter, a default value is assigned to the parameter using createValue.
- Specified by:
getParameter
in interfaceBaseConfiguration
- Parameters:
name
- The parameter namecreateValue
- The value added to this object in case the parameter does not existcref
- The circular references list of previously used config object expressions- Returns:
- The parameter value
-
getStringParameter
public java.lang.String getStringParameter(java.lang.Object name)
Converts value from getParameter call to a string- Specified by:
getStringParameter
in interfaceBaseConfiguration
- Parameters:
name
- The parameter name- Returns:
- The stringParameter value
-
getBooleanParameter
public boolean getBooleanParameter(java.lang.Object key, boolean defval)
Converts value from getParameter call to a boolean- Specified by:
getBooleanParameter
in interfaceBaseConfiguration
- Parameters:
key
- The parameter namedefval
- The default value if parameter does not exist- Returns:
- The boolean value
-
getIntegerParameter
public int getIntegerParameter(java.lang.Object key, int defval)
Converts value from getParameter call to an int- Specified by:
getIntegerParameter
in interfaceBaseConfiguration
- Parameters:
key
- The parameter namedefval
- The default value if parameter does not exist- Returns:
- The integerParameter value
-
setParameter
public void setParameter(java.lang.Object name, java.lang.Object value)
Sets the value for a given config item- Specified by:
setParameter
in interfaceBaseConfiguration
- Parameters:
name
- Parameter namevalue
- Parameter value
-
setParameter
public void setParameter(java.lang.Object name, java.lang.Object value, boolean notify)
Sets the value for a given config item, optionally notifying the change. If notify istrue
, the behavior is identical to setParameter( name, value ).- Specified by:
setParameter
in interfaceBaseConfiguration
- Parameters:
name
- Parameter namevalue
- Parameter valuenotify
- Iftrue
, notify of the change.
-
setProtectedParameter
public void setProtectedParameter(java.lang.Object name, java.lang.Object value) throws java.lang.Exception
Stores the parameter value in the default password store if one is configured. Retrieval of the parameter is done through the standard getParameter methods.- Specified by:
setProtectedParameter
in interfaceBaseConfiguration
- Parameters:
name
- Parameter namevalue
- Parameter value- Throws:
java.lang.Exception
- if error occurs while setting property to the property store chosen by TDIProperties object associated with this config
-
setProtectedParameter
public void setProtectedParameter(java.lang.String name)
Marks a parameter as needing protection (a password)- Specified by:
setProtectedParameter
in interfaceBaseConfiguration
-
isProtectedParameter
public boolean isProtectedParameter(java.lang.String name)
Returns true if this is a parameter that needs to be protected (a password)- Specified by:
isProtectedParameter
in interfaceBaseConfiguration
-
setBooleanParameter
public void setBooleanParameter(java.lang.Object name, boolean value)
Calls setParameter converting value to a Boolean object.- Specified by:
setBooleanParameter
in interfaceBaseConfiguration
- Parameters:
name
- Parameter namevalue
- Parameter value
-
setIntegerParameter
public void setIntegerParameter(java.lang.Object name, int value)
Calls setParameter converting value to an Integer object.- Specified by:
setIntegerParameter
in interfaceBaseConfiguration
- Parameters:
name
- Parameter namevalue
- Parameter value
-
setStringParameter
public void setStringParameter(java.lang.Object name, java.lang.String value)
Calls setParameter.- Specified by:
setStringParameter
in interfaceBaseConfiguration
- Parameters:
name
- Parameter namevalue
- Parameter value
-
getParameterPropertySource
public java.lang.String getParameterPropertySource(java.lang.Object name)
Description copied from interface:BaseConfiguration
Returns the user property name for a parameter.- Specified by:
getParameterPropertySource
in interfaceBaseConfiguration
- Parameters:
name
- the parameter name- Returns:
- the property name source for a given parameter name. If the parameter name is not associated with a user property then null is returned.
-
getParameterPropertySourceFromValue
public java.lang.String getParameterPropertySourceFromValue(java.lang.Object value)
- Parameters:
value
- parameter value- Returns:
- the parameter property source. Also converts the old property source to the new Parameter substitution format.
-
setParameterPropertySource
public void setParameterPropertySource(java.lang.Object name, java.lang.String propertySource)
Associates a parameter name with a user property.- Specified by:
setParameterPropertySource
in interfaceBaseConfiguration
- Parameters:
name
- parameter namepropertySource
- parameter property source
-
expandPropertyValue
public java.lang.Object expandPropertyValue(java.lang.Object name, java.lang.Object value)
Substitutes the parameter value with a user property value.- Parameters:
name
- parameter namevalue
- parameter value- Returns:
- expanded property value.
-
expandPropertyValue
public java.lang.Object expandPropertyValue(java.lang.Object name, java.lang.Object value, java.util.List<java.lang.String> cref)
Substitutes the parameter value with a user property value.- Parameters:
name
- parameter namevalue
- parameter valuecref
- The circular references list of previously used config object expressions- Returns:
- a valid substituted value; if error occurs returns an Exception object.
-
toEntry
public java.lang.Object toEntry() throws java.lang.Exception
This method returns aEntry
object constructed from the internal data structure. Default implementation simply copies every attribute to/from entry using String values.- Specified by:
toEntry
in interfaceBaseConfiguration
- Returns:
- The entry representing the internal data.
- Throws:
java.lang.Exception
-
fromEntry
public void fromEntry(java.lang.Object entry) throws java.lang.Exception
This method populates this object's internal data with the data from aEntry
object.- Specified by:
fromEntry
in interfaceBaseConfiguration
- Parameters:
entry
- The entry containing data.- Throws:
java.lang.Exception
-
toString
public java.lang.String toString()
Answers a string containing the name of the config.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a printable representation of the name
-
setMetamergeConfig
public void setMetamergeConfig(MetamergeConfig mc)
Sets the MetamergeConfig object to which this object belongs.- Specified by:
setMetamergeConfig
in interfaceBaseConfiguration
- Parameters:
mc
- The new metamergeConfig object
-
getMetamergeConfig
public MetamergeConfig getMetamergeConfig()
Gets the MetamergeConfig object to which this object belongs.- Specified by:
getMetamergeConfig
in interfaceBaseConfiguration
- Returns:
- The metamergeConfig object
-
getDebug
public boolean getDebug()
Returns the debug flag for the object.- Specified by:
getDebug
in interfaceBaseConfiguration
- Returns:
- The debug value.
-
getDebug
public boolean getDebug(boolean defval)
Returns the debug flag for the object.- Specified by:
getDebug
in interfaceBaseConfiguration
- Parameters:
defval
- The value to be returned, if the debug parameter cannot be found- Returns:
- The debug value.
-
setDebug
public void setDebug(boolean debug)
Sets the debug flag for the object.- Specified by:
setDebug
in interfaceBaseConfiguration
- Parameters:
debug
- The new debug value
-
getDebugBreak
public boolean getDebugBreak(boolean defval)
Gets the debugBreak attribute of this object.- Specified by:
getDebugBreak
in interfaceBaseConfiguration
- Parameters:
defval
- The value to be returned, if the debugBreak parameter cannot be found- Returns:
- The debugBreak value.
-
setDebugBreak
public void setDebugBreak(boolean debug)
Sets the debugBreak attribute of this object.- Specified by:
setDebugBreak
in interfaceBaseConfiguration
- Parameters:
debug
- The new debugBreak value.
-
getScript
public java.lang.String getScript()
Gets the script attribute of this object.- Specified by:
getScript
in interfaceBaseConfiguration
- Returns:
- The script value.
-
setScript
public void setScript(java.lang.String script)
Sets the script attribute of this object.- Specified by:
setScript
in interfaceBaseConfiguration
- Parameters:
script
- The new script value
-
getScriptEngine
public java.lang.String getScriptEngine()
Gets the ScriptEngine attribute of this object.- Specified by:
getScriptEngine
in interfaceBaseConfiguration
- Returns:
- The ScriptEngine value.
-
setScriptEngine
public void setScriptEngine(java.lang.String engine)
Sets the ScriptEngine attribute of this object.- Specified by:
setScriptEngine
in interfaceBaseConfiguration
- Parameters:
engine
- The new ScriptEngine value
-
getNullBehavior
public java.lang.String getNullBehavior()
Gets the nullBehavior attribute of this object.- Specified by:
getNullBehavior
in interfaceBaseConfiguration
- Returns:
- The nullBehavior value.
-
getNullBehaviorValue
public java.lang.String getNullBehaviorValue()
Gets the nullBehaviorValue attribute of this object.- Specified by:
getNullBehaviorValue
in interfaceBaseConfiguration
- Returns:
- The nullBehaviorValue value.
-
setNullBehavior
public void setNullBehavior(java.lang.String nb)
Sets the nullBehavior attribute of this object.- Specified by:
setNullBehavior
in interfaceBaseConfiguration
- Parameters:
nb
- The new nullBehavior value
-
setNullBehaviorValue
public void setNullBehaviorValue(java.lang.String nbv)
Sets the nullBehaviorValue attribute of this object.- Specified by:
setNullBehaviorValue
in interfaceBaseConfiguration
- Parameters:
nbv
- The new nullBehaviorValue value
-
getNullDefinition
public java.lang.String getNullDefinition()
Gets the nullDefinition attribute of the BaseConfiguration object- Specified by:
getNullDefinition
in interfaceBaseConfiguration
- Returns:
- The nullDefinition value
-
getNullDefinitionValue
public java.lang.String getNullDefinitionValue()
Gets the nullDefinitionValue attribute of the BaseConfiguration object- Specified by:
getNullDefinitionValue
in interfaceBaseConfiguration
- Returns:
- The nullDefinitionValue value
-
setNullDefinition
public void setNullDefinition(java.lang.String nb)
Sets the nullDefinition attribute of the BaseConfiguration object- Specified by:
setNullDefinition
in interfaceBaseConfiguration
- Parameters:
nb
- The new nullBehavior value
-
setNullDefinitionValue
public void setNullDefinitionValue(java.lang.String nbv)
Sets the nullDefinitionValue attribute of the BaseConfiguration object- Specified by:
setNullDefinitionValue
in interfaceBaseConfiguration
- Parameters:
nbv
- The new nullBehaviorValue value
-
getEnabled
public boolean getEnabled()
Gets the enabled attribute of this object.- Specified by:
getEnabled
in interfaceBaseConfiguration
- Returns:
- The nullBehaviorValue value.
-
setEnabled
public void setEnabled(boolean autoStart)
Sets the enabled attribute of this object.- Specified by:
setEnabled
in interfaceBaseConfiguration
- Parameters:
autoStart
-true
for enabling;false
otherwise.
-
willExpandProps
public boolean willExpandProps()
- Returns:
true
if this object will expand the external properties;false
otherwise.
-
willUseInherited
public boolean willUseInherited()
- Returns:
true
if this object will enable inherited access;false
otherwise.
-
getClone
public java.lang.Object getClone() throws java.lang.Exception
- Specified by:
getClone
in interfaceBaseConfiguration
- Returns:
- a cloned version of this object.
- Throws:
java.lang.Exception
-
getLogEnabled
public boolean getLogEnabled()
Gets the log enabled attribute of this object.- Specified by:
getLogEnabled
in interfaceBaseConfiguration
- Returns:
- The nullBehaviorValue value.
-
setLogEnabled
public void setLogEnabled(boolean enabled)
Sets the log enabled attribute of this object.- Specified by:
setLogEnabled
in interfaceBaseConfiguration
- Parameters:
enabled
-true
for enabled log;false
otherwise.
-
setUserComment
public void setUserComment(java.lang.String comment)
Sets the user defined comment string.- Specified by:
setUserComment
in interfaceBaseConfiguration
- Parameters:
comment
- new value for user comment
-
getUserComment
public java.lang.String getUserComment()
- Specified by:
getUserComment
in interfaceBaseConfiguration
- Returns:
- the user defined comment string.
-
getSubstitutionMap
public java.util.Map<java.lang.String,java.lang.Object> getSubstitutionMap()
- Specified by:
getSubstitutionMap
in interfaceBaseConfiguration
- Returns:
- the Map object containing available objects for param substitution.
-
setSubstitutionMap
public void setSubstitutionMap(java.util.Map<java.lang.String,java.lang.Object> map)
Sets the substitution map for this configuration object- Specified by:
setSubstitutionMap
in interfaceBaseConfiguration
- Parameters:
map
- the new substitution map
-
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
- 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
-
willFlatten
public boolean willFlatten(java.util.List<java.lang.String> excludedNS)
- Specified by:
willFlatten
in interfaceBaseConfiguration
- Parameters:
excludedNS
- List of namespaces to exclude from flattening- Returns:
true
if this object will attempt flattening given the provided excluded namespaces.
-
getReferences
public java.util.List<java.lang.String> getReferences(java.util.List<java.lang.String> list)
- Specified by:
getReferences
in interfaceBaseConfiguration
- Parameters:
list
- If non-null, the object must use the provided list rather than creating its own- Returns:
- a list of all references to other object from which this object or its children inherit from.
-
search
public java.util.List<javax.naming.Binding> search(java.lang.String text, int options, int sizelimit)
Searches a configuration object and optionally its children for a specific key or value.- Specified by:
search
in interfaceBaseConfiguration
- Parameters:
text
- The search textoptions
- Search options (oneLevel=1, exactCase=2, regExp=4, paramName=8)sizelimit
- Max number of hits returned- Returns:
- List of
Binding
objects containing results from the performed search.
-
search
public java.util.List<javax.naming.Binding> search(java.lang.String text, int options, int sizelimit, java.util.List<javax.naming.Binding> results)
Searches a configuration object and optionally its children for a specific key or value.- Specified by:
search
in interfaceBaseConfiguration
- Parameters:
text
- The search textoptions
- Search options (oneLevel=1, exactCase=2, regExp=4, paramName=8)sizelimit
- Max number of hits returnedresults
- A list of results.- Returns:
- the results from the performed search added into the provided
results
parameter.
-
getChild
public BaseConfiguration getChild(java.lang.Object name)
- Specified by:
getChild
in interfaceBaseConfiguration
- Parameters:
name
- The name of the configuration object- Returns:
- the configuration object named name.
-
setChild
public void setChild(java.lang.Object name, BaseConfiguration config)
Associates a configuration object with a name in this configuration- Specified by:
setChild
in interfaceBaseConfiguration
- Parameters:
name
- The nameconfig
- The configuration object
-
getChildNames
public java.util.List<java.lang.String> getChildNames()
Returns a list of names for all child configuration object- Specified by:
getChildNames
in interfaceBaseConfiguration
- Returns:
- list of names
-
nameForChild
public java.lang.String nameForChild(BaseConfiguration config)
Returns the name for a configuration object- Specified by:
nameForChild
in interfaceBaseConfiguration
- Parameters:
config
- The configuration object- Returns:
- The name associated with config or null if not found
-
getChildForPath
public BaseConfiguration getChildForPath(java.lang.String path) throws javax.naming.NameNotFoundException
This method traverses the child hierarchy (from the top) and returns the configuration object associated with the path. This method will in effect split the path in its components and recursively call getChild() to drill down to the last object in the path.- Specified by:
getChildForPath
in interfaceBaseConfiguration
- Parameters:
path
- The complete path to an object (as returned by getPath())- Returns:
- The configuration object associated with the path
- Throws:
javax.naming.NameNotFoundException
- if the child could not be found.
-
getPath
public java.lang.String getPath()
This method returns the path to this object. The path can be used to traverse a hierarchy of configuration objects/configuration values. The preferred name is the parent's name for this configuration object since we use the getChild() method to map between names and config objects. We do this since the name of this object can be different than the parent's name for the object, which basically happens when the parent container has several objects with the same name.- Specified by:
getPath
in interfaceBaseConfiguration
- Returns:
- The path to this configuration object
-
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
- 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
- Returns:
true
if this object was reattached;false
if not;
-
isExpression
public boolean isExpression(java.lang.Object parameter)
- Specified by:
isExpression
in interfaceBaseConfiguration
- Parameters:
parameter
- name of the parameter- Returns:
true
if the parameter is an expression.
-
getModTS
public long getModTS()
Description copied from interface:BaseConfiguration
Returns the last time this BaseConfiguration was changed. For internal use.- Specified by:
getModTS
in interfaceBaseConfiguration
-
setModTS
public void setModTS(long time)
Description copied from interface:BaseConfiguration
Sets the last time this BaseConfiguration was changed For internal use.- Specified by:
setModTS
in interfaceBaseConfiguration
-
-