Interface BaseConfiguration
-
- All Superinterfaces:
java.io.Serializable
- All Known Subinterfaces:
ALMappingConfig,AssemblyLineConfig,AttributeMapConfig,AttributeMapItem,BranchCondition,BranchingConfig,CallConfig,CallParamConfig,CheckpointConfig,ConnectorConfig,ConnectorSchemaConfig,ConnectorSchemaItemConfig,ContainerConfig,DeltaConfig,ExposedProperty,ExternalPropertiesConfig,FormConfig,FormItemConfig,FormSection,FunctionConfig,HookConfig,HooksConfig,InheritConfig,InstanceConfig,LibraryConfig,LinkCriteriaConfig,LinkCriteriaItem,LogConfig,LogConfigItem,LoopConfig,MetamergeConfig,MetamergeFolder,NamespaceConfig,OperationConfig,OperationsConfig,ParserConfig,PoolDefConfig,PoolInstanceConfig,PropertyConfig,PropertyManager,PropertyStoreConfig,RawConnectorConfig,RawFunctionConfig,ReconnectConfig,ReconnectRuleConfig,SandboxConfig,SchedulerConfig,SchemaConfig,SchemaItemConfig,ScriptConfig,SequenceConfig,SimulationConfig,SolutionInterface,TombstonesConfig,ValidatorConfig
- All Known Implementing Classes:
ALMappingConfigImpl,AssemblyLineConfigImpl,AttributeMapConfigImpl,AttributeMapItemImpl,BaseConfigurationImpl,BranchConditionImpl,BranchingConfigImpl,CallConfigImpl,CallParamConfigImpl,CheckpointConfigImpl,ConnectorConfigImpl,ConnectorSchemaConfigImpl,ConnectorSchemaItemConfigImpl,ContainerConfigImpl,DeltaConfigImpl,ExposedPropertyImpl,ExternalPropertiesDelegator,ExternalPropertiesImpl,FormConfigImpl,FormItemConfigImpl,FormSectionImpl,FunctionConfigImpl,HookConfigImpl,HooksConfigImpl,InheritConfigImpl,InstanceConfigImpl,LibraryConfigImpl,LinkCriteriaConfigImpl,LinkCriteriaItemImpl,LogConfigImpl,LogConfigItemImpl,LoopConfigImpl,MetamergeConfigFS,MetamergeConfigImpl,MetamergeConfigXML,MetamergeFolderImpl,NamespaceConfigImpl,OperationConfigImpl,ParserConfigImpl,PoolDefConfigImpl,PoolInstanceConfigImpl,PropertyConfigImpl,PropertyManagerImpl,PropertyStoreConfigImpl,RawConnectorConfigImpl,RawFunctionConfigImpl,ReconnectConfigImpl,ReconnectRuleConfigImpl,SandboxConfigImpl,SchedulerConfigImpl,SchemaConfigImpl,SchemaItemConfigImpl,ScriptConfigImpl,SequenceConfigImpl,SimulationConfigImpl,SolutionInterfaceImpl,TombstonesConfigImpl,ValidatorConfigImpl
public interface BaseConfiguration extends java.io.SerializableThis interface provides the basic methods used by all configuration sub-classes. It provides a number of getter/setter methods for parameters as well as methods for change notification. Every instance of BaseConfiguration also has a pointer to the MetamergeConfig object that created it. When changes are made, the MetamergeConfig object is also notified by calling the setModified() method. Other objects are notified only if they have registered for change notification.Inheritance from other objects is only configured when the setupInheritanceChain() method is called. The latter method retrieves the inherit from attribute which names the object from which this object inherits values. It is also possible to call the setInheritsFrom() method to setup a temporary (non persistent) object for inheritance.
When inherited data is returned it should be cloned so that the object from which we inherit is not tampered with. Configuration objects that return inherited data (such as AttributeMapConfig) typically returns an orphaned object. The class that returns such an orphaned object typically register itself as a listener for change event. When a change event occurs, the orphaned object is added to the local store for the object.
One example of such behavior is the AttributeMapConfig. It will return an orphaned AttributeMapItem object and register itself for change notification. When a change occurs in the AttributeMapItem object, the AttributeMapConfig call its own setAttribute() method to add the object to the local attribute map items list (and unregisters for notifications of course).
-
-
Field Summary
Fields Modifier and Type Field Description static charCHILD_PATH_SEPARATORSeparator between path componentsstatic intDISABLE_EXTPROPSFlag to disable expansion of external properties (getParameter)static intDISABLE_INHERITANCEFlag to disable inherited access (getParameter)static java.lang.StringINHERIT_NONEExplicitly disregards inheritancestatic java.lang.StringINHERIT_PARENTInherit from parentstatic intONE_LEVELReturn keys of this objectstatic intRECURSIVEFlag that determines if getKeys() should recurse to inherited objectstatic intRECURSIVE_ONELEVELConvenience for RECURSIVE + ONE_LEVELstatic intRECURSIVE_SUBTREEConvenience for RECURSIVE + SUBTREEstatic intSEARCH_EXACTCASESearch option.static intSEARCH_ONELEVELSearch option.static intSEARCH_PARAMNAMESearch option.static intSEARCH_PARAMNAME_RESearch option.static intSEARCH_PROPERTYSearch option.static intSEARCH_REGEXSearch option.static intSEARCH_SUBSTRINGSearch option.static intSUBTREEReturn child entries's keys of this object
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddListener(MetamergeConfigChangeListener listener)Registers an object to be notified of change events in this object.booleandetachFromParent()This method removes this objects from its parent container.booleanflatten(java.util.List<java.lang.String> excludedNS)flatten - 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 name, 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 the keys in the data 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 the BaseConfiguration object.booleangetEnabled()Gets the enabled attribute of the BaseConfiguration 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 name, int defval)Converts value from getParameter call to an intjava.util.List<java.lang.String>getKeys(int level)Gets the keys attribute of the BaseConfiguration objectbooleangetLogEnabled()Gets the log enabled attribute of the BaseConfiguration object.MetamergeConfiggetMetamergeConfig()Gets the MetamergeConfig object to which this object belongs.booleangetModified()Modified statelonggetModTS()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 the BaseConfiguration object.java.lang.StringgetNullBehaviorValue()Gets the nullBehaviorValue attribute of the BaseConfiguration object.java.lang.StringgetNullDefinition()Gets the nullDefinition attribute of the BaseConfiguration object.java.lang.StringgetNullDefinitionValue()Gets the nullDefinitionValue attribute of the BaseConfiguration object.java.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 the BaseConfiguration 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.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.StringgetPath()Returns the complete path to this object.java.util.List<java.lang.String>getReferences(java.util.List<java.lang.String> list)java.lang.StringgetScript()Gets the script attribute of the BaseConfiguration object.java.lang.StringgetScriptEngine()Gets the ScriptEngine attribute of the BaseConfiguration 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()booleangetUseListeners()Deprecated.use theMetamergeConfigFactory.getUseConfigListeners()method insteadjava.lang.StringgetUserComment()booleanhasParameter(java.lang.Object name)Returnstrueif parameter name is local to this object.voidinit()Called to initialize to object.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.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 data)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 the BaseConfiguration object.voidsetEnabled(boolean enabled)Sets the enabled attribute of the BaseConfiguration object.voidsetFlags(int flags)Controls how the getParameter behaves in terms of inheritance and external properties.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 the BaseConfiguration 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 the BaseConfiguration objectvoidsetName(javax.naming.Name name)Sets the name attribute of the BaseConfiguration objectvoidsetNullBehavior(java.lang.String nb)Sets the nullBehavior attribute of the BaseConfiguration object.voidsetNullBehaviorValue(java.lang.String nbv)Sets the nullBehaviorValue attribute of the BaseConfiguration object.voidsetNullDefinition(java.lang.String nb)Sets the nullDefinition attribute of the BaseConfiguration object.voidsetNullDefinitionValue(java.lang.String nbv)Sets the nullDefinitionValue attribute of the BaseConfiguration object.voidsetParameter(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)Sets the user property name to use for an attribute.voidsetParent(BaseConfiguration parent)Sets the parent object to which this object belongs.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 the BaseConfiguration object.voidsetScriptEngine(java.lang.String engine)Sets the ScriptEngine attribute of the BaseConfiguration 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 object.voidsetupInheritanceChain()Called to initialize the inheritance chain for this object.voidsetUseListeners(boolean value)Deprecated.use theMetamergeConfigFactory.setUseConfigListeners(boolean)method insteadvoidsetUserComment(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.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.booleanwillFlatten(java.util.List<java.lang.String> excludedNS)
-
-
-
Field Detail
-
INHERIT_NONE
static final java.lang.String INHERIT_NONE
Explicitly disregards inheritance- See Also:
- Constant Field Values
-
INHERIT_PARENT
static final java.lang.String INHERIT_PARENT
Inherit from parent- See Also:
- Constant Field Values
-
ONE_LEVEL
static final int ONE_LEVEL
Return keys of this object- See Also:
- Constant Field Values
-
SUBTREE
static final int SUBTREE
Return child entries's keys of this object- See Also:
- Constant Field Values
-
RECURSIVE
static final int RECURSIVE
Flag that determines if getKeys() should recurse to inherited object- See Also:
- Constant Field Values
-
RECURSIVE_SUBTREE
static final int RECURSIVE_SUBTREE
Convenience for RECURSIVE + SUBTREE- See Also:
- Constant Field Values
-
RECURSIVE_ONELEVEL
static final int RECURSIVE_ONELEVEL
Convenience for RECURSIVE + ONE_LEVEL- See Also:
- Constant Field Values
-
DISABLE_INHERITANCE
static final int DISABLE_INHERITANCE
Flag to disable inherited access (getParameter)- See Also:
- Constant Field Values
-
DISABLE_EXTPROPS
static final int DISABLE_EXTPROPS
Flag to disable expansion of external properties (getParameter)- See Also:
- Constant Field Values
-
CHILD_PATH_SEPARATOR
static final char CHILD_PATH_SEPARATOR
Separator between path components- Since:
- 7.0
- See Also:
- Constant Field Values
-
SEARCH_ONELEVEL
static final int SEARCH_ONELEVEL
Search option. Indicates that only keys of this object will be searched.- See Also:
- Constant Field Values
-
SEARCH_EXACTCASE
static final int SEARCH_EXACTCASE
Search option. Indicates objects matching the exact case will be returned.- See Also:
- Constant Field Values
-
SEARCH_REGEX
static final int SEARCH_REGEX
Search option. Indicates objects matching a given regular expression will be returned.- See Also:
- Constant Field Values
-
SEARCH_PARAMNAME
static final int SEARCH_PARAMNAME
Search option. Indicates that the parameter name will be used as a value to search for.- See Also:
- Constant Field Values
-
SEARCH_PROPERTY
static final int SEARCH_PROPERTY
Search option. Indicates that the user property name of the parameter or its value will be used as a value to search for.- See Also:
- Constant Field Values
-
SEARCH_SUBSTRING
static final int SEARCH_SUBSTRING
Search option. Indicates that the value is checked for presence of the search string.- See Also:
- Constant Field Values
-
SEARCH_PARAMNAME_RE
static final int SEARCH_PARAMNAME_RE
Search option. Convenience for SEARCH_PARAMNAME + SEARCH_REGEX.- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
javax.naming.Name getName()
The object's full name- Returns:
- The name value
-
getShortName
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"- Returns:
- The shortName value
-
setName
void setName(javax.naming.Name name)
Sets the name attribute of the BaseConfiguration object- Parameters:
name- The new name value
-
setName
void setName(java.lang.String name) throws java.lang.ExceptionSets the name attribute of the BaseConfiguration object- Parameters:
name- The new name value- Throws:
java.lang.Exception- if the operation does not succeed
-
getNamespace
java.lang.Object getNamespace()
Gets the namespace attribute of the BaseConfiguration object- Returns:
- The namespace value
-
getModified
boolean getModified()
Modified state- Returns:
- The modified value
-
setModified
void setModified(boolean modified)
Sets the modified attribute of the BaseConfiguration object- Parameters:
modified- The new modified value
-
setFlags
void setFlags(int flags)
Controls how the getParameter behaves in terms of inheritance and external properties.- Parameters:
flags- new value for the flags
-
getFlags
int getFlags()
Returns the flags which determines how the getParameter behaves in terms of inheritance and external properties.- Returns:
- value of the flags
-
getParameterRaw
java.lang.Object getParameterRaw(java.lang.Object name)
Returns the value for a given config item without expanding the property value.- Parameters:
name- The parameter name- Returns:
- The parameter value
-
getParameter
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.- Parameters:
name- The parameter name- Returns:
- The parameter value
-
getParameter
java.lang.Object getParameter(java.lang.Object name, java.lang.Object createValue)Gets the parameter attribute of the BaseConfiguration object. If the parameter is not present a default value is assigned to the parameter using createValue.- Parameters:
name- The parameter namecreateValue- The value added to this object in case the parameter does not exist- Returns:
- The parameter value
-
getParameter
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.
- 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
java.lang.String getStringParameter(java.lang.Object name)
Converts value from getParameter call to a string- Parameters:
name- The parameter name- Returns:
- The stringParameter value
-
getBooleanParameter
boolean getBooleanParameter(java.lang.Object name, boolean defval)Converts value from getParameter call to a boolean- Parameters:
name- The parameter namedefval- The default value if parameter does not exist- Returns:
- The boolean value
-
getIntegerParameter
int getIntegerParameter(java.lang.Object name, int defval)Converts value from getParameter call to an int- Parameters:
name- The parameter namedefval- The default value if parameter does not exist- Returns:
- The integerParameter value
-
setParameter
void setParameter(java.lang.Object name, java.lang.Object value)Sets the value for a given config item- Parameters:
name- Parameter namevalue- Parameter value
-
setProtectedParameter
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.- 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
-
setBooleanParameter
void setBooleanParameter(java.lang.Object name, boolean value)Calls setParameter converting value to a Boolean object.- Parameters:
name- Parameter namevalue- Parameter value
-
setIntegerParameter
void setIntegerParameter(java.lang.Object name, int value)Calls setParameter converting value to an Integer object.- Parameters:
name- Parameter namevalue- Parameter value
-
setStringParameter
void setStringParameter(java.lang.Object name, java.lang.String value)Calls setParameter.- Parameters:
name- Parameter namevalue- Parameter value
-
setParameter
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 ).- Parameters:
name- Parameter namevalue- Parameter valuenotify- Iftrue, notify of the change.- Since:
- 6.1.1
-
removeParameter
void removeParameter(java.lang.Object name)
Removes a local parameter from this object.- Parameters:
name- Parameter name
-
hasParameter
boolean hasParameter(java.lang.Object name)
Returnstrueif parameter name is local to this object.- Parameters:
name- Parameter name- Returns:
trueif name is local.
-
isParameterLocal
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.- Parameters:
name- Parameter name- Returns:
trueif name is local; otherwisefalse.
-
getParameterPropertySource
java.lang.String getParameterPropertySource(java.lang.Object name)
Returns the user property name for a parameter.- Parameters:
name- Parameter name- Returns:
- The user property source value.
-
setParameterPropertySource
void setParameterPropertySource(java.lang.Object name, java.lang.String propertySource)Sets the user property name to use for an attribute.- Parameters:
name- Parameter namepropertySource- User property name
-
size
int size()
Number of key/value pairs.- Returns:
- A count of local items in this object.
-
getData
java.util.TreeMap getData()
Returns a TreeMap with key/value pairs for all local parameters.- Returns:
- The TreeMap object.
-
setData
void setData(java.util.TreeMap data)
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.
- Parameters:
data- The new data value.
-
init
void init() throws java.lang.Exception
Called to initialize to object.- Throws:
java.lang.Exception- if the initialization fails.
-
getDataIterator
java.util.Iterator<java.lang.String> getDataIterator()
Returns an Iterator for the keys in the data object.- Returns:
- The dataIterator value.
-
getKeys
java.util.List<java.lang.String> getKeys(int level)
Gets the keys attribute of the BaseConfiguration object- Parameters:
level- The level of keys returned.- Returns:
- The list of keys
-
getUseListeners
@Deprecated boolean getUseListeners()
Deprecated.use theMetamergeConfigFactory.getUseConfigListeners()method insteadChecks whether event listeners are used.- Returns:
trueif event listeners are used; otherwisefalse.
-
setUseListeners
@Deprecated void setUseListeners(boolean value)
Deprecated.use theMetamergeConfigFactory.setUseConfigListeners(boolean)method insteadSpecifies whether event listeners are used.- Parameters:
value-trueindicates using event listeners;false- not using
-
addListener
void addListener(MetamergeConfigChangeListener listener)
Registers an object to be notified of change events in this object.- Parameters:
listener- The listener object to notify.
-
removeListener
void removeListener(MetamergeConfigChangeListener listener)
Removes a listener from the notification list.- Parameters:
listener- The listener object to remove.
-
notifyChange
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.
- Parameters:
source- The caller initiating the change eventkey- The key that changedoperation- The operation performed on key
-
notifyChange
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.
- Parameters:
source- The caller initiating the change eventkey- The key that changedoperation- The operation performed on keyuserObject- Arbitrary object provided by caller
-
toEntry
java.lang.Object toEntry() throws java.lang.ExceptionThis method returns aEntryobject constructed from the internal data structure.- Returns:
- The entry representing the internal data.
- Throws:
java.lang.Exception- Any exception thrown by the implementing class.
-
fromEntry
void fromEntry(java.lang.Object entry) throws java.lang.ExceptionThis method populates this object's internal data with the data from aEntryobject.- Parameters:
entry- The entry containing data.- Throws:
java.lang.Exception- Any exception thrown by the implementing class.
-
setParent
void setParent(BaseConfiguration parent)
Sets the parent object to which this object belongs. Many configuration objects are part of another object and cannot be addressed by the MetamergeConfig object. These objects should notify their parents of any changes made.- Parameters:
parent- The new parent value
-
getParent
BaseConfiguration getParent()
Returns the parent object to which this object belongs.- Returns:
- The parent value.
-
setMetamergeConfig
void setMetamergeConfig(MetamergeConfig mc)
Sets the MetamergeConfig object to which this object belongs.- Parameters:
mc- The new metamergeConfig object
-
getMetamergeConfig
MetamergeConfig getMetamergeConfig()
Gets the MetamergeConfig object to which this object belongs.- Returns:
- The metamergeConfig object
-
setupInheritanceChain
void setupInheritanceChain() throws java.lang.ExceptionCalled to initialize the inheritance chain for this object.- Throws:
java.lang.Exception- if the operation does not succeed
-
getInheritsFrom
BaseConfiguration getInheritsFrom()
Returns the object from which this object inherits data.- Returns:
- The inherited object.
-
getInheritsFromRef
java.lang.String getInheritsFromRef()
Gets the name of the object this object should inherit its values.- Returns:
- The name of the inherited object.
-
setInheritsFromRef
void setInheritsFromRef(java.lang.String ref)
Sets the name of the object from which this object should inherit its values.- Parameters:
ref- The new inheritsFromRef value
-
updateInheritsFrom
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.- Parameters:
ref- The new inheritsFromRef value- Throws:
java.lang.Exception- if the operation does not succeed
-
setInheritsFrom
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.
- Parameters:
inherit- The new inheritsFrom value.
-
getDebug
boolean getDebug()
Returns the debug flag for the object.- Returns:
- The debug value.
-
getDebug
boolean getDebug(boolean defval)
Returns the debug flag for the object.- Parameters:
defval- The value to be returned, if the debug parameter cannot be found- Returns:
- The debug value.
-
setDebug
void setDebug(boolean debug)
Sets the debug flag for the object.- Parameters:
debug- The new debug value
-
getDebugBreak
boolean getDebugBreak(boolean defval)
Gets the debugBreak attribute of the BaseConfiguration object.- Parameters:
defval- The value to be returned, if the debugBreak parameter cannot be found- Returns:
- The debugBreak value.
-
setDebugBreak
void setDebugBreak(boolean debug)
Sets the debugBreak attribute of the BaseConfiguration object.- Parameters:
debug- The new debugBreak value
-
getScript
java.lang.String getScript()
Gets the script attribute of the BaseConfiguration object.- Returns:
- The script value.
-
setScript
void setScript(java.lang.String script)
Sets the script attribute of the BaseConfiguration object.- Parameters:
script- The new script value
-
getScriptEngine
java.lang.String getScriptEngine()
Gets the ScriptEngine attribute of the BaseConfiguration object.- Returns:
- The ScriptEngine value.
-
setScriptEngine
void setScriptEngine(java.lang.String engine)
Sets the ScriptEngine attribute of the BaseConfiguration object.- Parameters:
engine- The new ScriptEngine value
-
getNullBehavior
java.lang.String getNullBehavior()
Gets the nullBehavior attribute of the BaseConfiguration object.- Returns:
- The nullBehavior value.
-
getNullBehaviorValue
java.lang.String getNullBehaviorValue()
Gets the nullBehaviorValue attribute of the BaseConfiguration object.- Returns:
- The nullBehaviorValue value.
-
setNullBehavior
void setNullBehavior(java.lang.String nb)
Sets the nullBehavior attribute of the BaseConfiguration object.- Parameters:
nb- The new nullBehavior value
-
setNullBehaviorValue
void setNullBehaviorValue(java.lang.String nbv)
Sets the nullBehaviorValue attribute of the BaseConfiguration object.- Parameters:
nbv- The new nullBehaviorValue value
-
getNullDefinition
java.lang.String getNullDefinition()
Gets the nullDefinition attribute of the BaseConfiguration object.- Returns:
- The nullDefinition value.
-
getNullDefinitionValue
java.lang.String getNullDefinitionValue()
Gets the nullDefinitionValue attribute of the BaseConfiguration object.- Returns:
- The nullDefinitionValue value.
-
setNullDefinition
void setNullDefinition(java.lang.String nb)
Sets the nullDefinition attribute of the BaseConfiguration object.- Parameters:
nb- The new nullBehavior value
-
setNullDefinitionValue
void setNullDefinitionValue(java.lang.String nbv)
Sets the nullDefinitionValue attribute of the BaseConfiguration object.- Parameters:
nbv- The new nullBehaviorValue value
-
getEnabled
boolean getEnabled()
Gets the enabled attribute of the BaseConfiguration object.- Returns:
- The nullBehaviorValue value.
-
setEnabled
void setEnabled(boolean enabled)
Sets the enabled attribute of the BaseConfiguration object.- Parameters:
enabled-truefor enabling;falseotherwise.
-
getClone
java.lang.Object getClone() throws java.lang.Exception- Returns:
- a cloned version of this object.
- Throws:
java.lang.Exception
-
getLogEnabled
boolean getLogEnabled()
Gets the log enabled attribute of the BaseConfiguration object.- Returns:
- The nullBehaviorValue value.
-
setLogEnabled
void setLogEnabled(boolean enabled)
Sets the log enabled attribute of the BaseConfiguration object.- Parameters:
enabled-truefor enabled log;falseotherwise.
-
setUserComment
void setUserComment(java.lang.String comment)
Sets the user defined comment string.- Parameters:
comment- new value for user comment
-
getUserComment
java.lang.String getUserComment()
- Returns:
- the user defined comment string.
-
getSubstitutionMap
java.util.Map<java.lang.String,java.lang.Object> getSubstitutionMap()
- Returns:
- the Map object containing available objects for param substitution.
-
setSubstitutionMap
void setSubstitutionMap(java.util.Map<java.lang.String,java.lang.Object> map)
Sets the substitution map for this configuration object.- Parameters:
map- the new value for the substitution map
-
willFlatten
boolean willFlatten(java.util.List<java.lang.String> excludedNS)
- Parameters:
excludedNS- List of namespaces to exclude from flattening- Returns:
trueif this object will attempt flattening given the provided excluded namespaces.
-
flatten
boolean flatten(java.util.List<java.lang.String> excludedNS) throws java.lang.Exceptionflatten - 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.- Parameters:
excludedNS- List of namespaces to exclude from flattening- Returns:
falseif this object did not flatten because of inheritance from excludedNS;trueotherwise.- Throws:
java.lang.Exception
-
getReferences
java.util.List<java.lang.String> getReferences(java.util.List<java.lang.String> list)
- 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
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.- 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
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.- 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
BaseConfiguration getChild(java.lang.Object name)
- Parameters:
name- The name of the configuration object- Returns:
- the configuration object named name.
-
setChild
void setChild(java.lang.Object name, BaseConfiguration config)Associates a configuration object with a name in this configuration- Parameters:
name- The nameconfig- The configuration object
-
nameForChild
java.lang.String nameForChild(BaseConfiguration config)
Returns the name for a configuration object- Parameters:
config- The configuration object- Returns:
- The name associated with config or null if not found
-
getChildNames
java.util.List<java.lang.String> getChildNames()
Returns a list of names for all child configuration object- Returns:
- list of names
-
getPath
java.lang.String getPath()
Returns the complete path to this object. The complete path is built by concatenating the names (child names, not necessarily the actual object names as returned by getName()) for all objects in the parent chain. The parent chain typically starts with the major objects like AssemblyLineConfig etc.- Returns:
- The full path to this object
-
getChildForPath
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.- 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.
-
detachFromParent
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.- Returns:
trueif this object was removed;falseif it could not be removed.- Since:
- 7.0
-
reattachToParent
boolean reattachToParent(int position)
This method reattaches this object to its former parent.- Parameters:
position-- Returns:
trueif this object was reattached;falseif not;- Since:
- 7.0
-
isExpression
boolean isExpression(java.lang.Object parameter)
- Parameters:
parameter- name of the parameter- Returns:
trueif the parameter is an expression.- Since:
- 7.0
-
notifyChange
void notifyChange(MetamergeConfigChange event)
Signal a change event to listeners. This method is typically called by setParameter but not user code.- Parameters:
event- The event describing the change- Since:
- 7.0
-
getModTS
long getModTS()
Returns the last time this BaseConfiguration was changed. For internal use.- Since:
- 7.1.1
-
setModTS
void setModTS(long time)
Sets the last time this BaseConfiguration was changed For internal use.- Since:
- 7.1.1
-
setProtectedParameter
void setProtectedParameter(java.lang.String name)
Marks a parameter as needing protection (a password)- Since:
- 7.2
-
isProtectedParameter
boolean isProtectedParameter(java.lang.String name)
Returns true if this is a parameter that needs to be protected (a password)- Since:
- 7.2
-
-