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.StringNAMEName 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 voidaddListener(MetamergeConfigChangeListener listener)Registers an object to be notified of change events in this object.voidconfigurationChanged(MetamergeConfigChange mcc)java.util.TreeMapdeepClone(java.util.TreeMap inputMap)Clones the local data structure.booleandetachFromParent()This method removes this objects from its parent container.java.lang.ObjectexpandPropertyValue(java.lang.Object name, java.lang.Object value)Substitutes the parameter value with a user property value.java.lang.ObjectexpandPropertyValue(java.lang.Object name, java.lang.Object value, java.util.List<java.lang.String> cref)Substitutes the parameter value with a user property value.booleanflatten(java.util.List<java.lang.String> excludedNS)This method combines all values from this object and its inherited objects into one single config object.voidfromEntry(java.lang.Object entry)This method populates this object's internal data with the data from aEntryobject.booleangetBooleanParameter(java.lang.Object key, boolean defval)Converts value from getParameter call to a booleanBaseConfigurationgetChild(java.lang.Object name)BaseConfigurationgetChildForPath(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.ObjectgetClone()java.util.TreeMapgetData()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.booleangetDebug()Returns the debug flag for the object.booleangetDebug(boolean defval)Returns the debug flag for the object.booleangetDebugBreak(boolean defval)Gets the debugBreak attribute of this object.booleangetEnabled()Gets the enabled attribute of this object.intgetFlags()Returns the flags which determines how the getParameter behaves in terms of inheritance and external properties.BaseConfigurationgetInheritsFrom()Returns the object from which this object inherits data.java.lang.StringgetInheritsFromRef()Gets the name of the object this object should inherit its values.intgetIntegerParameter(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.booleangetLogEnabled()Gets the log enabled attribute of this object.java.lang.StringgetLongName()MetamergeConfiggetMetamergeConfig()Gets the MetamergeConfig object to which this object belongs.booleangetModified()Returns the modified state of this object.longgetModTS()Returns the last time this BaseConfiguration was changed.javax.naming.NamegetName()The object's full namejava.lang.ObjectgetNamespace()Gets the namespace attribute of the BaseConfiguration objectjava.lang.StringgetNullBehavior()Gets the nullBehavior attribute of this object.java.lang.StringgetNullBehaviorValue()Gets the nullBehaviorValue attribute of this object.java.lang.StringgetNullDefinition()Gets the nullDefinition attribute of the BaseConfiguration objectjava.lang.StringgetNullDefinitionValue()Gets the nullDefinitionValue attribute of the BaseConfiguration objectjava.lang.ObjectgetParameter(java.lang.Object name)Returns the value for a given config item.java.lang.ObjectgetParameter(java.lang.Object name, java.lang.Object createValue)Gets the parameter attribute of this config object.java.lang.ObjectgetParameter(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.StringgetParameterPropertySource(java.lang.Object name)Returns the user property name for a parameter.java.lang.StringgetParameterPropertySourceFromValue(java.lang.Object value)java.lang.ObjectgetParameterRaw(java.lang.Object name)Returns the value for a given config item without expanding the property value.BaseConfigurationgetParent()Returns the parent object to which this object belongs.java.lang.StringgetParentName()java.lang.StringgetPath()This method returns the path to this object.java.util.List<java.lang.String>getReferences(java.util.List<java.lang.String> list)static ResourceHashgetResHash()java.lang.StringgetScript()Gets the script attribute of this object.java.lang.StringgetScriptEngine()Gets the ScriptEngine attribute of this object.java.lang.StringgetShortName()Gets the shortName attribute of the BaseConfiguration object.java.lang.StringgetStringParameter(java.lang.Object name)Converts value from getParameter call to a stringjava.util.Map<java.lang.String,java.lang.Object>getSubstitutionMap()static booleangetUseConfigListeners()booleangetUseListeners()Deprecated.java.lang.StringgetUserComment()booleanhasParameter(java.lang.Object name)Returnstrueif parameter name is local to this object.voidinit()Called after internal data structure is set.booleanisExpression(java.lang.Object parameter)booleanisParameterLocal(java.lang.Object name)Returnstrueif the parameter is local andfalseif the parameter does not exist either in this object or in any inherited object.booleanisProtectedParameter(java.lang.String name)Returns true if this is a parameter that needs to be protected (a password)java.lang.StringnameForChild(BaseConfiguration config)Returns the name for a configuration objectvoidnotifyChange(MetamergeConfigChange event)Signal a change event to listeners.voidnotifyChange(java.lang.Object source, java.lang.Object key, int operation)Notifies listeners for a change event.voidnotifyChange(java.lang.Object source, java.lang.Object key, int operation, java.lang.Object userObject)Notifies listeners for a change event.protected voidperformNotifyChange(MetamergeConfigChange mcc)Notifies all registered listeners for a specified config for a change event.booleanreattachToParent(int position)This method reattaches this object to its former parent.voidremoveListener(MetamergeConfigChangeListener listener)Removes a listener from the notification list.voidremoveParameter(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.voidsetBooleanParameter(java.lang.Object name, boolean value)Calls setParameter converting value to a Boolean object.voidsetChild(java.lang.Object name, BaseConfiguration config)Associates a configuration object with a name in this configurationvoidsetData(java.util.TreeMap obj)Sets the data to be used by this object.voidsetDebug(boolean debug)Sets the debug flag for the object.voidsetDebugBreak(boolean debug)Sets the debugBreak attribute of this object.voidsetEnabled(boolean autoStart)Sets the enabled attribute of this object.voidsetFlags(int flags)Sets flags.voidsetInheritsFrom(BaseConfiguration inherit)Sets the object from which this object inherits data.voidsetInheritsFromRef(java.lang.String ref)Sets the name of the object from which this object should inherit its values.voidsetIntegerParameter(java.lang.Object name, int value)Calls setParameter converting value to an Integer object.voidsetLogEnabled(boolean enabled)Sets the log enabled attribute of this object.voidsetMetamergeConfig(MetamergeConfig mc)Sets the MetamergeConfig object to which this object belongs.voidsetModified(boolean modified)Sets the modified attribute of the BaseConfiguration objectvoidsetModTS(long time)Sets the last time this BaseConfiguration was changed For internal use.voidsetName(java.lang.String name)Sets the name attribute of this object.voidsetName(javax.naming.Name name)Sets the name of this object.voidsetNullBehavior(java.lang.String nb)Sets the nullBehavior attribute of this object.voidsetNullBehaviorValue(java.lang.String nbv)Sets the nullBehaviorValue attribute of this object.voidsetNullDefinition(java.lang.String nb)Sets the nullDefinition attribute of the BaseConfiguration objectvoidsetNullDefinitionValue(java.lang.String nbv)Sets the nullDefinitionValue attribute of the BaseConfiguration objectvoidsetParameter(java.lang.Object name, java.lang.Object value)Sets the value for a given config itemvoidsetParameter(java.lang.Object name, java.lang.Object value, boolean notify)Sets the value for a given config item, optionally notifying the change.voidsetParameterPropertySource(java.lang.Object name, java.lang.String propertySource)Associates a parameter name with a user property.voidsetParent(BaseConfiguration parent)Sets the parent object.voidsetProtectedParameter(java.lang.Object name, java.lang.Object value)Stores the parameter value in the default password store if one is configured.voidsetProtectedParameter(java.lang.String name)Marks a parameter as needing protection (a password)voidsetScript(java.lang.String script)Sets the script attribute of this object.voidsetScriptEngine(java.lang.String engine)Sets the ScriptEngine attribute of this object.voidsetStringParameter(java.lang.Object name, java.lang.String value)Calls setParameter.voidsetSubstitutionMap(java.util.Map<java.lang.String,java.lang.Object> map)Sets the substitution map for this configuration objectvoidsetupInheritanceChain()Established the inheritance chain for this object.static voidsetUseConfigListeners(boolean value)Enable/disable the use of configuration listeners in the JVM.voidsetUseListeners(boolean value)Deprecated.voidsetUserComment(java.lang.String comment)Sets the user defined comment string.intsize()Number of key/value pairs.java.lang.ObjecttoEntry()This method returns aEntryobject constructed from the internal data structure.java.lang.StringtoString()Answers a string containing the name of the config.voidupdateInheritsFrom(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.booleanwillExpandProps()booleanwillFlatten(java.util.List<java.lang.String> excludedNS)booleanwillUseInherited()
-
-
-
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.ExceptionEstablished the inheritance chain for this object.- Specified by:
setupInheritanceChainin 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:
getInheritsFromin 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:
getInheritsFromRefin 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:
setInheritsFromin interfaceBaseConfiguration- Parameters:
inherit- The new inheritsFrom value.
-
updateInheritsFrom
public void updateInheritsFrom(java.lang.String ref) throws java.lang.ExceptionSets the name of the object from which this object should inherit its values and calls the setupInheritanceChain to activate the change.- Specified by:
updateInheritsFromin 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:
setInheritsFromRefin interfaceBaseConfiguration- Parameters:
ref- The new inheritsFromRef value
-
getModified
public boolean getModified()
Returns the modified state of this object.- Specified by:
getModifiedin interfaceBaseConfiguration- Returns:
- the modified state.
-
setModified
public void setModified(boolean modified)
Sets the modified attribute of the BaseConfiguration object- Specified by:
setModifiedin interfaceBaseConfiguration- Parameters:
modified- The new modified value
-
setUseListeners
@Deprecated public void setUseListeners(boolean value)
Deprecated.Specifies whether event listeners are used.- Specified by:
setUseListenersin interfaceBaseConfiguration- Parameters:
value-trueindicates using event listeners;false- not using
-
getUseListeners
@Deprecated public boolean getUseListeners()
Deprecated.Checks whether event listeners are used.- Specified by:
getUseListenersin interfaceBaseConfiguration- Returns:
trueif 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:
addListenerin interfaceBaseConfiguration- Parameters:
listener- The listener object to notify.
-
removeListener
public void removeListener(MetamergeConfigChangeListener listener)
Removes a listener from the notification list.- Specified by:
removeListenerin interfaceBaseConfiguration- Parameters:
listener- The listener object to remove.
-
configurationChanged
public void configurationChanged(MetamergeConfigChange mcc)
- Specified by:
configurationChangedin 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:
notifyChangein 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:
notifyChangein 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:
notifyChangein 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:BaseConfigurationNumber of key/value pairs.- Specified by:
sizein interfaceBaseConfiguration- Returns:
- the total number of keys in this configuration object.
-
getName
public javax.naming.Name getName()
Description copied from interface:BaseConfigurationThe object's full name- Specified by:
getNamein 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:
getShortNamein 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:
getNamespacein interfaceBaseConfiguration- Returns:
- The namespace value
-
setName
public void setName(javax.naming.Name name)
Sets the name of this object.- Specified by:
setNamein interfaceBaseConfiguration- Parameters:
name- The new name value
-
setName
public void setName(java.lang.String name) throws java.lang.ExceptionSets the name attribute of this object.- Specified by:
setNamein 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:
getDatain 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
inputMapparameter.
-
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:
setDatain interfaceBaseConfiguration- Parameters:
obj- The new data value.
-
init
public void init() throws java.lang.ExceptionCalled after internal data structure is set.- Specified by:
initin 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:
getDataIteratorin 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:
getKeysin 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:
getParentin 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:
setParentin interfaceBaseConfiguration- Parameters:
parent- the new parent
-
setFlags
public void setFlags(int flags)
Sets flags. ( like ignore inheritance )- Specified by:
setFlagsin 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:
getFlagsin interfaceBaseConfiguration- Returns:
- value of the flags
-
removeParameter
public void removeParameter(java.lang.Object name)
Removes a local parameter from this object.- Specified by:
removeParameterin interfaceBaseConfiguration- Parameters:
name- Parameter name
-
isParameterLocal
public boolean isParameterLocal(java.lang.Object name)
Returnstrueif the parameter is local andfalseif the parameter does not exist either in this object or in any inherited object.- Specified by:
isParameterLocalin interfaceBaseConfiguration- Parameters:
name- Parameter name- Returns:
trueif name is local; otherwisefalse.
-
hasParameter
public boolean hasParameter(java.lang.Object name)
Returnstrueif parameter name is local to this object.- Specified by:
hasParameterin interfaceBaseConfiguration- Parameters:
name- Parameter name- Returns:
trueif 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:
getParameterRawin 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:
getParameterin 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:
getParameterin 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:
getParameterin 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:
getStringParameterin 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:
getBooleanParameterin 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:
getIntegerParameterin 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:
setParameterin 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:
setParameterin 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.ExceptionStores 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:
setProtectedParameterin 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:
setProtectedParameterin 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:
isProtectedParameterin interfaceBaseConfiguration
-
setBooleanParameter
public void setBooleanParameter(java.lang.Object name, boolean value)Calls setParameter converting value to a Boolean object.- Specified by:
setBooleanParameterin 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:
setIntegerParameterin interfaceBaseConfiguration- Parameters:
name- Parameter namevalue- Parameter value
-
setStringParameter
public void setStringParameter(java.lang.Object name, java.lang.String value)Calls setParameter.- Specified by:
setStringParameterin interfaceBaseConfiguration- Parameters:
name- Parameter namevalue- Parameter value
-
getParameterPropertySource
public java.lang.String getParameterPropertySource(java.lang.Object name)
Description copied from interface:BaseConfigurationReturns the user property name for a parameter.- Specified by:
getParameterPropertySourcein 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:
setParameterPropertySourcein 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.ExceptionThis method returns aEntryobject constructed from the internal data structure. Default implementation simply copies every attribute to/from entry using String values.- Specified by:
toEntryin interfaceBaseConfiguration- Returns:
- The entry representing the internal data.
- Throws:
java.lang.Exception
-
fromEntry
public void fromEntry(java.lang.Object entry) throws java.lang.ExceptionThis method populates this object's internal data with the data from aEntryobject.- Specified by:
fromEntryin 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:
toStringin 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:
setMetamergeConfigin interfaceBaseConfiguration- Parameters:
mc- The new metamergeConfig object
-
getMetamergeConfig
public MetamergeConfig getMetamergeConfig()
Gets the MetamergeConfig object to which this object belongs.- Specified by:
getMetamergeConfigin interfaceBaseConfiguration- Returns:
- The metamergeConfig object
-
getDebug
public boolean getDebug()
Returns the debug flag for the object.- Specified by:
getDebugin interfaceBaseConfiguration- Returns:
- The debug value.
-
getDebug
public boolean getDebug(boolean defval)
Returns the debug flag for the object.- Specified by:
getDebugin 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:
setDebugin interfaceBaseConfiguration- Parameters:
debug- The new debug value
-
getDebugBreak
public boolean getDebugBreak(boolean defval)
Gets the debugBreak attribute of this object.- Specified by:
getDebugBreakin 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:
setDebugBreakin interfaceBaseConfiguration- Parameters:
debug- The new debugBreak value.
-
getScript
public java.lang.String getScript()
Gets the script attribute of this object.- Specified by:
getScriptin interfaceBaseConfiguration- Returns:
- The script value.
-
setScript
public void setScript(java.lang.String script)
Sets the script attribute of this object.- Specified by:
setScriptin interfaceBaseConfiguration- Parameters:
script- The new script value
-
getScriptEngine
public java.lang.String getScriptEngine()
Gets the ScriptEngine attribute of this object.- Specified by:
getScriptEnginein interfaceBaseConfiguration- Returns:
- The ScriptEngine value.
-
setScriptEngine
public void setScriptEngine(java.lang.String engine)
Sets the ScriptEngine attribute of this object.- Specified by:
setScriptEnginein interfaceBaseConfiguration- Parameters:
engine- The new ScriptEngine value
-
getNullBehavior
public java.lang.String getNullBehavior()
Gets the nullBehavior attribute of this object.- Specified by:
getNullBehaviorin interfaceBaseConfiguration- Returns:
- The nullBehavior value.
-
getNullBehaviorValue
public java.lang.String getNullBehaviorValue()
Gets the nullBehaviorValue attribute of this object.- Specified by:
getNullBehaviorValuein interfaceBaseConfiguration- Returns:
- The nullBehaviorValue value.
-
setNullBehavior
public void setNullBehavior(java.lang.String nb)
Sets the nullBehavior attribute of this object.- Specified by:
setNullBehaviorin interfaceBaseConfiguration- Parameters:
nb- The new nullBehavior value
-
setNullBehaviorValue
public void setNullBehaviorValue(java.lang.String nbv)
Sets the nullBehaviorValue attribute of this object.- Specified by:
setNullBehaviorValuein interfaceBaseConfiguration- Parameters:
nbv- The new nullBehaviorValue value
-
getNullDefinition
public java.lang.String getNullDefinition()
Gets the nullDefinition attribute of the BaseConfiguration object- Specified by:
getNullDefinitionin interfaceBaseConfiguration- Returns:
- The nullDefinition value
-
getNullDefinitionValue
public java.lang.String getNullDefinitionValue()
Gets the nullDefinitionValue attribute of the BaseConfiguration object- Specified by:
getNullDefinitionValuein interfaceBaseConfiguration- Returns:
- The nullDefinitionValue value
-
setNullDefinition
public void setNullDefinition(java.lang.String nb)
Sets the nullDefinition attribute of the BaseConfiguration object- Specified by:
setNullDefinitionin 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:
setNullDefinitionValuein interfaceBaseConfiguration- Parameters:
nbv- The new nullBehaviorValue value
-
getEnabled
public boolean getEnabled()
Gets the enabled attribute of this object.- Specified by:
getEnabledin interfaceBaseConfiguration- Returns:
- The nullBehaviorValue value.
-
setEnabled
public void setEnabled(boolean autoStart)
Sets the enabled attribute of this object.- Specified by:
setEnabledin interfaceBaseConfiguration- Parameters:
autoStart-truefor enabling;falseotherwise.
-
willExpandProps
public boolean willExpandProps()
- Returns:
trueif this object will expand the external properties;falseotherwise.
-
willUseInherited
public boolean willUseInherited()
- Returns:
trueif this object will enable inherited access;falseotherwise.
-
getClone
public java.lang.Object getClone() throws java.lang.Exception- Specified by:
getClonein 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:
getLogEnabledin interfaceBaseConfiguration- Returns:
- The nullBehaviorValue value.
-
setLogEnabled
public void setLogEnabled(boolean enabled)
Sets the log enabled attribute of this object.- Specified by:
setLogEnabledin interfaceBaseConfiguration- Parameters:
enabled-truefor enabled log;falseotherwise.
-
setUserComment
public void setUserComment(java.lang.String comment)
Sets the user defined comment string.- Specified by:
setUserCommentin interfaceBaseConfiguration- Parameters:
comment- new value for user comment
-
getUserComment
public java.lang.String getUserComment()
- Specified by:
getUserCommentin interfaceBaseConfiguration- Returns:
- the user defined comment string.
-
getSubstitutionMap
public java.util.Map<java.lang.String,java.lang.Object> getSubstitutionMap()
- Specified by:
getSubstitutionMapin 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:
setSubstitutionMapin interfaceBaseConfiguration- Parameters:
map- the new substitution map
-
flatten
public boolean flatten(java.util.List<java.lang.String> excludedNS) throws java.lang.ExceptionThis 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:
flattenin interfaceBaseConfiguration- Parameters:
excludedNS- List of namespaces to exclude from flattening- Returns:
trueif 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:
willFlattenin interfaceBaseConfiguration- Parameters:
excludedNS- List of namespaces to exclude from flattening- Returns:
trueif 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:
getReferencesin 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:
searchin 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
Bindingobjects 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:
searchin 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
resultsparameter.
-
getChild
public BaseConfiguration getChild(java.lang.Object name)
- Specified by:
getChildin 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:
setChildin 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:
getChildNamesin interfaceBaseConfiguration- Returns:
- list of names
-
nameForChild
public java.lang.String nameForChild(BaseConfiguration config)
Returns the name for a configuration object- Specified by:
nameForChildin 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:
getChildForPathin 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:
getPathin 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:
detachFromParentin interfaceBaseConfiguration- Returns:
trueif this object was removed;falseif it could not be removed.
-
reattachToParent
public boolean reattachToParent(int position)
This method reattaches this object to its former parent.- Specified by:
reattachToParentin interfaceBaseConfiguration- Returns:
trueif this object was reattached;falseif not;
-
isExpression
public boolean isExpression(java.lang.Object parameter)
- Specified by:
isExpressionin interfaceBaseConfiguration- Parameters:
parameter- name of the parameter- Returns:
trueif the parameter is an expression.
-
getModTS
public long getModTS()
Description copied from interface:BaseConfigurationReturns the last time this BaseConfiguration was changed. For internal use.- Specified by:
getModTSin interfaceBaseConfiguration
-
setModTS
public void setModTS(long time)
Description copied from interface:BaseConfigurationSets the last time this BaseConfiguration was changed For internal use.- Specified by:
setModTSin interfaceBaseConfiguration
-
-