vc.corba.server
Class DirectoryContainer

java.lang.Object
  |
  +--vc.corba.server.ProjectElementContainer
        |
        +--vc.corba.server.DirectoryContainer

public class DirectoryContainer
extends vc.corba.server.ProjectElementContainer

DirectoryContainer holds the directory object and it maintains the relations/references with other objects on the behalf of the directory object. It also has the methods to deal with the operations related to the directory object. It is like an association between the directory information and the related classes.


Field Summary
 Directory currentDirectory
          Actual directory object that represents the information about the directory
 java.util.Vector diskMaps
          Holds the apping between this and the file system directory for all the users
 java.util.Vector files
          Holds the dependent files of this directory
protected  DirectoryContainer parentDirectory
          Maintains the back reference to the Parent container
 java.util.Vector subDirectories
          Holds the subdirectories of this directory
 java.util.Vector versionHistory
          Maintains the details of each version/label for the project elements
 
Constructor Summary
DirectoryContainer(Directory currentDirectory, DirectoryContainer parentDirectory)
          Constructs the DirectoryContainer object from the Directory and the Parent objects
 
Method Summary
 FileContainer addFile(File childFile)
          Adds a file as the child of this directory
 void addNewLabelVersion(LabelVersionMap labelVersionMap)
          Adds one more LabelVersionMap object to the collection of LabelVersionMaps set to it
 void addSubDirectory(DirectoryContainer subDirectoryContainer)
          Adds an another DirectoryContainer object a the subdirectory of this Directory
 void destroyCurrentDirectory()
          Destroys the current directory and the dependent objects by requesting them to destroy themselves.
 void getChildrenRecursively(java.util.Vector directoryVector, java.util.Vector fileVector, boolean recursively)
          Gets all the child files and subdirectories of the current folder and the subdirectoriess to it.
 DirDiskMap getDiskMap(java.lang.String user)
          Gets a diskmap set for a particular user
 DirDiskMap getDiskMap(java.lang.String user, boolean returnEmptyDiskMap)
          Gets an actual diskmap set for a particular user or an empty diskmap if the intended diskmap is not found
 DirDiskMap[] getDiskMaps()
          Gets all the diskmaps set for a particular project element
 File[] getFiles()
          Gets the information of all the child files of this directory
 void getFilesRecursively(java.util.Vector fileHolder)
          Gets all the child files of the current folder and the subfolders to it.
 HistoryElement getHistoryElement(LabelVersionMap currentLabelVersionMap)
          Gets the history element for the current directory along with the label/version info taken from the parameter.
 java.util.Vector getLabelVersions(java.lang.String user, boolean getLabel, boolean getVersion, java.lang.String startTime, java.lang.String endTime)
          Gets the LabelVersionMap of this container with the matching criteria specified with the help of parameters
 DirectoryContainer getParentDirectory()
          Returns the referenec to its parent container
 Directory[] getSubDirectories(java.lang.String userID)
          Gets the subdirectories of this directory with the information personalized to a particulare user like the directory mapped to a project for a user
 java.lang.String getVersionForLabel(java.lang.String labelName)
          Gets the Version name for a particular label mapped to.
 void removeVersion(java.lang.String labelName, java.lang.String versionName)
          Removes a LabelVersionMap with the matching Label and Version names
 void setDiskMap(DirDiskMap diskMap)
          Adds one more diskmap object to the collection of diskmaps set to it
 void setLabelVersionAsLatest(LabelVersionMap labelVersionMap, boolean removeLatest)
          Sets a aprticular LabelVersionMap as the latest
 void setParentDirectory(DirectoryContainer parentDirectory)
          Sets the refernvece to a DirectoryContainer as its parent container
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentDirectory

public Directory currentDirectory
Actual directory object that represents the information about the directory

subDirectories

public java.util.Vector subDirectories
Holds the subdirectories of this directory

files

public java.util.Vector files
Holds the dependent files of this directory

parentDirectory

protected DirectoryContainer parentDirectory
Maintains the back reference to the Parent container

diskMaps

public java.util.Vector diskMaps
Holds the apping between this and the file system directory for all the users

versionHistory

public java.util.Vector versionHistory
Maintains the details of each version/label for the project elements
Constructor Detail

DirectoryContainer

public DirectoryContainer(Directory currentDirectory,
                          DirectoryContainer parentDirectory)
Constructs the DirectoryContainer object from the Directory and the Parent objects
Parameters:
currentDirectory - to initialize the field currentDirectory
parentDirectory - to initialize the field parentDirectory
Method Detail

addSubDirectory

public void addSubDirectory(DirectoryContainer subDirectoryContainer)
Adds an another DirectoryContainer object a the subdirectory of this Directory
Parameters:
subDirectoryContainer - the directory container of the directory object that is to be added as the subdirectory

addFile

public FileContainer addFile(File childFile)
Adds a file as the child of this directory
Parameters:
childFile - file object for whome the container will be cretaed and added as the child
Returns:
Returns the FileContainer created for the childFile

destroyCurrentDirectory

public void destroyCurrentDirectory()
Destroys the current directory and the dependent objects by requesting them to destroy themselves.

getSubDirectories

public Directory[] getSubDirectories(java.lang.String userID)
Gets the subdirectories of this directory with the information personalized to a particulare user like the directory mapped to a project for a user
Parameters:
userID - userID with reference to which the user specific properties are extracted.
Returns:
Retruns the array of subdirectories fetchedfrom this directory

getFiles

public File[] getFiles()
Gets the information of all the child files of this directory
Returns:
Retruns the array of child files fetchedfrom this directory

getFilesRecursively

public void getFilesRecursively(java.util.Vector fileHolder)
Gets all the child files of the current folder and the subfolders to it. All those files will be placed in the fileHolder vector which is used as the inout parameter.
Parameters:
fileHolder - an inout parameter that carries back all the files found recursively from the current folder

getChildrenRecursively

public void getChildrenRecursively(java.util.Vector directoryVector,
                                   java.util.Vector fileVector,
                                   boolean recursively)
Gets all the child files and subdirectories of the current folder and the subdirectoriess to it. All those files and subdirectories will be placed in the fileHolder and directoryVector vectors which are used as the inout parameters.
Parameters:
directoryHolder - an inout parameter that carries back all the directories found recursively from the current folder
fileHolder - an inout parameter that carries back all the files found recursively from the current folder
recursively - if this parameter is true then all the files and subdirectories will be fetched recursively, otherwise from the current folder alone

getHistoryElement

public HistoryElement getHistoryElement(LabelVersionMap currentLabelVersionMap)
Gets the history element for the current directory along with the label/version info taken from the parameter.
Parameters:
currentLabelVersionMap - Gives the information about the version/label to construct the HistoryElement based on it
Returns:
Retruns the HistoryElement constructed from a particular version/label

setParentDirectory

public void setParentDirectory(DirectoryContainer parentDirectory)
Sets the refernvece to a DirectoryContainer as its parent container
Parameters:
parentDirectory - to inirialize the field parentDirectory

getParentDirectory

public DirectoryContainer getParentDirectory()
Returns the referenec to its parent container
Returns:
Returns the parent's DirectoryContainer

setDiskMap

public void setDiskMap(DirDiskMap diskMap)
Adds one more diskmap object to the collection of diskmaps set to it
Parameters:
diskMap - the new diskmap added to the collection of diskmaps set to it

getDiskMap

public DirDiskMap getDiskMap(java.lang.String user)
Gets a diskmap set for a particular user
Parameters:
user - user for whom the matching diskmap is to be found
Returns:
Returns the diskmap set for a particular user

getDiskMap

public DirDiskMap getDiskMap(java.lang.String user,
                             boolean returnEmptyDiskMap)
Gets an actual diskmap set for a particular user or an empty diskmap if the intended diskmap is not found
Parameters:
user - user for whom the matching diskmap is to be found
returnEmptyDiskMap - retrns an empty diakmap if this is true and a matching diskmap is not found
Returns:
Returns the diskmap set for a particular user or an empty dismap if a matching diskmap is not found.

getDiskMaps

public DirDiskMap[] getDiskMaps()
Gets all the diskmaps set for a particular project element
Returns:
Returns all the diskmaps set for this project element

addNewLabelVersion

public void addNewLabelVersion(LabelVersionMap labelVersionMap)
Adds one more LabelVersionMap object to the collection of LabelVersionMaps set to it
Parameters:
labelVersionMap - the new LabelVersionMap added to the collection of LabelVersionMaps set to it

getLabelVersions

public java.util.Vector getLabelVersions(java.lang.String user,
                                         boolean getLabel,
                                         boolean getVersion,
                                         java.lang.String startTime,
                                         java.lang.String endTime)
                                  throws java.lang.Throwable
Gets the LabelVersionMap of this container with the matching criteria specified with the help of parameters
Parameters:
user - user for whom the matching LabelVersionMaps are to be found
getLabel - if true then the LabelVersionMaps related to labels will be returned
getVersion - if true then the LabelVersionMaps related to versions will be returned
startTime - LabelVersionMaps created on or after this time will only be returned
endTime - LabelVersionMaps created on or before this time will only be returned
Returns:
Returns the LabelVersionMaps matching the selection criteria defined in the parameters

setLabelVersionAsLatest

public void setLabelVersionAsLatest(LabelVersionMap labelVersionMap,
                                    boolean removeLatest)
Sets a aprticular LabelVersionMap as the latest
Parameters:
labelVersionMap - LabelVersionMap instance that is to be set as the latest one.
removeLatest - if true then the existing latest LabelVersionMap will be deleted

getVersionForLabel

public java.lang.String getVersionForLabel(java.lang.String labelName)
Gets the Version name for a particular label mapped to.
Parameters:
labelName - LabelName for which the matching version name is to be returned
Returns:
Returns the Version name for the label given as parameter

removeVersion

public void removeVersion(java.lang.String labelName,
                          java.lang.String versionName)
Removes a LabelVersionMap with the matching Label and Version names
Parameters:
labelName - label whose matching LabelVersionMap is to be deleted
versionName - version whose matching LabelVersionMap is to be deleted