|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.sape.carbon.core.config.node.link.AbstractLinkNode
Base class for LinkNode
s. Implements methods in the
Node
and LinkNode
interfaces. This class is
an aggregation of 2 Node
s:
ConfigurationDocument
-
contains the configuration of the link, used for the underlying
implementation of the LinkNode
interfaceNode
-
the target of the link, used as the underlying
implementation of the Node
interface.
Field Summary | |
protected ConfigurationDocument |
linkConfigurationDocument
The ConfigurationDocument containing the link's
configuration. |
protected Node |
targetNode
The target Node of this link. |
Fields inherited from interface org.sape.carbon.core.config.node.Node |
DELIMITER |
Constructor Summary | |
AbstractLinkNode(ConfigurationDocument linkConfigurationDocument,
Node targetNode)
Constructor |
Method Summary | |
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 ConfigurationDocument s 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. |
LinkNodeConfiguration |
readLinkConfiguration()
Reads the LinkNodeConfiguration object that configures
this link |
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. |
String |
toString()
Returns the name of the node |
void |
writeLinkConfiguration(LinkNodeConfiguration config)
Writes a new LinkNodeConfiguration to the backing data
store. |
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.Node |
addNodeListener, addNodeListener |
Field Detail |
protected ConfigurationDocument linkConfigurationDocument
ConfigurationDocument
containing the link's
configuration.
protected Node targetNode
Node
of this link.
Constructor Detail |
public AbstractLinkNode(ConfigurationDocument linkConfigurationDocument, Node targetNode)
linkConfigurationDocument
- the configuration of the linktargetNode
- the target of the link
NullPointerException
- if linkConfigurationDocument or
targetNode is nullMethod Detail |
public LinkNodeConfiguration readLinkConfiguration() throws NodeIOException, ConfigurationFormatException
LinkNode
LinkNodeConfiguration
object that configures
this link
readLinkConfiguration
in interface LinkNode
ConfigurationFormatException
- if the configuration has an
invalid format
NodeIOException
- if there is an exception reading from the
backing data storeLinkNode.readLinkConfiguration()
public void writeLinkConfiguration(LinkNodeConfiguration config) throws NodeIOException, ConfigurationFormatException
LinkNode
LinkNodeConfiguration
to the backing data
store. Note that if changing a configuration, changes will not take
effect until the ConfigurationService
is reloaded. In
most cases, that is when the system is restarted.
writeLinkConfiguration
in interface LinkNode
config
- the new LinkNodeConfiguration
NodeIOException
- if there is an exception writing to the
backing data store
ConfigurationFormatException
- if there is a problem formatting
the dataLinkNode.readLinkConfiguration()
public String getName()
Node
/
'. The name of the root node is
an empty String
(""
).
getName
in interface Node
Node.getName()
public String getAbsoluteName()
Node
/
' 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
(""
).
getAbsoluteName
in interface Node
Node.getAbsoluteName()
public boolean getAllowsChildren()
Node
getAllowsChildren
in interface Node
true
if the node can support children,
false
otherwiseNode.getAllowsChildren()
public int remove() throws NodeRemovalException
Node
remove
in interface Node
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.Node.remove()
public Node getParent()
Node
getParent
in interface Node
Node.getParent()
public String toString()
toString
in class Object
public boolean isRemoved()
Node
isRemoved
in interface Node
Node.isRemoved()
public void refresh()
Node
refresh
in interface Node
Node.refresh()
public boolean containsChild(String childName)
Node
Folder
contains the child specified
by childName
containsChild
in interface Node
childName
- the name of the child Node
Node.containsChild(String)
public Node fetchChild(String childName) throws NodeNotFoundException
Node
Node
of the current
Node
as defined by childName
.
fetchChild
in interface Node
childName
- The name of the child node to be returned.
NodeNotFoundException
- when
childName
does not exist in the backing data storeNode.fetchChild(String)
public Node[] fetchChildren()
Node
ConfigurationDocument
s and Folder
. If this
particular node does not have any children, an array of length zero
is be returned.
fetchChildren
in interface Node
Node.fetchChildren()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |