org.sape.carbon.core.config.node.link
Class ConfigurationDocumentLinkImpl

java.lang.Object
  |
  +--org.sape.carbon.core.config.node.link.AbstractLinkNode
        |
        +--org.sape.carbon.core.config.node.link.ConfigurationDocumentLinkImpl
All Implemented Interfaces:
ConfigurationDocument, ConfigurationDocumentLink, LinkNode, Node
Direct Known Subclasses:
ClassloaderDocumentLinkImpl

public class ConfigurationDocumentLinkImpl
extends AbstractLinkNode
implements ConfigurationDocumentLink

Implementation of ConfigurationDocumentLink. This is probably the only implementation that will ever be needed. It does not contain any logic specific to a data store so a new implementation should not be required when new data stores are introduced. The only thing that should be variable is which factory is used to create a link. Copyright 2002 Sapient

Since:
carbon 1.0
Version:
$Revision: 1.7 $($Author: dvoet $ / $Date: 2003/12/11 18:43:31 $)
Author:
Douglas Voet, March 2002

Field Summary
 
Fields inherited from class org.sape.carbon.core.config.node.link.AbstractLinkNode
linkConfigurationDocument, targetNode
 
Fields inherited from interface org.sape.carbon.core.config.node.Node
DELIMITER
 
Constructor Summary
ConfigurationDocumentLinkImpl(ConfigurationDocument linkConfigurationDocument, ConfigurationDocument targetConfigurationDocument)
          Constructor for ConfigurationDocumentLinkImpl.
 
Method Summary
 ConfigurationDocument addNestedConfigurationDocument(String name, Configuration config)
          Adds a nested configuration object within this document with the name given by name and the value given by config.
 void addNodeListener(ConfigurationEventListener listener)
          Method addNodeListener.
 void addNodeListener(NodeEventListener listener)
          Method addNodeListener.
 ConfigurationFormatService getFormatService()
          Method getFormatService.
 NodeFactory getNestedNodeFactory()
          Returns the nested node factory for the configuration.
 Configuration readConfiguration()
          Accesses the underlying data store to load the configuration data from to the location represented by this Node.
 void writeConfiguration(Configuration config)
          Accesses the underlying data store to persist the configuration data of config to the location represented by this Node.
 
Methods inherited from class org.sape.carbon.core.config.node.link.AbstractLinkNode
containsChild, fetchChild, fetchChildren, getAbsoluteName, getAllowsChildren, getName, getParent, isRemoved, readLinkConfiguration, refresh, remove, toString, writeLinkConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.sape.carbon.core.config.node.link.LinkNode
readLinkConfiguration, writeLinkConfiguration
 
Methods inherited from interface org.sape.carbon.core.config.node.Node
containsChild, fetchChild, fetchChildren, getAbsoluteName, getAllowsChildren, getName, getParent, isRemoved, refresh, remove
 

Constructor Detail

ConfigurationDocumentLinkImpl

public ConfigurationDocumentLinkImpl(ConfigurationDocument linkConfigurationDocument,
                                     ConfigurationDocument targetConfigurationDocument)
Constructor for ConfigurationDocumentLinkImpl.

Parameters:
linkConfigurationDocument - used to implement the LinkNode interface
targetConfigurationDocument - used to implement the ConfigurationDocument interface
Method Detail

readConfiguration

public Configuration readConfiguration()
                                throws NodeIOException,
                                       ConfigurationFormatException
Description copied from interface: ConfigurationDocument
Accesses the underlying data store to load the configuration data from to the location represented by this Node.

Specified by:
readConfiguration in interface ConfigurationDocument
Returns:
Configuration object encapsulating the requested configuration
Throws:
NodeIOException - indicates an error reading a node
ConfigurationFormatException - when the configuration data can not be read.
See Also:
ConfigurationDocument.readConfiguration()

writeConfiguration

public void writeConfiguration(Configuration config)
                        throws NodeIOException,
                               ConfigurationFormatException
Description copied from interface: ConfigurationDocument
Accesses the underlying data store to persist the configuration data of config to the location represented by this Node.

Specified by:
writeConfiguration in interface ConfigurationDocument
Parameters:
config - The Configuration Container in the current node.
Throws:
NodeIOException - indicates an error reading a node
ConfigurationFormatException - when the configuration data can not be persisted.
See Also:
ConfigurationDocument.writeConfiguration(Configuration)

addNestedConfigurationDocument

public ConfigurationDocument addNestedConfigurationDocument(String name,
                                                            Configuration config)
                                                     throws NodeCreationException
Description copied from interface: ConfigurationDocument
Adds a nested configuration object within this document with the name given by name and the value given by config. If config represents an existing ConfigurationDocument, a reference to that document is created, otherwise, the configuration is embedded within this document.

Specified by:
addNestedConfigurationDocument in interface ConfigurationDocument
Parameters:
name - the name of the configuration to add. This should not use indexed notation. If the property is indexed, config will be added to the end of the list. Retrieval then needs to use the indexed notation.
config - the config object to add. If this object belongs to another configuration document, a reference is created to that document. Otherwise, the config is embedded within this document.
Returns:
ConfigurationDocument the added document
Throws:
NodeCreationException - if there is a problem creating the nested document.
See Also:
ConfigurationDocument.addNestedConfigurationDocument(java.lang.String, org.sape.carbon.core.config.Configuration)

getFormatService

public ConfigurationFormatService getFormatService()
Description copied from interface: ConfigurationDocument
Method getFormatService.

Specified by:
getFormatService in interface ConfigurationDocument
Returns:
ConfigurationFormatService
See Also:
ConfigurationDocument.getFormatService()

addNodeListener

public void addNodeListener(NodeEventListener listener)
Description copied from interface: Node
Method addNodeListener.

Specified by:
addNodeListener in interface Node
Parameters:
listener - lister for the node
See Also:
Node.addNodeListener(NodeEventListener)

addNodeListener

public void addNodeListener(ConfigurationEventListener listener)
Description copied from interface: Node
Method addNodeListener.

Specified by:
addNodeListener in interface Node
Parameters:
listener - lister for the node
See Also:
Node.addNodeListener(ConfigurationEventListener)

getNestedNodeFactory

public NodeFactory getNestedNodeFactory()
Description copied from interface: ConfigurationDocument
Returns the nested node factory for the configuration.

Specified by:
getNestedNodeFactory in interface ConfigurationDocument
Returns:
the nested node factory
See Also:
ConfigurationDocument.getNestedNodeFactory()


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.