org.sourcejammer.project.controller
Class ProjectNode

java.lang.Object
  |
  +--org.sourcejammer.project.controller.ControllerNode
        |
        +--org.sourcejammer.project.controller.ProjectNode
All Implemented Interfaces:
java.lang.Comparable, org.sourcejammer.project.Node
Direct Known Subclasses:
ProjectNodeFS

public abstract class ProjectNode
extends ControllerNode

Contains information about a Project, including the project's name, and links to it's parent and children.


Field Summary
private static java.lang.String INDEX_SEP
           
(package private)  java.util.Hashtable mhshChildren
           
(package private)  java.util.Hashtable mhshChildrenByName
           
(package private)  java.util.Hashtable mhshNamesByChild
           
(package private)  long mlParentID
           
(package private)  java.util.Vector mvecRemovedChildren
           
 
Fields inherited from class org.sourcejammer.project.controller.ControllerNode
lightweightView
 
Constructor Summary
ProjectNode()
           
 
Method Summary
 void addChildNode(long lChildID, int iChildNodeType, java.lang.String sChildName, long key)
           
 void addChildNode(org.sourcejammer.project.Node nd, long key)
          Adds a new child node to this ProjectNode.
private  java.lang.String buildChildIndexKey(long uniqueID, int nodeType)
           
 int childCount()
           
 void deleteChildList(long key)
           
 ProjectChild getChildNode(java.lang.String name)
          Returns the child node with the specified name.
 java.lang.String getChildNodeName(long uniqueID, int nodeType)
           
 java.util.Enumeration getChildrenInfo()
          Returns an Enumeration for iterating through of all of the children (ProjectChild objects) of this ProjectNode.
 long getParentID()
           
 ProjectNode getProjectParent()
          Deprecated.  
 ProjectChild getRemovedChildInfo(int index)
           
 java.util.Vector getRemovedChildren()
          Returns a Vector of removed Nodes.
 ProjectChild permanentlyDeleteRemovedChildNode(int index, ArchiveInfoFlex info, long key)
          Permanently delete a removed node from this cache and from the storage system.
 ProjectChild removeChildNode(java.lang.String name, long key)
          Removes the child node with the specified name and adds it to removed children list.
 ProjectChild removeChildNode(java.lang.String name, long key, boolean addToRemovedList)
          Removes the child node with the specified name and adds it to removed children list if addToRemovedList is true.
 void renameChild(long uniqueID, int nodeType, java.lang.String newName, long key)
           
 ProjectChild restoreRemovedChildNode(int index, java.lang.String newName, long key)
          Restores the specified removed node using a new name as the node name.
 void setParentID(long l, long key)
           
 void setProjectParent(ProjectNode parent, long key)
          Convenience method for setting parent as ProjectNode.
 void setRemovedChildren(java.util.Vector vec)
          Sets removed children vector.
 
Methods inherited from class org.sourcejammer.project.controller.ControllerNode
checkKey, compareTo, equals, getCreatedDate, getLightweightView, getLightweightViewString, getNodeName, getParent, getRootParent, getShareParent, getUniqueID, isCorrectKey, isLocked, isShared, lock, setCreatedDate, setNodeName, setParent, setShared, setShareParent, setUniqueID, store, toString, unlock, updateLightweightViewString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mvecRemovedChildren

java.util.Vector mvecRemovedChildren

mhshChildren

java.util.Hashtable mhshChildren

mhshChildrenByName

java.util.Hashtable mhshChildrenByName

mhshNamesByChild

java.util.Hashtable mhshNamesByChild

mlParentID

long mlParentID

INDEX_SEP

private static final java.lang.String INDEX_SEP
See Also:
Constant Field Values
Constructor Detail

ProjectNode

public ProjectNode()
Method Detail

setParentID

public void setParentID(long l,
                        long key)

getParentID

public long getParentID()

getProjectParent

public ProjectNode getProjectParent()
Deprecated.  

This is a convenience method for returning the parent already cast to ProjectNode. Will throw ConfigurationException if the parent node cannot be cast properly to a ProjectNode.

Returns:
Parent of this ProjectNode, as ProjectNode. Return null if this is the root node of an Archive.

setProjectParent

public void setProjectParent(ProjectNode parent,
                             long key)
Convenience method for setting parent as ProjectNode. setParent() could just as easily be used.

Parameters:
parent - -- parent ProjectNode.

getChildrenInfo

public java.util.Enumeration getChildrenInfo()
Returns an Enumeration for iterating through of all of the children (ProjectChild objects) of this ProjectNode.

Returns:
an Enumeration of the ProjectNode's children.

addChildNode

public void addChildNode(org.sourcejammer.project.Node nd,
                         long key)
                  throws org.sourcejammer.project.NodeExistsException
Adds a new child node to this ProjectNode.

Throws:
org.sourcejammer.project.NodeExistsException - -- if this ProjectNode already has a child with the same name as child.getNodeName();

addChildNode

public void addChildNode(long lChildID,
                         int iChildNodeType,
                         java.lang.String sChildName,
                         long key)
                  throws org.sourcejammer.project.NodeExistsException
org.sourcejammer.project.NodeExistsException

removeChildNode

public ProjectChild removeChildNode(java.lang.String name,
                                    long key)
                             throws org.sourcejammer.project.NodeDoesNotExistException
Removes the child node with the specified name and adds it to removed children list.

Parameters:
name - -- name of the child node to be removed.
Returns:
the NodeInfo that is being removed.
Throws:
org.sourcejammer.project.NodeDoesNotExistException - if the this does not have a child with the specified name.

removeChildNode

public ProjectChild removeChildNode(java.lang.String name,
                                    long key,
                                    boolean addToRemovedList)
                             throws org.sourcejammer.project.NodeDoesNotExistException
Removes the child node with the specified name and adds it to removed children list if addToRemovedList is true.

Parameters:
name - -- name of the child node to be removed.
addToRemovedList - -- adds to removed list if true.
Returns:
the NodeInfo that is being removed.
Throws:
org.sourcejammer.project.NodeDoesNotExistException - if the this does not have a child with the specified name.

restoreRemovedChildNode

public ProjectChild restoreRemovedChildNode(int index,
                                            java.lang.String newName,
                                            long key)
                                     throws org.sourcejammer.project.NodeExistsException,
                                            org.sourcejammer.project.NodeDoesNotExistException,
                                            SecurityException
Restores the specified removed node using a new name as the node name.

org.sourcejammer.project.NodeExistsException
org.sourcejammer.project.NodeDoesNotExistException
SecurityException

getRemovedChildren

public java.util.Vector getRemovedChildren()
Returns a Vector of removed Nodes.


setRemovedChildren

public void setRemovedChildren(java.util.Vector vec)
Sets removed children vector. Vector of ProjectChild objects.


permanentlyDeleteRemovedChildNode

public ProjectChild permanentlyDeleteRemovedChildNode(int index,
                                                      ArchiveInfoFlex info,
                                                      long key)
                                               throws org.sourcejammer.project.NodeDoesNotExistException,
                                                      FileAccessException
Permanently delete a removed node from this cache and from the storage system.

org.sourcejammer.project.NodeDoesNotExistException
FileAccessException

getChildNode

public ProjectChild getChildNode(java.lang.String name)
                          throws org.sourcejammer.project.NodeDoesNotExistException
Returns the child node with the specified name.

Parameters:
name - -- name of the child node to be returned.
Returns:
the child node with the specified name.
Throws:
org.sourcejammer.project.NodeDoesNotExistException - if the this does not have a child with the specified name.

getChildNodeName

public java.lang.String getChildNodeName(long uniqueID,
                                         int nodeType)
                                  throws org.sourcejammer.project.NodeDoesNotExistException
org.sourcejammer.project.NodeDoesNotExistException

getRemovedChildInfo

public ProjectChild getRemovedChildInfo(int index)
                                 throws org.sourcejammer.project.NodeDoesNotExistException
org.sourcejammer.project.NodeDoesNotExistException

renameChild

public void renameChild(long uniqueID,
                        int nodeType,
                        java.lang.String newName,
                        long key)
                 throws org.sourcejammer.project.NodeExistsException
org.sourcejammer.project.NodeExistsException

childCount

public int childCount()
Specified by:
childCount in interface org.sourcejammer.project.Node
Specified by:
childCount in class ControllerNode

deleteChildList

public void deleteChildList(long key)

buildChildIndexKey

private java.lang.String buildChildIndexKey(long uniqueID,
                                            int nodeType)


Copyright © 2003 Soucejammer project.