vc.corba.server
Class FileVersionManagerImpl

java.lang.Object
  |
  +--org.omg.CORBA.portable.ObjectImpl
        |
        +--vc.corba.common.intf._FileVersionManagerImplBase
              |
              +--vc.corba.server.FileVersionManagerImpl
All Implemented Interfaces:
FileVersionManager, FileVersionManagerOperations, org.omg.CORBA.portable.IDLEntity, org.omg.CORBA.portable.InvokeHandler, org.omg.CORBA.Object, java.lang.Runnable, java.io.Serializable

public class FileVersionManagerImpl
extends _FileVersionManagerImplBase
implements java.lang.Runnable

FileVersionManagerImpl is the CORBA implementation for the IDL interface FileVersionManager. This is the facade(pattern) for the subsystem which deals with the management of the file versions. This provides the file versioning functionality for VersionControl/CORBA sesrver. This delegeates most of the processing to ProjectDB and other objects.

See Also:
Serialized Form

Constructor Summary
FileVersionManagerImpl(ProjectDB projectDB, ProjectDBManagerImpl projectDBManager)
          Constructs FileVersionManagerImpl object out of the parameters passed to it.
 
Method Summary
 void addFileVersion(java.lang.String connectionID, boolean keepCheckedOut, VersionData newVersionData, java.lang.String dirMappedTo, boolean unitOperation)
          Creates a new version for the existing file in the Project database .
 void addLabelForDirectories(java.lang.String connectionID, java.lang.String labelName, boolean recursive, java.lang.String[] directoryIDs, boolean unitOperation)
          Creates a new label for the existing directories in the Project database .
 void addLabelForFiles(java.lang.String connectionID, java.lang.String labelName, java.lang.String[] fileIDs, boolean unitOperation)
          Creates a new label for the existing files in the Project database .
 void checkInFile(java.lang.String connectionID, java.lang.String fileID, boolean unitOperation)
          Checks in the existing file in the Project database .
 void checkInMultipleFiles(java.lang.String connectionID, java.lang.String[] fileIDs, boolean unitOperation)
          Checks in the multiple existing files in the Project database .
 void checkOutFile(java.lang.String connectionID, java.lang.String fileID, java.lang.String checkOutDir, boolean unitOperation)
          Checks out the existing file in the Project database .
 void checkOutMultipleFiles(java.lang.String connectionID, java.lang.String[] fileIDs, java.lang.String checkOutDir, boolean unitOperation)
          Checks out the multiple existing files in the Project database .
 void createFile(java.lang.String connectionID, java.lang.String directoryID, java.lang.String fileName, boolean keepCheckedOut, VersionData newVersionData, java.lang.String dirMappedTo, boolean unitOperation)
          Creates the file in the Project database .
 void deleteFileVersion(java.lang.String connectionID, java.lang.String fileID, java.lang.String versionName, boolean unitOperation)
          Deletes the existing version of a file in the Project database .
 VersionData getFileVersion(java.lang.String connectionID, java.lang.String fileID, java.lang.String versionName)
          Gets the contents of a particular version of a file
 HistoryElement[] getLabelsForFiles(java.lang.String connectionID, java.lang.String[] fileIDs, java.lang.String user, java.lang.String startTime, java.lang.String endTime, boolean getLabels, boolean getVersions)
          This methos is to query and get all the labels and versions on the files that meet the criteria specified by the parameters.
 HistoryElement[] getLabelsOfDirectories(java.lang.String connectionID, java.lang.String[] directoryIDs, java.lang.String user, java.lang.String startTime, java.lang.String endTime, boolean getLabels, boolean getVersions, boolean recursive, boolean getFiles, boolean getSubDirectories)
          This methos is to query and get all the labels and versions on the directories and files that meet the criteria specified by the parameters.
 VersionData[] getMultipleFileVersions(java.lang.String connectionID, java.lang.String fileID, java.lang.String[] versionNames)
          Gets the contents of the particular versions of a file
 void removeLabelOfDirectories(java.lang.String connectionID, java.lang.String labelName, boolean recursive, boolean removeLatest, java.lang.String[] directoryIDs, boolean unitOperation)
          Removes an existing label of the directories(and inturn files) .
 void removeLabelOfFiles(java.lang.String connectionID, java.lang.String labelName, java.lang.String versionName, boolean removeLatest, java.lang.String[] fileIDs, boolean unitOperation)
          Removes an existing label of the files .
 void revertToLabelOfDirectories(java.lang.String connectionID, java.lang.String labelName, boolean recursive, boolean removeLatest, java.lang.String[] directoryIDs, boolean unitOperation)
          Makes an existing label of the directories(and inturn files) as the latest version.
 void revertToLabelOfFiles(java.lang.String connectionID, java.lang.String labelName, java.lang.String versionName, boolean removeLatest, java.lang.String[] fileIDs, boolean unitOperation)
          Makes an existing label of the files as the latest version.
 void run()
          A method for futuristic usage to trigger a task in a different thread
 void saveChanges()
          Saves the changes mede to the project database
 void undoCheckOutFile(java.lang.String connectionID, java.lang.String fileID, boolean unitOperation)
          Undoes Check out of the existing file in the Project database .
 void undoCheckOutMultipleFiles(java.lang.String connectionID, java.lang.String[] fileIDs, boolean unitOperation)
          Undoes Check out of the multiple existing file in the Project database .
 
Methods inherited from class vc.corba.common.intf._FileVersionManagerImplBase
_ids, _invoke
 
Methods inherited from class org.omg.CORBA.portable.ObjectImpl
_create_request, _create_request, _duplicate, _get_delegate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_delegate, _set_policy_override, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.omg.CORBA.Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
 

Constructor Detail

FileVersionManagerImpl

public FileVersionManagerImpl(ProjectDB projectDB,
                              ProjectDBManagerImpl projectDBManager)
                       throws java.lang.Throwable
Constructs FileVersionManagerImpl object out of the parameters passed to it.
Parameters:
projectDB - to initialize the field projectDB
projectDBManager - to initialize the field projectDBManager
Method Detail

saveChanges

public void saveChanges()
Saves the changes mede to the project database

getFileVersion

public VersionData getFileVersion(java.lang.String connectionID,
                                  java.lang.String fileID,
                                  java.lang.String versionName)
                           throws VCException
Gets the contents of a particular version of a file
Parameters:
connectionID - to identify the client who made this request
fileID - ID of the file whose content is requested
versionName - Name of the version whose content 9s requested
Returns:
returns the version data and the content of the file
Throws:
Throws - VCException which is a CORBA enabled exception

getMultipleFileVersions

public VersionData[] getMultipleFileVersions(java.lang.String connectionID,
                                             java.lang.String fileID,
                                             java.lang.String[] versionNames)
                                      throws VCException
Gets the contents of the particular versions of a file
Parameters:
connectionID - to identify the client who made this request
fileID - ID of the file whose content is requested
versionNames - Names of the versions whose content is requested
Returns:
returns the version data and the content of different versions of the file
Throws:
Throws - VCException which is a CORBA enabled exception

createFile

public void createFile(java.lang.String connectionID,
                       java.lang.String directoryID,
                       java.lang.String fileName,
                       boolean keepCheckedOut,
                       VersionData newVersionData,
                       java.lang.String dirMappedTo,
                       boolean unitOperation)
                throws VCException
Creates the file in the Project database . Saves the changes if it is a unit operation and informs all the clients about the changes with the callback interface.
Parameters:
connectionID - to identify the client who made this request
directoryID - ID of the directory in which the file is created
fileName - Name of the file being created
keepCheckedOut - if true then the file will be in checked out state after it is created
newVersionData - contents of the file in its initial version
dirMappedTo - Filesystem directory to which this file is mapped to
unitOperation - if this is true then the changes to PorjectDB will be saved immediatly. Helpfull for reducing the number of times PoojectDB is saved. If this is false client will make an explicit request to sace ProjectDB
Throws:
Throws - VCException which is a CORBA enabled exception

addFileVersion

public void addFileVersion(java.lang.String connectionID,
                           boolean keepCheckedOut,
                           VersionData newVersionData,
                           java.lang.String dirMappedTo,
                           boolean unitOperation)
                    throws VCException
Creates a new version for the existing file in the Project database . Saves the changes if it is a unit operation and informs all the clients about the changes with the callback interface.
Parameters:
connectionID - to identify the client who made this request
keepCheckedOut - if true then the file will be in checked out state after it is created
newVersionData - contents of the file in its initial version
dirMappedTo - Filesystem directory to which this file is mapped to
unitOperation - if this is true then the changes to PorjectDB will be saved immediatly. Helpfull for reducing the number of times PoojectDB is saved. If this is false client will make an explicit request to sace ProjectDB
Throws:
Throws - VCException which is a CORBA enabled exception

deleteFileVersion

public void deleteFileVersion(java.lang.String connectionID,
                              java.lang.String fileID,
                              java.lang.String versionName,
                              boolean unitOperation)
                       throws VCException
Deletes the existing version of a file in the Project database . Saves the changes if it is a unit operation and informs all the clients about the changes with the callback interface.
Parameters:
connectionID - to identify the client who made this request
fileID - ID of the file whose version is being deleted
versionName - Name of the file version that is being deleted
unitOperation - if this is true then the changes to PorjectDB will be saved immediatly. Helpfull for reducing the number of times PoojectDB is saved. If this is false client will make an explicit request to sace ProjectDB
Throws:
Throws - VCException which is a CORBA enabled exception

checkInFile

public void checkInFile(java.lang.String connectionID,
                        java.lang.String fileID,
                        boolean unitOperation)
                 throws VCException
Checks in the existing file in the Project database . Saves the changes if it is a unit operation and informs all the clients about the changes with the callback interface.
Parameters:
connectionID - to identify the client who made this request
fileID - ID of the file which is being checked in
unitOperation - if this is true then the changes to PorjectDB will be saved immediatly. Helpfull for reducing the number of times PoojectDB is saved. If this is false client will make an explicit request to sace ProjectDB
Throws:
Throws - VCException which is a CORBA enabled exception

checkOutFile

public void checkOutFile(java.lang.String connectionID,
                         java.lang.String fileID,
                         java.lang.String checkOutDir,
                         boolean unitOperation)
                  throws VCException
Checks out the existing file in the Project database . Saves the changes if it is a unit operation and informs all the clients about the changes with the callback interface.
Parameters:
connectionID - to identify the client who made this request
fileID - ID of the file which is being checked out
checkOutDir - Directory to where the file is checked out
unitOperation - if this is true then the changes to PorjectDB will be saved immediatly. Helpfull for reducing the number of times PoojectDB is saved. If this is false client will make an explicit request to sace ProjectDB
Throws:
Throws - VCException which is a CORBA enabled exception

undoCheckOutFile

public void undoCheckOutFile(java.lang.String connectionID,
                             java.lang.String fileID,
                             boolean unitOperation)
                      throws VCException
Undoes Check out of the existing file in the Project database . Saves the changes if it is a unit operation and informs all the clients about the changes with the callback interface.
Parameters:
connectionID - to identify the client who made this request
fileID - ID of the file which is being cancelled from check out
unitOperation - if this is true then the changes to PorjectDB will be saved immediatly. Helpfull for reducing the number of times PoojectDB is saved. If this is false client will make an explicit request to sace ProjectDB
Throws:
Throws - VCException which is a CORBA enabled exception

checkInMultipleFiles

public void checkInMultipleFiles(java.lang.String connectionID,
                                 java.lang.String[] fileIDs,
                                 boolean unitOperation)
                          throws VCException
Checks in the multiple existing files in the Project database . Saves the changes if it is a unit operation and informs all the clients about the changes with the callback interface.
Parameters:
connectionID - to identify the client who made this request
fileIDs - IDs of the files which are being checked in
unitOperation - if this is true then the changes to PorjectDB will be saved immediatly. Helpfull for reducing the number of times PoojectDB is saved. If this is false client will make an explicit request to sace ProjectDB
Throws:
Throws - VCException which is a CORBA enabled exception

checkOutMultipleFiles

public void checkOutMultipleFiles(java.lang.String connectionID,
                                  java.lang.String[] fileIDs,
                                  java.lang.String checkOutDir,
                                  boolean unitOperation)
                           throws VCException
Checks out the multiple existing files in the Project database . Saves the changes if it is a unit operation and informs all the clients about the changes with the callback interface.
Parameters:
connectionID - to identify the client who made this request
fileIDs - IDs of the files which are being checked out
checkOutDir - Directory to where the file is checked out
unitOperation - if this is true then the changes to PorjectDB will be saved immediatly. Helpfull for reducing the number of times PoojectDB is saved. If this is false client will make an explicit request to sace ProjectDB
Throws:
Throws - VCException which is a CORBA enabled exception

undoCheckOutMultipleFiles

public void undoCheckOutMultipleFiles(java.lang.String connectionID,
                                      java.lang.String[] fileIDs,
                                      boolean unitOperation)
                               throws VCException
Undoes Check out of the multiple existing file in the Project database . Saves the changes if it is a unit operation and informs all the clients about the changes with the callback interface.
Parameters:
connectionID - to identify the client who made this request
fileIDs - IDs of the files which are being cancelled from check out
unitOperation - if this is true then the changes to PorjectDB will be saved immediatly. Helpfull for reducing the number of times PoojectDB is saved. If this is false client will make an explicit request to sace ProjectDB
Throws:
Throws - VCException which is a CORBA enabled exception

getLabelsOfDirectories

public HistoryElement[] getLabelsOfDirectories(java.lang.String connectionID,
                                               java.lang.String[] directoryIDs,
                                               java.lang.String user,
                                               java.lang.String startTime,
                                               java.lang.String endTime,
                                               boolean getLabels,
                                               boolean getVersions,
                                               boolean recursive,
                                               boolean getFiles,
                                               boolean getSubDirectories)
                                        throws VCException
This methos is to query and get all the labels and versions on the directories and files that meet the criteria specified by the parameters.
Parameters:
connectionID - to identify the client who made this request
directoryIDs - IDs of the directories whose labels are to be extracted
user - Is to select the labels created by user same as this parameter
startTime - if this is a non empty string then the labels created on or after this will be selected
endTime - if this is a non empty string then the labels created on or before this will be selected
getLabels - if this is true then the labels meeting the criteria will be selected
getVersions - if this is true then the versions meeting the criteria will be selected
recursive - if this is true then labels and versions will be selected recursively from sub directories also
getFiles - if this is true then labels and versions will be selected for files also
getSubDirectories - if this is true then labels and versions will be selected for getSubDirectories also
Returns:
Returns HistoryElements where each represent eigther a version or a label
Throws:
Throws - VCException which is a CORBA enabled exception

getLabelsForFiles

public HistoryElement[] getLabelsForFiles(java.lang.String connectionID,
                                          java.lang.String[] fileIDs,
                                          java.lang.String user,
                                          java.lang.String startTime,
                                          java.lang.String endTime,
                                          boolean getLabels,
                                          boolean getVersions)
                                   throws VCException
This methos is to query and get all the labels and versions on the files that meet the criteria specified by the parameters.
Parameters:
connectionID - to identify the client who made this request
fileIDs - IDs of the files whose labels/versions are to be extracted
user - Is to select the labels created by user same as this parameter
startTime - if this is a non empty string then the labels created on or after this will be selected
endTime - if this is a non empty string then the labels created on or before this will be selected
getLabels - if this is true then the labels meeting the criteria will be selected
getVersions - if this is true then the versions meeting the criteria will be selected
Returns:
Returns HistoryElements where each represent eigther a version or a label
Throws:
Throws - VCException which is a CORBA enabled exception

addLabelForDirectories

public void addLabelForDirectories(java.lang.String connectionID,
                                   java.lang.String labelName,
                                   boolean recursive,
                                   java.lang.String[] directoryIDs,
                                   boolean unitOperation)
                            throws VCException
Creates a new label for the existing directories in the Project database . Saves the changes if it is a unit operation and informs all the clients about the changes with the callback interface.
Parameters:
connectionID - to identify the client who made this request
labelName - Name of the label being created for the directories
recursive - if this is true then the label is added recursively to the subdirectories and files of each directory
directoryIDs - IDs of the directories to whom the label is being added
unitOperation - if this is true then the changes to PorjectDB will be saved immediatly. Helpfull for reducing the number of times PoojectDB is saved. If this is false client will make an explicit request to sace ProjectDB
Throws:
Throws - VCException which is a CORBA enabled exception

addLabelForFiles

public void addLabelForFiles(java.lang.String connectionID,
                             java.lang.String labelName,
                             java.lang.String[] fileIDs,
                             boolean unitOperation)
                      throws VCException
Creates a new label for the existing files in the Project database . Saves the changes if it is a unit operation and informs all the clients about the changes with the callback interface.
Parameters:
connectionID - to identify the client who made this request
labelName - Name of the label being created for the files
fileIDs - IDs of the files to whom the label is being added
unitOperation - if this is true then the changes to PorjectDB will be saved immediatly. Helpfull for reducing the number of times PoojectDB is saved. If this is false client will make an explicit request to sace ProjectDB
Throws:
Throws - VCException which is a CORBA enabled exception

revertToLabelOfDirectories

public void revertToLabelOfDirectories(java.lang.String connectionID,
                                       java.lang.String labelName,
                                       boolean recursive,
                                       boolean removeLatest,
                                       java.lang.String[] directoryIDs,
                                       boolean unitOperation)
                                throws VCException
Makes an existing label of the directories(and inturn files) as the latest version. Saves the changes if it is a unit operation and informs all the clients about the changes with the callback interface.
Parameters:
connectionID - to identify the client who made this request
labelName - Name of the label being reverted to for the directories
recursive - if this is true then the label is reverted recursively to the subdirectories and files of each directory
removeLatest - Remove the labels that are old labels
directoryIDs - IDs of the directories whose old label is being made the latest
unitOperation - if this is true then the changes to PorjectDB will be saved immediatly. Helpfull for reducing the number of times PoojectDB is saved. If this is false client will make an explicit request to sace ProjectDB
Throws:
Throws - VCException which is a CORBA enabled exception

revertToLabelOfFiles

public void revertToLabelOfFiles(java.lang.String connectionID,
                                 java.lang.String labelName,
                                 java.lang.String versionName,
                                 boolean removeLatest,
                                 java.lang.String[] fileIDs,
                                 boolean unitOperation)
                          throws VCException
Makes an existing label of the files as the latest version. Saves the changes if it is a unit operation and informs all the clients about the changes with the callback interface.
Parameters:
connectionID - to identify the client who made this request
labelName - Name of the label being reverted to for the files
versionName - Name of the version being reverted to for the files
removeLatest - Remove the labels that are old labels
fileIDs - IDs of the files whose old label is being made the latest
unitOperation - if this is true then the changes to PorjectDB will be saved immediatly. Helpfull for reducing the number of times PoojectDB is saved. If this is false client will make an explicit request to sace ProjectDB
Throws:
Throws - VCException which is a CORBA enabled exception

removeLabelOfDirectories

public void removeLabelOfDirectories(java.lang.String connectionID,
                                     java.lang.String labelName,
                                     boolean recursive,
                                     boolean removeLatest,
                                     java.lang.String[] directoryIDs,
                                     boolean unitOperation)
                              throws VCException
Removes an existing label of the directories(and inturn files) . Saves the changes if it is a unit operation and informs all the clients about the changes with the callback interface.
Parameters:
connectionID - to identify the client who made this request
labelName - Name of the label being deleted for the directories
recursive - if this is true then the label is deleted recursively to the subdirectories and files of each directory
removeLatest - Remove the labels that are old labels
directoryIDs - IDs of the directories whose label is deleted
unitOperation - if this is true then the changes to PorjectDB will be saved immediatly. Helpfull for reducing the number of times PoojectDB is saved. If this is false client will make an explicit request to sace ProjectDB
Throws:
Throws - VCException which is a CORBA enabled exception

removeLabelOfFiles

public void removeLabelOfFiles(java.lang.String connectionID,
                               java.lang.String labelName,
                               java.lang.String versionName,
                               boolean removeLatest,
                               java.lang.String[] fileIDs,
                               boolean unitOperation)
                        throws VCException
Removes an existing label of the files . Saves the changes if it is a unit operation and informs all the clients about the changes with the callback interface.
Parameters:
connectionID - to identify the client who made this request
labelName - Name of the label being removed for the files
versionName - Name of the version being removed for the files
removeLatest - Remove the labels that are old labels
fileIDs - IDs of the files whose old label is being made the latest
unitOperation - if this is true then the changes to PorjectDB will be saved immediatly. Helpfull for reducing the number of times PoojectDB is saved. If this is false client will make an explicit request to sace ProjectDB
Throws:
Throws - VCException which is a CORBA enabled exception

run

public void run()
A method for futuristic usage to trigger a task in a different thread
Specified by:
run in interface java.lang.Runnable