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

All Known Subinterfaces:
ConfigurationDocument, ConfigurationDocumentLink, Folder, FolderLink, LinkNode
All Known Implementing Classes:
AbstractConfigurationDocument, AbstractFolder, AbstractLinkNode, AbstractNode, BootConfigurationDocument, ConfigurationDocumentLinkImpl, FolderLinkImpl

public interface Node

The base interface of all objects within the ConfigurationService data structure. This interface contains methods that all objects within the ConfigurationService data structure must implement.

Copyright 2002 Sapient

Since:
carbon 1.0
Version:
$Revision: 1.17 $($Author: dvoet $ / $Date: 2003/12/11 18:43:31 $)
Author:
Douglas Voet, February 2002
See Also:
ConfigurationService

Field Summary
static char DELIMITER
          Delimter use used to separate node names in an absolute node name
 
Method Summary
 void addNodeListener(ConfigurationEventListener listener)
          Method addNodeListener.
 void addNodeListener(NodeEventListener listener)
          Deprecated.  
 boolean containsChild(String childName)
          Checks if this Folder contains the child specified by childName
 Node fetchChild(String childName)
          Returns a child Node of the current Node as defined by childName.
 Node[] fetchChildren()
          Returns an array of all children nodes, including standard ConfigurationDocuments and Folder.
 String getAbsoluteName()
          Returns the absolute name of the node within the node heirarchy.
 boolean getAllowsChildren()
          Allows determination of whether or not this node supports children
 String getName()
          Returns the name of this node.
 Node getParent()
          Gets the parent folder of the node.
 boolean isRemoved()
          Used to tell whether or not the backing data of a node has been removed.
 void refresh()
          Refreshes the Node's underlying cache of data (assuming is has one)
 int remove()
          Permanently deletes the node and all of its child nodes from the backing store returning the total number of nodes deleted.
 

Field Detail

DELIMITER

public static final char DELIMITER
Delimter use used to separate node names in an absolute node name

See Also:
Constant Field Values
Method Detail

getName

public String getName()
Returns the name of this node. The name should not include the node's relation to the node heirarchy. The name can not contain a '/'. The name of the root node is an empty String("").

Returns:
name of the node

getAbsoluteName

public String getAbsoluteName()
Returns the absolute name of the node within the node heirarchy. This value always begins with a '/' with each node's name in the heirarchy seperated by a '/' unless this is the root node in which case it returns an empty String("").

Returns:
Absolute name of the node.

getAllowsChildren

public boolean getAllowsChildren()
Allows determination of whether or not this node supports children

Returns:
true if the node can support children, false otherwise

remove

public int remove()
           throws NodeRemovalException
Permanently deletes the node and all of its child nodes from the backing store returning the total number of nodes deleted.

Returns:
The total number of nodes deleted. This number should always be at least '1' when the operation completed successfully.
Throws:
NodeRemovalException - when the node or one of its children can not be deleted. When this exception is thrown, some nodes may have been deleted while other may have not.

getParent

public Node getParent()
Gets the parent folder of the node.

Returns:
Folder the parent folder, null if this node is the root

isRemoved

public boolean isRemoved()
Used to tell whether or not the backing data of a node has been removed.

Returns:
true if the backing data of a node has been removed

refresh

public void refresh()
Refreshes the Node's underlying cache of data (assuming is has one)


fetchChildren

public Node[] fetchChildren()
Returns an array of all children nodes, including standard ConfigurationDocuments and Folder. If this particular node does not have any children, an array of length zero is be returned.

Returns:
Array of child Nodes. Never null.

fetchChild

public Node fetchChild(String childName)
                throws NodeNotFoundException
Returns a child Node of the current Node as defined by childName.

Parameters:
childName - The name of the child node to be returned.
Returns:
A child Node of the current node.
Throws:
NodeNotFoundException - when childName does not exist in the backing data store

containsChild

public boolean containsChild(String childName)
Checks if this Folder contains the child specified by childName

Parameters:
childName - the name of the child Node
Returns:
boolean true if the child exists, false otherwise.

addNodeListener

public void addNodeListener(NodeEventListener listener)
Deprecated.  

Method addNodeListener.

Parameters:
listener - lister for the node
Since:
carbon 1.1

addNodeListener

public void addNodeListener(ConfigurationEventListener listener)
Method addNodeListener.

Parameters:
listener - lister for the node
Since:
carbon 2.2


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.