org.sourcejammer.project.controller
Class FileNode

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

public abstract class FileNode
extends ControllerNode

Title: $FileName: FileNode.java$

Version:
$VerNum: 13$
Author:
$AuthorName: Rob MacGrogan$

$Description: $
$KeyWordsOff: $


Field Summary
private  long masterFileID
           
private  boolean mbCheckedOut
           
private  boolean mbLimitHistorySize
           
private  java.util.Date mdCheckedOutDate
           
private  java.util.Hashtable mhshChildIDIndex
           
private  java.util.Hashtable mhshParentIDIndex
           
private  java.util.Hashtable mhshremovedParentIndex
           
private  int miFileHistoryStorageType
           
private  int miFileType
           
private  int miMaxHistorySize
           
private  org.sourcejammer.project.NodeList moVersions
           
private  java.lang.String msCheckedOutPath
           
private  java.lang.String msCheckedOutToUser
           
private  java.lang.String msDescription
           
 
Fields inherited from class org.sourcejammer.project.controller.ControllerNode
lightweightView
 
Constructor Summary
FileNode()
           
 
Method Summary
 void addParent(long parentID, long key)
           
 void addRemovedParent(long parentID, long key)
           
 void addVersionNode(org.sourcejammer.project.view.NodeInfo version, long key)
          Adds a new VersionNode to this FileNode.
 int childCount()
          Returns number of version.
 java.util.Date getCheckedOutDate()
           
 java.lang.String getCheckedOutToPath()
           
 java.lang.String getCheckedOutToUser()
           
 java.lang.String getDescrption()
           
 int getFileType()
          Compare to org.sourcejammer.util.AppConfig.FileTypes
 int getHistoryStorageType()
           
 org.sourcejammer.project.view.NodeInfo getLatestVersionNode()
          Convenience method for returning most recent version node.
 long getMasterFileID()
          Returns the masterFileID.
 int getMaxHistorySize()
           
 long getParentID()
          Returns "first" parent id.
 java.util.Enumeration getParents()
          Enumeration of Long objects, one for each parent's unique id.
 long[] getParentsArray()
           
 java.util.Enumeration getRemovedParents()
          Enumeration of Long objects, one for each removed parent's unique id.
 long[] getRemovedParentsArray()
           
 org.sourcejammer.project.view.NodeInfo getVersionNode(int index)
          Returns the VersionNode with the specified index.
 org.sourcejammer.project.view.NodeInfo getVersionNode(long uniqueID)
          Returns version node based on unique id.
 org.sourcejammer.project.NodeList getVersionNodeList()
           
 org.sourcejammer.project.NodeIterator getVersions()
          Returns a NodeIterator for iterating through of all of the VersionNodes of this FileNode.
 boolean isCheckedOut()
           
 boolean isLimitHistorySize()
           
 boolean isParent(long parentID)
           
 boolean isShared()
           
static void main(java.lang.String[] args)
           
 void moveParentToRemoved(long parentID, long key)
           
 void moveRemovedParentToParents(long parentID, long key)
           
 org.sourcejammer.project.view.NodeInfo removeOldestVersionNode(long key)
           
 java.lang.Long removeParent(long parentID, long key)
           
 org.sourcejammer.project.view.NodeInfo removeVersionNode(long uniqueID, long key)
           
 void setCheckedOut(boolean b, long key)
           
 void setCheckedOutDate(java.util.Date d, long key)
           
 void setCheckedOutToPath(java.lang.String s, long key)
           
 void setCheckedOutToUser(java.lang.String s, long key)
           
 void setDescription(java.lang.String s, long key)
           
 void setFileType(int i, long key)
           
 void setHistoryStorageType(int i, long key)
           
 void setLimitHistorySize(boolean b, long key)
           
 void setMasterFileID(long masterFileID, long key)
          Sets the masterFileID.
 void setMaxHistorySize(int i, long key)
           
 void setVersionList(org.sourcejammer.project.NodeList versions)
          Explicitly set the entire version list for this FileNode.
 int totalParentCount()
          Returns sum or parents and removed parents.
 
Methods inherited from class org.sourcejammer.project.controller.ControllerNode
checkKey, compareTo, equals, getCreatedDate, getLightweightView, getLightweightViewString, getNodeName, getUniqueID, isLocked, lock, setCreatedDate, setNodeName, setUniqueID, store, toString, unlock, updateLightweightViewString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

moVersions

private org.sourcejammer.project.NodeList moVersions

mbCheckedOut

private boolean mbCheckedOut

mdCheckedOutDate

private java.util.Date mdCheckedOutDate

msCheckedOutPath

private java.lang.String msCheckedOutPath

msCheckedOutToUser

private java.lang.String msCheckedOutToUser

miFileType

private int miFileType

msDescription

private java.lang.String msDescription

miFileHistoryStorageType

private int miFileHistoryStorageType

mbLimitHistorySize

private boolean mbLimitHistorySize

miMaxHistorySize

private int miMaxHistorySize

mhshChildIDIndex

private java.util.Hashtable mhshChildIDIndex

mhshParentIDIndex

private java.util.Hashtable mhshParentIDIndex

mhshremovedParentIndex

private java.util.Hashtable mhshremovedParentIndex

masterFileID

private long masterFileID
Constructor Detail

FileNode

public FileNode()
Method Detail

getVersions

public org.sourcejammer.project.NodeIterator getVersions()
Returns a NodeIterator for iterating through of all of the VersionNodes of this FileNode.

Returns:
a NodeIterator of the FileNode's versions.

getVersionNodeList

public org.sourcejammer.project.NodeList getVersionNodeList()

addParent

public void addParent(long parentID,
                      long key)
               throws SecurityException
SecurityException

getParentsArray

public long[] getParentsArray()

getRemovedParentsArray

public long[] getRemovedParentsArray()

getParents

public java.util.Enumeration getParents()
Enumeration of Long objects, one for each parent's unique id.


getRemovedParents

public java.util.Enumeration getRemovedParents()
Enumeration of Long objects, one for each removed parent's unique id.


isParent

public boolean isParent(long parentID)

isShared

public boolean isShared()
Specified by:
isShared in interface org.sourcejammer.project.Node
Overrides:
isShared in class ControllerNode

totalParentCount

public int totalParentCount()
Returns sum or parents and removed parents.


addRemovedParent

public void addRemovedParent(long parentID,
                             long key)

moveParentToRemoved

public void moveParentToRemoved(long parentID,
                                long key)
                         throws SecurityException
SecurityException

moveRemovedParentToParents

public void moveRemovedParentToParents(long parentID,
                                       long key)
                                throws SecurityException
SecurityException

removeParent

public java.lang.Long removeParent(long parentID,
                                   long key)
                            throws SecurityException
SecurityException

getParentID

public long getParentID()
Returns "first" parent id. If file is not shared (and has only one parent), returns the parent's id.


addVersionNode

public void addVersionNode(org.sourcejammer.project.view.NodeInfo version,
                           long key)
                    throws SecurityException
Adds a new VersionNode to this FileNode. Whether or not the nodeName/versionNumber of the VersionNode has been set, it will be reset here using the next version number.

Parameters:
version - -- a new version.
SecurityException

getLatestVersionNode

public org.sourcejammer.project.view.NodeInfo getLatestVersionNode()
                                                            throws NoSuchVersionException
Convenience method for returning most recent version node.

NoSuchVersionException

getVersionNode

public org.sourcejammer.project.view.NodeInfo getVersionNode(int index)
                                                      throws NoSuchVersionException
Returns the VersionNode with the specified index.

Parameters:
index - -- index of the VersionNode to be returned.
Returns:
the VersionNode with the specified index.
Throws:
NoSuchVersionException - if this does not have a version with the specified index.

getVersionNode

public org.sourcejammer.project.view.NodeInfo getVersionNode(long uniqueID)
                                                      throws NoSuchVersionException
Returns version node based on unique id.

NoSuchVersionException

removeVersionNode

public org.sourcejammer.project.view.NodeInfo removeVersionNode(long uniqueID,
                                                                long key)
                                                         throws NoSuchVersionException
NoSuchVersionException

removeOldestVersionNode

public org.sourcejammer.project.view.NodeInfo removeOldestVersionNode(long key)
                                                               throws org.sourcejammer.project.NodeDoesNotExistException,
                                                                      NoSuchVersionException
org.sourcejammer.project.NodeDoesNotExistException
NoSuchVersionException

childCount

public int childCount()
Returns number of version.

Specified by:
childCount in interface org.sourcejammer.project.Node
Specified by:
childCount in class ControllerNode

setVersionList

public void setVersionList(org.sourcejammer.project.NodeList versions)
Explicitly set the entire version list for this FileNode. If at least one version exists, this method throws BadMethod exception.


isCheckedOut

public boolean isCheckedOut()

setCheckedOut

public void setCheckedOut(boolean b,
                          long key)

getCheckedOutDate

public java.util.Date getCheckedOutDate()

setCheckedOutDate

public void setCheckedOutDate(java.util.Date d,
                              long key)

getCheckedOutToPath

public java.lang.String getCheckedOutToPath()

setCheckedOutToPath

public void setCheckedOutToPath(java.lang.String s,
                                long key)

getCheckedOutToUser

public java.lang.String getCheckedOutToUser()

setCheckedOutToUser

public void setCheckedOutToUser(java.lang.String s,
                                long key)

getFileType

public int getFileType()
Compare to org.sourcejammer.util.AppConfig.FileTypes


setDescription

public void setDescription(java.lang.String s,
                           long key)

getDescrption

public java.lang.String getDescrption()

setFileType

public void setFileType(int i,
                        long key)

setHistoryStorageType

public void setHistoryStorageType(int i,
                                  long key)

getHistoryStorageType

public int getHistoryStorageType()

setLimitHistorySize

public void setLimitHistorySize(boolean b,
                                long key)

isLimitHistorySize

public boolean isLimitHistorySize()

setMaxHistorySize

public void setMaxHistorySize(int i,
                              long key)

getMaxHistorySize

public int getMaxHistorySize()

main

public static void main(java.lang.String[] args)

getMasterFileID

public long getMasterFileID()
Returns the masterFileID.

Returns:
long

setMasterFileID

public void setMasterFileID(long masterFileID,
                            long key)
Sets the masterFileID.

Parameters:
masterFileID - The masterFileID to set


Copyright 2003 Soucejammer project.