Class BaseConfigurationImpl

    • 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 a Entry object.
      boolean getBooleanParameter​(java.lang.Object key, boolean defval)
      Converts value from getParameter call to a boolean
      BaseConfiguration 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 object
      java.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 int
      java.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 name
      java.lang.Object getNamespace()
      Gets the namespace attribute of the BaseConfiguration object
      java.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 object
      java.lang.String getNullDefinitionValue()
      Gets the nullDefinitionValue attribute of the BaseConfiguration object
      java.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 string
      java.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)
      Returns true 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)
      Returns true if the parameter is local and false 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 object
      void 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 configuration
      void 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 object
      void 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 object
      void setNullDefinitionValue​(java.lang.String nbv)
      Sets the nullDefinitionValue attribute of the BaseConfiguration object
      void setParameter​(java.lang.Object name, java.lang.Object value)
      Sets the value for a given config item
      void 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 object
      void 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 a Entry 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()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • NAME

        public static final java.lang.String NAME
        Name used for notify events.
        See Also:
        Constant Field Values
    • Constructor Detail

      • BaseConfigurationImpl

        public BaseConfigurationImpl()
        Empty constructor
      • BaseConfigurationImpl

        public BaseConfigurationImpl​(java.lang.Object data)
        Constructor providing a TreeMap of attribute/value pairs
        Parameters:
        data - TreeMap of attribute/value pairs
    • 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 interface BaseConfiguration
        Throws:
        java.lang.Exception - if the operation could not be performed
      • getInheritsFromRef

        public java.lang.String getInheritsFromRef()
        Gets the name of the object this object should inherit its values.
        Specified by:
        getInheritsFromRef in interface BaseConfiguration
        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 interface BaseConfiguration
        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 interface BaseConfiguration
        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 interface BaseConfiguration
        Parameters:
        ref - The new inheritsFromRef value
      • getModified

        public boolean getModified()
        Returns the modified state of this object.
        Specified by:
        getModified in interface BaseConfiguration
        Returns:
        the modified state.
      • setModified

        public void setModified​(boolean modified)
        Sets the modified attribute of the BaseConfiguration object
        Specified by:
        setModified in interface BaseConfiguration
        Parameters:
        modified - The new modified value
      • setUseListeners

        @Deprecated
        public void setUseListeners​(boolean value)
        Deprecated.
        Specifies whether event listeners are used.
        Specified by:
        setUseListeners in interface BaseConfiguration
        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 interface BaseConfiguration
        Returns:
        true if event listeners are used; otherwise false.
      • 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)
      • 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 interface BaseConfiguration
        Parameters:
        source - The caller initiating the change event
        key - The key that changed
        operation - 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 interface BaseConfiguration
        Parameters:
        source - The caller initiating the change event
        key - The key that changed
        operation - The operation performed on key
        userObject - 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 interface BaseConfiguration
        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 interface BaseConfiguration
        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 interface BaseConfiguration
        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 interface BaseConfiguration
        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 interface BaseConfiguration
        Returns:
        The namespace value
      • setName

        public void setName​(javax.naming.Name name)
        Sets the name of this object.
        Specified by:
        setName in interface BaseConfiguration
        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 interface BaseConfiguration
        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 interface BaseConfiguration
        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 interface BaseConfiguration
        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 interface BaseConfiguration
        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 interface BaseConfiguration
        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 interface BaseConfiguration
        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.
      • 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
      • setFlags

        public void setFlags​(int flags)
        Sets flags. ( like ignore inheritance )
        Specified by:
        setFlags in interface BaseConfiguration
        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 interface BaseConfiguration
        Returns:
        value of the flags
      • removeParameter

        public void removeParameter​(java.lang.Object name)
        Removes a local parameter from this object.
        Specified by:
        removeParameter in interface BaseConfiguration
        Parameters:
        name - Parameter name
      • isParameterLocal

        public boolean isParameterLocal​(java.lang.Object name)
        Returns true if the parameter is local and false if the parameter does not exist either in this object or in any inherited object.
        Specified by:
        isParameterLocal in interface BaseConfiguration
        Parameters:
        name - Parameter name
        Returns:
        true if name is local; otherwise false.
      • hasParameter

        public boolean hasParameter​(java.lang.Object name)
        Returns true if parameter name is local to this object.
        Specified by:
        hasParameter in interface BaseConfiguration
        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 interface BaseConfiguration
        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 interface BaseConfiguration
        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 using createValue.
        Specified by:
        getParameter in interface BaseConfiguration
        Parameters:
        name - The parameter name
        createValue - 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 interface BaseConfiguration
        Parameters:
        name - The parameter name
        createValue - The value added to this object in case the parameter does not exist
        cref - 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 interface BaseConfiguration
        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 interface BaseConfiguration
        Parameters:
        key - The parameter name
        defval - 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 interface BaseConfiguration
        Parameters:
        key - The parameter name
        defval - 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 interface BaseConfiguration
        Parameters:
        name - Parameter name
        value - 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 is true, the behavior is identical to setParameter( name, value ).
        Specified by:
        setParameter in interface BaseConfiguration
        Parameters:
        name - Parameter name
        value - Parameter value
        notify - If true, 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 interface BaseConfiguration
        Parameters:
        name - Parameter name
        value - 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 interface BaseConfiguration
      • 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 interface BaseConfiguration
      • setBooleanParameter

        public void setBooleanParameter​(java.lang.Object name,
                                        boolean value)
        Calls setParameter converting value to a Boolean object.
        Specified by:
        setBooleanParameter in interface BaseConfiguration
        Parameters:
        name - Parameter name
        value - Parameter value
      • setIntegerParameter

        public void setIntegerParameter​(java.lang.Object name,
                                        int value)
        Calls setParameter converting value to an Integer object.
        Specified by:
        setIntegerParameter in interface BaseConfiguration
        Parameters:
        name - Parameter name
        value - Parameter value
      • setStringParameter

        public void setStringParameter​(java.lang.Object name,
                                       java.lang.String value)
        Calls setParameter.
        Specified by:
        setStringParameter in interface BaseConfiguration
        Parameters:
        name - Parameter name
        value - 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 interface BaseConfiguration
        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 interface BaseConfiguration
        Parameters:
        name - parameter name
        propertySource - 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 name
        value - 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 name
        value - parameter value
        cref - 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 a Entry object constructed from the internal data structure. Default implementation simply copies every attribute to/from entry using String values.
        Specified by:
        toEntry in interface BaseConfiguration
        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 a Entry object.
        Specified by:
        fromEntry in interface BaseConfiguration
        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 class java.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 interface BaseConfiguration
        Parameters:
        mc - The new metamergeConfig object
      • getDebug

        public boolean getDebug()
        Returns the debug flag for the object.
        Specified by:
        getDebug in interface BaseConfiguration
        Returns:
        The debug value.
      • getDebug

        public boolean getDebug​(boolean defval)
        Returns the debug flag for the object.
        Specified by:
        getDebug in interface BaseConfiguration
        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 interface BaseConfiguration
        Parameters:
        debug - The new debug value
      • getDebugBreak

        public boolean getDebugBreak​(boolean defval)
        Gets the debugBreak attribute of this object.
        Specified by:
        getDebugBreak in interface BaseConfiguration
        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 interface BaseConfiguration
        Parameters:
        debug - The new debugBreak value.
      • getScript

        public java.lang.String getScript()
        Gets the script attribute of this object.
        Specified by:
        getScript in interface BaseConfiguration
        Returns:
        The script value.
      • setScript

        public void setScript​(java.lang.String script)
        Sets the script attribute of this object.
        Specified by:
        setScript in interface BaseConfiguration
        Parameters:
        script - The new script value
      • getScriptEngine

        public java.lang.String getScriptEngine()
        Gets the ScriptEngine attribute of this object.
        Specified by:
        getScriptEngine in interface BaseConfiguration
        Returns:
        The ScriptEngine value.
      • setScriptEngine

        public void setScriptEngine​(java.lang.String engine)
        Sets the ScriptEngine attribute of this object.
        Specified by:
        setScriptEngine in interface BaseConfiguration
        Parameters:
        engine - The new ScriptEngine value
      • getNullBehavior

        public java.lang.String getNullBehavior()
        Gets the nullBehavior attribute of this object.
        Specified by:
        getNullBehavior in interface BaseConfiguration
        Returns:
        The nullBehavior value.
      • getNullBehaviorValue

        public java.lang.String getNullBehaviorValue()
        Gets the nullBehaviorValue attribute of this object.
        Specified by:
        getNullBehaviorValue in interface BaseConfiguration
        Returns:
        The nullBehaviorValue value.
      • setNullBehavior

        public void setNullBehavior​(java.lang.String nb)
        Sets the nullBehavior attribute of this object.
        Specified by:
        setNullBehavior in interface BaseConfiguration
        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 interface BaseConfiguration
        Parameters:
        nbv - The new nullBehaviorValue value
      • getNullDefinition

        public java.lang.String getNullDefinition()
        Gets the nullDefinition attribute of the BaseConfiguration object
        Specified by:
        getNullDefinition in interface BaseConfiguration
        Returns:
        The nullDefinition value
      • getNullDefinitionValue

        public java.lang.String getNullDefinitionValue()
        Gets the nullDefinitionValue attribute of the BaseConfiguration object
        Specified by:
        getNullDefinitionValue in interface BaseConfiguration
        Returns:
        The nullDefinitionValue value
      • setNullDefinition

        public void setNullDefinition​(java.lang.String nb)
        Sets the nullDefinition attribute of the BaseConfiguration object
        Specified by:
        setNullDefinition in interface BaseConfiguration
        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 interface BaseConfiguration
        Parameters:
        nbv - The new nullBehaviorValue value
      • getEnabled

        public boolean getEnabled()
        Gets the enabled attribute of this object.
        Specified by:
        getEnabled in interface BaseConfiguration
        Returns:
        The nullBehaviorValue value.
      • setEnabled

        public void setEnabled​(boolean autoStart)
        Sets the enabled attribute of this object.
        Specified by:
        setEnabled in interface BaseConfiguration
        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 interface BaseConfiguration
        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 interface BaseConfiguration
        Returns:
        The nullBehaviorValue value.
      • setLogEnabled

        public void setLogEnabled​(boolean enabled)
        Sets the log enabled attribute of this object.
        Specified by:
        setLogEnabled in interface BaseConfiguration
        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 interface BaseConfiguration
        Parameters:
        comment - new value for user comment
      • getUserComment

        public java.lang.String getUserComment()
        Specified by:
        getUserComment in interface BaseConfiguration
        Returns:
        the user defined comment string.
      • getSubstitutionMap

        public java.util.Map<java.lang.String,​java.lang.Object> getSubstitutionMap()
        Specified by:
        getSubstitutionMap in interface BaseConfiguration
        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 interface BaseConfiguration
        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 interface BaseConfiguration
        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 interface BaseConfiguration
        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 interface BaseConfiguration
        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 interface BaseConfiguration
        Parameters:
        text - The search text
        options - 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 interface BaseConfiguration
        Parameters:
        text - The search text
        options - Search options (oneLevel=1, exactCase=2, regExp=4, paramName=8)
        sizelimit - Max number of hits returned
        results - 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 interface BaseConfiguration
        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 interface BaseConfiguration
        Parameters:
        name - The name
        config - 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 interface BaseConfiguration
        Returns:
        list of names
      • nameForChild

        public java.lang.String nameForChild​(BaseConfiguration config)
        Returns the name for a configuration object
        Specified by:
        nameForChild in interface BaseConfiguration
        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 interface BaseConfiguration
        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 interface BaseConfiguration
        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 interface BaseConfiguration
        Returns:
        true if this object was removed; false if it could not be removed.
      • reattachToParent

        public boolean reattachToParent​(int position)
        This method reattaches this object to its former parent.
        Specified by:
        reattachToParent in interface BaseConfiguration
        Returns:
        true if this object was reattached; false if not;
      • isExpression

        public boolean isExpression​(java.lang.Object parameter)
        Specified by:
        isExpression in interface BaseConfiguration
        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 interface BaseConfiguration
      • 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 interface BaseConfiguration