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

java.lang.Object
  |
  +--org.sape.carbon.core.config.node.link.AbstractLinkNode
        |
        +--org.sape.carbon.core.config.node.link.FolderLinkImpl
All Implemented Interfaces:
Folder, FolderLink, LinkNode, Node
Direct Known Subclasses:
ClassloaderFolderLinkImpl

public class FolderLinkImpl
extends AbstractLinkNode
implements FolderLink

Implementation of FolderLink. 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.6 $($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
FolderLinkImpl(ConfigurationDocument linkConfigurationDocument, Folder targetFolder)
          Constructor for FolderLinkImpl.
 
Method Summary
 ConfigurationDocument addConfigurationDocument(String name, Configuration config)
          Creates a new child ConfigurationDocument and returns a reference to the newly created ConfigurationDocument.
 LinkNode addLink(String name, LinkNodeConfiguration linkConfiguration)
          Adds a link to the folder.
 void addNodeListener(ConfigurationEventListener listener)
          Method addNodeListener.
 void addNodeListener(NodeEventListener listener)
          Method addNodeListener.
 Folder addSubFolder(String name)
          Creates a new child Folder and returns a reference to the newly created Folder.
 NodeFactory getConfigurationDocumentFactory()
          Gets the factory this node used in the addConfigurationDocument method to create children.
 NodeFactory getLinkNodeFactory()
          Gets the factory this node used in the addLinkNode method to create children.
 NodeFactory getSubFolderFactory()
          Gets the factory this node used in the addSubFolder method to create children.
 
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

FolderLinkImpl

public FolderLinkImpl(ConfigurationDocument linkConfigurationDocument,
                      Folder targetFolder)
Constructor for FolderLinkImpl.

Parameters:
linkConfigurationDocument - used to implement the LinkNode interface
targetFolder - used to implement the Folder interface
Method Detail

addConfigurationDocument

public ConfigurationDocument addConfigurationDocument(String name,
                                                      Configuration config)
                                               throws NodeCreationException
Description copied from interface: Folder
Creates a new child ConfigurationDocument and returns a reference to the newly created ConfigurationDocument.

Specified by:
addConfigurationDocument in interface Folder
Parameters:
name - Name of the ConfigurationDocument to be created.
config - the document to add to the Folder
Returns:
The newly created ConfigurationDocument.
Throws:
NodeCreationException - when the node can not be created, possibly because the node element already exists in this node, or creation of the node is otherwise forbidden. An exception should also be thrown when this node's getAllowsChildren method returns false.
See Also:
Folder.addConfigurationDocument(java.lang.String, org.sape.carbon.core.config.Configuration)

addSubFolder

public Folder addSubFolder(String name)
                    throws NodeCreationException
Description copied from interface: Folder
Creates a new child Folder and returns a reference to the newly created Folder.

Specified by:
addSubFolder in interface Folder
Parameters:
name - Name of the Folder to be created.
Returns:
The newly created Folder.
Throws:
NodeCreationException - when the node can not be created, possibly because the node element already exists in this node, or creation of the node is otherwise forbidden. An exception should also be thrown when this node's getAllowsChildren method returns false.
See Also:
Folder.addSubFolder(String)

addLink

public LinkNode addLink(String name,
                        LinkNodeConfiguration linkConfiguration)
                 throws NodeCreationException
Description copied from interface: Folder
Adds a link to the folder.

Specified by:
addLink in interface Folder
Parameters:
name - name of the link to add
linkConfiguration - the link configuration to create
Returns:
newly created LinkNode
Throws:
NodeCreationException - indicates an error adding the link
See Also:
Folder.addLink(java.lang.String, org.sape.carbon.core.config.node.link.LinkNodeConfiguration)

getConfigurationDocumentFactory

public NodeFactory getConfigurationDocumentFactory()
Description copied from interface: Folder
Gets the factory this node used in the addConfigurationDocument method to create children. This can be used by sub Folders to create their own children.

Specified by:
getConfigurationDocumentFactory in interface Folder
Returns:
NodeFactory factory object used to create ConfigurationDocuments
See Also:
Folder.getConfigurationDocumentFactory()

getSubFolderFactory

public NodeFactory getSubFolderFactory()
Description copied from interface: Folder
Gets the factory this node used in the addSubFolder method to create children. This can be used by sub Folders to create their own children.

Specified by:
getSubFolderFactory in interface Folder
Returns:
NodeFactory factory object used to create Folders
See Also:
Folder.getSubFolderFactory()

getLinkNodeFactory

public NodeFactory getLinkNodeFactory()
Description copied from interface: Folder
Gets the factory this node used in the addLinkNode method to create children. This can be used by sub Folders to create their own children.

Specified by:
getLinkNodeFactory in interface Folder
Returns:
NodeFactory factory object used to create ConfigurationDocuments
See Also:
Folder.getLinkNodeFactory()

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)


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.