Class MetamergeConfigXML

    • Field Detail

      • SERVER_ENCRYPTED_SIGNATURE

        public static final java.lang.String SERVER_ENCRYPTED_SIGNATURE
        See Also:
        Constant Field Values
      • METAMERGE_CONFIG_TAG

        public static final java.lang.String METAMERGE_CONFIG_TAG
        See Also:
        Constant Field Values
      • METAMERGE_VERSION_TAG

        public static final java.lang.String METAMERGE_VERSION_TAG
        See Also:
        Constant Field Values
      • METAMERGE_CREATED_TAG

        public static final java.lang.String METAMERGE_CREATED_TAG
        See Also:
        Constant Field Values
      • METAMERGE_CREATEDBY_TAG

        public static final java.lang.String METAMERGE_CREATEDBY_TAG
        See Also:
        Constant Field Values
      • METAMERGE_MODIFIED_TAG

        public static final java.lang.String METAMERGE_MODIFIED_TAG
        See Also:
        Constant Field Values
      • METAMERGE_MODIFIEDBY_TAG

        public static final java.lang.String METAMERGE_MODIFIEDBY_TAG
        See Also:
        Constant Field Values
      • METAMERGE_VERSION_ID

        public static final java.lang.String METAMERGE_VERSION_ID
        See Also:
        Constant Field Values
    • Constructor Detail

      • MetamergeConfigXML

        public MetamergeConfigXML()
      • MetamergeConfigXML

        public MetamergeConfigXML​(java.util.Hashtable<java.lang.String,​java.lang.Object> env)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • isOldVersion

        public boolean isOldVersion()
      • debug

        public void debug​(java.lang.String msg)
      • isDebugMode

        public boolean isDebugMode()
        Returns:
        true if debug is enabled. Otherwise, false is returned.
      • internalLookup

        protected java.lang.Object internalLookup​(java.lang.Object namex)
                                           throws java.lang.Exception
        Called by super's lookup
        Overrides:
        internalLookup in class MetamergeConfigImpl
        Throws:
        java.lang.Exception
      • list

        public java.util.Enumeration<javax.naming.Binding> list()
                                                         throws java.lang.Exception
        This method returns an enumeration with the names in the given folder. If the name does does not name a folder an exception is thrown.
        Specified by:
        list in interface MetamergeFolder
        Overrides:
        list in class MetamergeConfigImpl
        Returns:
        Enumeration of Binding objects
        Throws:
        java.lang.Exception
      • list

        public java.util.Enumeration<javax.naming.Binding> list​(java.lang.Object name)
                                                         throws java.lang.Exception
        Description copied from interface: MetamergeConfig
        Returns an enumeration of the immediate children of this node
        Specified by:
        list in interface MetamergeConfig
        Overrides:
        list in class MetamergeConfigImpl
        Parameters:
        name - The folder name to list
        Returns:
        Enumeration object of javax.naming.Binding objects with names and objects.
        Throws:
        java.lang.Exception
      • createFolder

        public MetamergeFolder createFolder​(java.lang.Object name)
                                     throws java.lang.Exception
        This method creates a folder
        Specified by:
        createFolder in interface MetamergeFolder
        Overrides:
        createFolder in class MetamergeConfigImpl
        Parameters:
        name - Name of sub-folder
        Returns:
        The MetamergeFolder object representing the new sub-folder
        Throws:
        java.lang.Exception
      • findByName

        public org.w3c.dom.Element findByName​(org.w3c.dom.Element root,
                                              java.lang.Object name)
                                       throws java.lang.Exception
        This method traverses the document tree searching for an element with an attribute (name) equal to name.
        Throws:
        java.lang.Exception
      • findOneByName

        public org.w3c.dom.Element findOneByName​(org.w3c.dom.Element root,
                                                 java.lang.String name)
        This method searches the children of an element for an element with an attribute (name) equal to name.
      • getRootElement

        public org.w3c.dom.Element getRootElement()
        Returns the root element of the XML document.
      • getDocument

        public org.w3c.dom.Document getDocument()
        Returns the XML document object.
      • bind

        public void bind​(java.lang.Object name,
                         java.lang.Object obj)
                  throws java.lang.Exception
        Description copied from interface: MetamergeConfig
        Adds a new object to the configuration at the location specified by name
        Specified by:
        bind in interface MetamergeConfig
        Overrides:
        bind in class MetamergeConfigImpl
        Parameters:
        name - Name
        obj - Configuration Object
        Throws:
        java.lang.Exception
      • rebind

        public void rebind​(java.lang.Object name,
                           java.lang.Object obj)
                    throws java.lang.Exception
        Description copied from interface: MetamergeConfig
        Adds or replaces a new object to the configuration.
        Specified by:
        rebind in interface MetamergeConfig
        Overrides:
        rebind in class MetamergeConfigImpl
        Parameters:
        name - Name
        obj - Configuration Object
        Throws:
        java.lang.Exception
      • rename

        public void rename​(java.lang.Object name,
                           java.lang.Object newname)
                    throws java.lang.Exception
        Description copied from interface: MetamergeConfig
        Renames an object. If new name is a simple name then location is unchanged, otherwise the object is moved.
        Specified by:
        rename in interface MetamergeConfig
        Overrides:
        rename in class MetamergeConfigImpl
        Parameters:
        name - Current Name
        newname - New name
        Throws:
        java.lang.Exception
      • unbind

        public void unbind​(java.lang.Object name)
                    throws java.lang.Exception
        Description copied from interface: MetamergeConfig
        Removes a named object from this configuration.
        Specified by:
        unbind in interface MetamergeConfig
        Overrides:
        unbind in class MetamergeConfigImpl
        Parameters:
        name - The object name to remove
        Throws:
        java.lang.Exception
      • removeElement

        protected void removeElement​(java.lang.Object name)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • commitChanges

        public void commitChanges​(java.lang.Object output,
                                  boolean isSave)
                           throws java.lang.Exception
        Save XML tree to output stream.
        Specified by:
        commitChanges in interface MetamergeConfig
        Overrides:
        commitChanges in class MetamergeConfigImpl
        Parameters:
        output - Null or any object supported by the underlying driver.
        isSave - true if this is a permanent save, false if this just saves to e.g. a command window.
        Throws:
        java.lang.Exception
      • setOutput

        public void setOutput​(java.lang.Object output)
                       throws java.lang.Exception
        Description copied from interface: MetamergeConfig
        Changes the output to wich the configuration driver writes its configuration. This is different from calling commitChanges(output, false) where the output parameter is temporary (e.g. SaveCopyAs).
        Specified by:
        setOutput in interface MetamergeConfig
        Overrides:
        setOutput in class MetamergeConfigImpl
        Parameters:
        output - The new output value
        Throws:
        java.lang.Exception
      • isCommittable

        public boolean isCommittable()
        Description copied from interface: MetamergeConfig
        Returns true if the configuration driver implements the commitChanges method and the current value for PROVIDER_URL is writable.
        Specified by:
        isCommittable in interface MetamergeConfig
        Overrides:
        isCommittable in class MetamergeConfigImpl
        Returns:
        The committable state
      • getModified

        public boolean getModified()
        XML Doc needs to be saved if we have dirty objects in our cache or if there has been any successful bind/rebind/unbind calls.
        Specified by:
        getModified in interface BaseConfiguration
        Overrides:
        getModified in class BaseConfigurationImpl
        Returns:
        the modified state.
      • newInstanceOf

        public BaseConfiguration newInstanceOf​(java.lang.Object typeName)
                                        throws java.lang.Exception
        Description copied from interface: MetamergeConfig
        This method returns a new instance of the object type specified by typeName. Use the default folder names constants to denote the type. The new object is not added to the configuration.
        Specified by:
        newInstanceOf in interface MetamergeConfig
        Overrides:
        newInstanceOf in class MetamergeConfigImpl
        Parameters:
        typeName - The object type to create.
        Returns:
        The newly created object.
        Throws:
        java.lang.Exception
      • getOutputStream

        public java.io.OutputStream getOutputStream​(java.lang.Object out)
                                             throws java.lang.Exception
        Returns the output stream to which the XML document is written. Called by commitChanges.
        Throws:
        java.lang.Exception
      • getShortName

        public java.lang.String getShortName()
        Description copied from class: BaseConfigurationImpl
        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
        Overrides:
        getShortName in class BaseConfigurationImpl
        Returns:
        The shortName value
      • setNoBackupOfOldVersion

        public void setNoBackupOfOldVersion()
        Sets a flag to prevent an old version of the file to be used as backup.
        Since:
        7.2