vc.corba.server
Class ProjectDBManagerImpl

java.lang.Object
  |
  +--org.omg.CORBA.portable.ObjectImpl
        |
        +--vc.corba.common.intf._ProjectDBManagerImplBase
              |
              +--vc.corba.server.ProjectDBManagerImpl
All Implemented Interfaces:
org.omg.CORBA.portable.IDLEntity, org.omg.CORBA.portable.InvokeHandler, org.omg.CORBA.Object, ProjectDBManager, ProjectDBManagerOperations, java.lang.Runnable, java.io.Serializable

public class ProjectDBManagerImpl
extends _ProjectDBManagerImplBase
implements java.lang.Runnable

ProjectDBManagerImpl is the CORBA implementation for the IDL interface ProjectDBManager. This is the facade(pattern) for the subsystem which deals with the management of the project database. This provides the project management functionality for VersionControl/CORBA sesrver. This delegeates most of the processing to ProjectDB and other objects.

See Also:
Serialized Form

Field Summary
static java.util.Vector connections
          A collection of connections made to VersionControl/CORBA sesrver.
 ProjectDB projectDB
          reference to ProjectDB which has most of the version related functionality encapsulated into it
 
Constructor Summary
ProjectDBManagerImpl(ProjectDB projectDB)
          Constructs ProjectDBManagerImpl object out of the parameters passed to it.
 
Method Summary
 void clearConnection(java.lang.String connectionID)
          Clears the connection of VersionControl client to the VersionControl server, by sending the connection infirmation
 File createFile(java.lang.String connectionID, File newFile, java.lang.String directoryID, boolean unitOperation)
          Creates the file as a child of an existing directory in the Project database .
 Directory createRootDirectory(java.lang.String connectionID, Directory newDirectory, boolean unitOperation)
          Creates the directory in the Project database .
 Directory createSubDirectory(java.lang.String connectionID, Directory newDirectory, java.lang.String parentID, boolean unitOperation)
          Creates the sub directory in the Project database .
 void deleteDirectory(java.lang.String connectionID, java.lang.String directoryID, boolean unitOperation)
          Deletes an existing directory in the Project database .
 void deleteFile(java.lang.String connectionID, java.lang.String fileID, java.lang.String directoryID, boolean unitOperation)
          Delets the existing file in the Project database .
 ClientConnection getConnection(java.lang.String connectionID)
          Method for the internal processing to fetch the connection object based on the connectionID
 java.lang.String getDatabaseName(java.lang.String connectionID)
          Gets the name of the database with which this VersionControl server is dealing with.
 DirDiskMap getDirDiskMap(java.lang.String connectionID, java.lang.String directoryID, boolean returnEmptyDiskMapIfEmpty)
          Gets the DirDiskMap set to the combination of user and directory identified by it's ID
 DirDiskMap getFileDiskMap(java.lang.String connectionID, java.lang.String fileID, boolean returnParentsDiskMapIfNoneFound)
          Gets the DirDiskMap set to the combination of user and file identified by it's ID
 File[] getFiles(java.lang.String connectionID, java.lang.String directoryID)
          Gets all the files of a particular directory identified by the parameters
 File[] getFilesRecursively(java.lang.String connectionID, java.lang.String directoryID)
          Gets all the files of a particular directory recursively identified by the parameters
 Directory[] getRootDirectories(java.lang.String connectionID)
          Gets all the root directories
 Directory[] getSubDirectories(java.lang.String connectionID, java.lang.String directoryID)
          Gets all the sub directories of a particular directory identified by the parameter
static java.lang.String getUserIDForConnectionID(java.lang.String connectionID)
          Static Method to fetch the UserID based on the connectionID
 java.lang.String makeConnection(java.lang.String user, java.lang.String password, java.lang.String clientIP, ProjectDBManagerCB projectDBManagerCallBack)
          Makes a new connection to the VersionControl server, by sending the authentication infirmation
 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 setDirDiskMap(java.lang.String connectionID, java.lang.String osDirectory, java.lang.String directoryID, boolean unitOperation)
          Sets the DirDiskMap to the directory identified by it's ID
 void setFileDiskMap(java.lang.String connectionID, java.lang.String osDirectory, java.lang.String fileID, boolean unitOperation)
          Sets the DirDiskMap to the file identified by it's ID
 void updateDirectory(java.lang.String connectionID, Directory newDirectory, boolean unitOperation)
          Updates an existing directory in the Project database .
 void updateFile(java.lang.String connectionID, File newFile, boolean unitOperation)
          Updates the existing file in the Project database .
 
Methods inherited from class vc.corba.common.intf._ProjectDBManagerImplBase
_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
 

Field Detail

projectDB

public ProjectDB projectDB
reference to ProjectDB which has most of the version related functionality encapsulated into it

connections

public static java.util.Vector connections
A collection of connections made to VersionControl/CORBA sesrver.
Constructor Detail

ProjectDBManagerImpl

public ProjectDBManagerImpl(ProjectDB projectDB)
Constructs ProjectDBManagerImpl object out of the parameters passed to it.
Parameters:
projectDB - to initialize the field projectDB
Method Detail

getDatabaseName

public java.lang.String getDatabaseName(java.lang.String connectionID)
                                 throws VCException
Gets the name of the database with which this VersionControl server is dealing with.
Parameters:
connectionID - to identify the client who made this request
Throws:
Throws - VCException which is a CORBA enabled exception

makeConnection

public java.lang.String makeConnection(java.lang.String user,
                                       java.lang.String password,
                                       java.lang.String clientIP,
                                       ProjectDBManagerCB projectDBManagerCallBack)
                                throws VCException
Makes a new connection to the VersionControl server, by sending the authentication infirmation
Parameters:
user - ID of the user who requested the connection
password - password of the user who requested the connection
clientIP - IP address of the machine from which the user has requested the connection
projectDBManagerCallBack - Callback interface to subscribe the events of interest happening with the other clients, so that to synchronize the state of clients
Throws:
Throws - VCException which is a CORBA enabled exception

clearConnection

public void clearConnection(java.lang.String connectionID)
                     throws VCException
Clears the connection of VersionControl client to the VersionControl server, by sending the connection infirmation
Parameters:
connectionID - connectionID of the client whose connection is to be cleared
Throws:
Throws - VCException which is a CORBA enabled exception

saveChanges

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

createRootDirectory

public Directory createRootDirectory(java.lang.String connectionID,
                                     Directory newDirectory,
                                     boolean unitOperation)
                              throws VCException
Creates the directory 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
newDirectory - information of the new directory that is being created
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

createSubDirectory

public Directory createSubDirectory(java.lang.String connectionID,
                                    Directory newDirectory,
                                    java.lang.String parentID,
                                    boolean unitOperation)
                             throws VCException
Creates the sub directory 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
newDirectory - information of the new directory that is being created
parentID - ID of the parent under which the new directory is being created
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

getRootDirectories

public Directory[] getRootDirectories(java.lang.String connectionID)
                               throws VCException
Gets all the root directories
Parameters:
connectionID - to identify the client who made this request
Returns:
returns the directories that are all found in the root
Throws:
Throws - VCException which is a CORBA enabled exception

getSubDirectories

public Directory[] getSubDirectories(java.lang.String connectionID,
                                     java.lang.String directoryID)
                              throws VCException
Gets all the sub directories of a particular directory identified by the parameter
Parameters:
connectionID - to identify the client who made this request
directoryID - ID of the directory whose subdirectories are to be returned.
Returns:
returns all sub directories of the requested directory
Throws:
Throws - VCException which is a CORBA enabled exception

updateDirectory

public void updateDirectory(java.lang.String connectionID,
                            Directory newDirectory,
                            boolean unitOperation)
                     throws VCException
Updates an existing directory 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
newDirectory - information of the directory that is being updated
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

deleteDirectory

public void deleteDirectory(java.lang.String connectionID,
                            java.lang.String directoryID,
                            boolean unitOperation)
                     throws VCException
Deletes an existing directory 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 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

createFile

public File createFile(java.lang.String connectionID,
                       File newFile,
                       java.lang.String directoryID,
                       boolean unitOperation)
                throws VCException
Creates the file as a child of an existing directory 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
newFile - information of the new file that is being created
directoryID - ID of the parent directory under which the new file is being created
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

getFiles

public File[] getFiles(java.lang.String connectionID,
                       java.lang.String directoryID)
                throws VCException
Gets all the files of a particular directory identified by the parameters
Parameters:
connectionID - to identify the client who made this request
directoryID - ID of the directory whose files are to be returned.
Returns:
returns all files of the requested directory
Throws:
Throws - VCException which is a CORBA enabled exception

getFilesRecursively

public File[] getFilesRecursively(java.lang.String connectionID,
                                  java.lang.String directoryID)
                           throws VCException
Gets all the files of a particular directory recursively identified by the parameters
Parameters:
connectionID - to identify the client who made this request
directoryID - ID of the directory whose files are to be returned recursively.
Returns:
returns all files of the requested directory recursively
Throws:
Throws - VCException which is a CORBA enabled exception

updateFile

public void updateFile(java.lang.String connectionID,
                       File newFile,
                       boolean unitOperation)
                throws VCException
Updates 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
newFile - information of the new file that is being updated
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

deleteFile

public void deleteFile(java.lang.String connectionID,
                       java.lang.String fileID,
                       java.lang.String directoryID,
                       boolean unitOperation)
                throws VCException
Delets 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 new file that is being deleted
directoryID - ID of the new directory that is having the file to be 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

setDirDiskMap

public void setDirDiskMap(java.lang.String connectionID,
                          java.lang.String osDirectory,
                          java.lang.String directoryID,
                          boolean unitOperation)
                   throws VCException
Sets the DirDiskMap to the directory identified by it's ID
Parameters:
connectionID - to identify the client who made this request
osDirectory - File system directory to which the mapping is to be made
directoryID - ID of the new directory which is to be mapped to the file system directory
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

getDirDiskMap

public DirDiskMap getDirDiskMap(java.lang.String connectionID,
                                java.lang.String directoryID,
                                boolean returnEmptyDiskMapIfEmpty)
                         throws VCException
Gets the DirDiskMap set to the combination of user and directory identified by it's ID
Parameters:
connectionID - to identify the client who made this request
directoryID - ID of the directory whose disk map is to be returned
returnEmptyDiskMapIfEmpty - if this is true and no disk map is found then it returns an empty DirDiskMap object
Returns:
returns the DirDiskMap with the matching user identified by connection ID
Throws:
Throws - VCException which is a CORBA enabled exception

setFileDiskMap

public void setFileDiskMap(java.lang.String connectionID,
                           java.lang.String osDirectory,
                           java.lang.String fileID,
                           boolean unitOperation)
                    throws VCException
Sets the DirDiskMap to the file identified by it's ID
Parameters:
connectionID - to identify the client who made this request
osDirectory - File system directory to which the mapping is to be made
fileID - ID of the file which is to be mapped to the file system directory
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

getFileDiskMap

public DirDiskMap getFileDiskMap(java.lang.String connectionID,
                                 java.lang.String fileID,
                                 boolean returnParentsDiskMapIfNoneFound)
                          throws VCException
Gets the DirDiskMap set to the combination of user and file identified by it's ID
Parameters:
connectionID - to identify the client who made this request
fileID - ID of the file whose disk map is to be returned
returnEmptyDiskMapIfEmpty - if this is true and no disk map is found then it returns an empty DirDiskMap object
Returns:
returns the DirDiskMap with the matching user identified by connection ID
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

getConnection

public ClientConnection getConnection(java.lang.String connectionID)
Method for the internal processing to fetch the connection object based on the connectionID
Parameters:
connectionID - to identify the connection object uniquely
Returns:
returns the ClientConnection objects that represents the connection logically

getUserIDForConnectionID

public static java.lang.String getUserIDForConnectionID(java.lang.String connectionID)
Static Method to fetch the UserID based on the connectionID
Parameters:
connectionID - to identify the connection object and inturn the user ID associated with it
Returns:
returns the UserID associated with the connection identified by connectionID