vc.corba.server
Class FileContainer

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

public class FileContainer
extends vc.corba.server.ProjectElementContainer

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


Field Summary
 File currentFile
          Actual file object that represents the information about the file
 java.util.Vector diskMaps
          Holds the apping between this and the file system directory for all the users
static FileSystemHandler fileSystemHandler
          Gives the access to the native filesystem operations like changing file settings etc.
 java.lang.String latestVersion
          Represents the name of the latest version for this file
protected  DirectoryContainer parentDirectory
          Maintains the back reference to the Parent container
 java.util.Vector versionHistory
          Maintains the details of each version/label for the project elements
 
Constructor Summary
FileContainer(File currentFile, DirectoryContainer parentDirectory)
          Constructs the FileContainer object from the File and the Parent objects
 
Method Summary
 void addNewLabelVersion(LabelVersionMap labelVersionMap)
          Adds a new LabelVersionMap object to the history of labels/versions of this file
 void destroyCurrentFile()
          Destroys the current file and the dependent objects after disassociating itself from the objects it has depended upon.
 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 getFile()
          Returns the file that is associated with this container
 HistoryElement getHistoryElement(LabelVersionMap currentLabelVersionMap)
          Gets the history element for the current file 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
 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

currentFile

public File currentFile
Actual file object that represents the information about the file

latestVersion

public java.lang.String latestVersion
Represents the name of the latest version for this file

fileSystemHandler

public static FileSystemHandler fileSystemHandler
Gives the access to the native filesystem operations like changing file settings etc.

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

FileContainer

public FileContainer(File currentFile,
                     DirectoryContainer parentDirectory)
Constructs the FileContainer object from the File and the Parent objects
Parameters:
currentFile - to initialize the field currentFile
parentDirectory - to initialize the field parentDirectory in the super class
Method Detail

addNewLabelVersion

public void addNewLabelVersion(LabelVersionMap labelVersionMap)
Adds a new LabelVersionMap object to the history of labels/versions of this file
Overrides:
addNewLabelVersion in class vc.corba.server.ProjectElementContainer
Parameters:
labelVersionMap - new LabelVersionMap being added to the history of labels/versions of this file

destroyCurrentFile

public void destroyCurrentFile()
Destroys the current file and the dependent objects after disassociating itself from the objects it has depended upon.

getFile

public File getFile()
Returns the file that is associated with this container
Returns:
Retruns the File object associated with this container

getHistoryElement

public HistoryElement getHistoryElement(LabelVersionMap currentLabelVersionMap)
Gets the history element for the current file 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

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