scm.pub.gateway.project
Class Project

java.lang.Object
  extended byscm.pub.gateway.project.Project

public final class Project
extends java.lang.Object

The Project class is a proxy class for a live project defined in a SpectrumSCM federated system. Projects in SpectrumSCM define their own databases and are transactionally independent from the rest of the database federation. Each Project contains a user defined set of lifecycle phases, a set of ChangeRequest attributes with values and a set of users, defined to operate as certain roles within the project.


Constructor Summary
Project(java.lang.String projectName)
          Create a Project associated with the given project name.
 
Method Summary
 java.lang.String createChangeRequest(ChangeRequestCreator_d crc)
          Create a new ChangeRequest.
 java.util.Vector getActiveChangeRequests()
          Get all ChangeRequests that are currently active in this Project.
 ChangeRequest_d getCRInfo(java.lang.String CRid)
          Get the information contained in this ChangeRequest.
 java.util.Vector getGenericNames()
          Get the names of all of the Generics associated with this Project
 java.util.Vector getInActiveChangeRequests()
          Get all ChangeRequests that are currently inactive in this Project.
 java.util.Vector getLifeCyclePhases()
          Get the life cycle phases defined for this project.
 java.lang.String getName()
          Get the name of this Project
 AttributeMap_d getProjectChangeRequestAttributes()
          Get the ChangeRequest attributes defined for this project.
 void getSource(java.io.File target, CRFileDescriptor_d fileDescriptor)
          Get the HEAD REVISION of the file associated with this CRFileDescriptor.
 User_d getUserInfo(java.lang.String user)
          Get information about a specific user including their assigned roles on this project.
 java.util.Vector getUsers()
          Get the users assigned to this project.
 void getVersionSource(java.io.File target, CRFileDescriptor_d fileDescriptor)
          Get the EXACT REVISION of the file associated with this CRFileDescriptor.
 boolean isAttributeEditable(java.lang.String attrib)
          Determine whether the given project attribute name is user editable or not
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Project

public Project(java.lang.String projectName)
        throws InvalidProject,
               SystemException
Create a Project associated with the given project name.

Parameters:
projectName - The name of the Project to connect to on the server.
Throws:
InvalidProject - If the Project name is invalid.
SystemException - If an internal exception is caught.
Method Detail

getSource

public void getSource(java.io.File target,
                      CRFileDescriptor_d fileDescriptor)
               throws SystemException
Get the HEAD REVISION of the file associated with this CRFileDescriptor.

Parameters:
target - The File representing the target for the extraction.
Throws:
java.io.IOException - If the file cannot be created at the requested location.
SystemException - If the system cannot be accessed.

getVersionSource

public void getVersionSource(java.io.File target,
                             CRFileDescriptor_d fileDescriptor)
                      throws SystemException
Get the EXACT REVISION of the file associated with this CRFileDescriptor.

Parameters:
target - The File representing the target for the extraction.
Throws:
SystemException - If the system cannot be accessed or the file cannot be created.

createChangeRequest

public java.lang.String createChangeRequest(ChangeRequestCreator_d crc)
                                     throws SystemException,
                                            InvalidUser,
                                            InvalidGeneric,
                                            InvalidPhase
Create a new ChangeRequest.

Parameters:
crc - A ChangeRequestCreator_d object, which describes all of the necessary information for ChangeRequest creation.
Returns:
The name of the newly created CR.
Throws:
SystemException - If an internal exception is caught.
InvalidUser - If the assigned user or creation user is invalid.
InvalidPhase - If the creation or assigned states are invalid.
InvalidGeneric - If the assignment generic is invalid.

isAttributeEditable

public boolean isAttributeEditable(java.lang.String attrib)
                            throws SystemException
Determine whether the given project attribute name is user editable or not

Parameters:
attrib - The attribute to check.
Returns:
Boolean whether the supplied attribute is user editable or not.
Throws:
SystemException

getName

public java.lang.String getName()
Get the name of this Project

Returns:
The name of the Project

getGenericNames

public java.util.Vector getGenericNames()
                                 throws SystemException
Get the names of all of the Generics associated with this Project

Returns:
A Vector<String> of Generic names.
Throws:
SystemException - If an internal exception is caught.

getUsers

public java.util.Vector getUsers()
                          throws SystemException
Get the users assigned to this project.

Returns:
A Vector of User names as Strings.
Throws:
SystemException - If an internal exception is caught.

getUserInfo

public User_d getUserInfo(java.lang.String user)
                   throws InvalidUser,
                          SystemException
Get information about a specific user including their assigned roles on this project.

Parameters:
user - The names of a particular user.
Returns:
A User_d object containing all of a users information for this project.
Throws:
InvalidUser - If the supplied user id does not exist.
SystemException - If an internal exception is caught.

getProjectChangeRequestAttributes

public AttributeMap_d getProjectChangeRequestAttributes()
                                                 throws SystemException
Get the ChangeRequest attributes defined for this project.

Returns:
The AttributeMap_d that gets returned contains the key and value sets defined for the ChangeRequest attributes in this project.
Throws:
SystemException - If an internal exception is caught.

getLifeCyclePhases

public java.util.Vector getLifeCyclePhases()
                                    throws SystemException
Get the life cycle phases defined for this project.

Returns:
A Vector containing String values representing the phases in the lifecycle defined for this project.
Throws:
SystemException - If an internal exception is caught.

getInActiveChangeRequests

public java.util.Vector getInActiveChangeRequests()
                                           throws SystemException
Get all ChangeRequests that are currently inactive in this Project.

Returns:
A Vector of Strings contains the IDs of all the ChangeRequests in this project that are either Completed or Killed
Throws:
SystemException - If an internal exception is caught.

getActiveChangeRequests

public java.util.Vector getActiveChangeRequests()
                                         throws SystemException
Get all ChangeRequests that are currently active in this Project.

Returns:
A Vector of Strings contains the IDs of all the ChangeRequests in this project that are in phases other than Completed or Killed
Throws:
SystemException - If an internal exception is caught.

getCRInfo

public ChangeRequest_d getCRInfo(java.lang.String CRid)
                          throws InvalidChangeRequest,
                                 SystemException
Get the information contained in this ChangeRequest.

Parameters:
CRid - The name of the ChangeRequest.
Returns:
A ChangeRequest_d transport object, which contains all of the change request's current information.
Throws:
InvalidChangeRequest - If the supplied CRid is invalid.
SystemException - If an internal exception is caught.