org.sape.carbon.core.config.node
Interface ConfigurationDocument

All Superinterfaces:
Node
All Known Subinterfaces:
ConfigurationDocumentLink
All Known Implementing Classes:
AbstractConfigurationDocument, BootConfigurationDocument, ConfigurationDocumentLinkImpl

public interface ConfigurationDocument
extends Node

A ConfigurationDocument is a Node that contains configuration information. This interface contains methods to read and write Configuration objects from and to a data store. Copyright 2002 Sapient

Since:
carbon 1.0
Version:
$Revision: 1.10 $($Author: dvoet $ / $Date: 2003/05/05 21:21:18 $)
Author:
Douglas Voet, March 2002
See Also:
Configuration

Field Summary
 
Fields inherited from interface org.sape.carbon.core.config.node.Node
DELIMITER
 
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.
 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 interface org.sape.carbon.core.config.node.Node
addNodeListener, addNodeListener, containsChild, fetchChild, fetchChildren, getAbsoluteName, getAllowsChildren, getName, getParent, isRemoved, refresh, remove
 

Method Detail

writeConfiguration

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

Parameters:
config - The Configuration Container in the current node.
Throws:
ConfigurationFormatException - when the configuration data can not be persisted.
NodeIOException - indicates an error reading a node
See Also:
ConfigurationService.storeConfiguration(String, Configuration)

readConfiguration

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

Returns:
Configuration object encapsulating the requested configuration
Throws:
ConfigurationFormatException - when the configuration data can not be read.
NodeIOException - indicates an error reading a node
See Also:
ConfigurationService.fetchConfiguration(String)

addNestedConfigurationDocument

public ConfigurationDocument addNestedConfigurationDocument(String name,
                                                            Configuration config)
                                                     throws NodeCreationException
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.

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.

getFormatService

public ConfigurationFormatService getFormatService()
Method getFormatService.

Returns:
ConfigurationFormatService

getNestedNodeFactory

public NodeFactory getNestedNodeFactory()
Returns the nested node factory for the configuration.

Returns:
the nested node factory


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.