hudson.scm
Class IntegrityCMProject

java.lang.Object
  extended by hudson.scm.IntegrityCMProject
All Implemented Interfaces:
Serializable

public class IntegrityCMProject
extends Object
implements Serializable

This class represents an Integrity Configuration Management Project Provides metadata information about a SCM Project

See Also:
Serialized Form

Field Summary
static String BUILD_PROJECT
           
static String NORMAL_PROJECT
           
static String VARIANT_PROJECT
           
 
Constructor Summary
IntegrityCMProject(com.mks.api.response.WorkItem wi, File projectDB)
          Creates an instance of an Integrity CM Project and extracts all information from the API Response Field
 
Method Summary
 com.mks.api.response.Response addProjectLabel(APISession api, String chkptLabel)
          Applies a Project Label on this Integrity CM Project
 com.mks.api.response.Response checkpoint(APISession api, String chkptLabel)
          Performs a checkpoint on this Integrity CM Project
 void closeProjectDB()
          Closes the connections to the embedded derby database
 int compareBaseline(File baselineProjectDB, APISession api)
          Compares this version of the project to a previous/new version to determine what are the updates and what was deleted
 String getChangeLog(String version, List<Hashtable<CM_PROJECT,Object>> projectMembersList)
          Returns the Change Log based on the project baseline comparison This assumes that compareBaseline() has been called already
 String getConfigurationPath()
          Returns the Full Configuration Path for this Integrity CM Project
 List<String> getDirList()
          Returns a string list of relative paths to all directories in this project
 Date getLastCheckpointDate()
          Returns the date when the last checkpoint was performed on this Project
 String getLineTerminator()
          Returns the line terminator setting for this project
 String getProjectName()
          Returns the project path for this Integrity CM Project
 String getProjectRevision()
          Returns the project revision for this Integrity SCM Project
 boolean getRestoreTimestamp()
          Returns the restore timestamp setting for this project
 void initializeProject(com.mks.api.response.WorkItem wi)
           
 boolean isBuild()
          Returns true if this is a Build Project
 boolean isNormal()
          Returns true is this is a Normal Project
 boolean isVariant()
          Returns true if this is a Variant Project
 Connection openProjectDB()
          Opens a new connection to the embedded Integrity SCM Project cache db
 void parseProject(com.mks.api.response.WorkItemIterator wit)
          Parses the output from the si viewproject command to get a list of members
 void primeAuthorInformation(APISession api)
          Updates the author information for all the members in the project
 void setLineTerminator(String lineTerminator)
          Sets the optional line terminator option for this project
 void setRestoreTimestamp(boolean restoreTimestamp)
          Sets the optional restore timestamp option for this project
 void setSkipAuthorInfo(boolean skipAuthorInfo)
          Toggles whether or not to obtain the author using 'si revisioninfo'
 void updateChecksum(Hashtable<String,String> checksumHash)
          Updates the underlying Integrity SCM Project table cache with the new checksum information
 List<Hashtable<CM_PROJECT,Object>> viewProject()
          Project access function that returns the state of the current project NOTE: For maximum efficiency, this should be called only once and after the compareBasline() has been invoked!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NORMAL_PROJECT

public static final String NORMAL_PROJECT
See Also:
Constant Field Values

VARIANT_PROJECT

public static final String VARIANT_PROJECT
See Also:
Constant Field Values

BUILD_PROJECT

public static final String BUILD_PROJECT
See Also:
Constant Field Values
Constructor Detail

IntegrityCMProject

public IntegrityCMProject(com.mks.api.response.WorkItem wi,
                          File projectDB)
Creates an instance of an Integrity CM Project and extracts all information from the API Response Field

Parameters:
wi - Work Item associated with the response from running si projectinfo
projectDB - Location of where the embedded derby database for this project
Method Detail

initializeProject

public void initializeProject(com.mks.api.response.WorkItem wi)

setLineTerminator

public void setLineTerminator(String lineTerminator)
Sets the optional line terminator option for this project

Parameters:
lineTerminator -

getLineTerminator

public String getLineTerminator()
Returns the line terminator setting for this project

Returns:

setRestoreTimestamp

public void setRestoreTimestamp(boolean restoreTimestamp)
Sets the optional restore timestamp option for this project

Parameters:
restoreTimestamp -

getRestoreTimestamp

public boolean getRestoreTimestamp()
Returns the restore timestamp setting for this project

Returns:

setSkipAuthorInfo

public void setSkipAuthorInfo(boolean skipAuthorInfo)
Toggles whether or not to obtain the author using 'si revisioninfo'

Parameters:
skipAuthorInfo -

openProjectDB

public Connection openProjectDB()
                         throws SQLException
Opens a new connection to the embedded Integrity SCM Project cache db

Returns:
Connection to the embedded derby database
Throws:
SQLException

closeProjectDB

public void closeProjectDB()
Closes the connections to the embedded derby database


parseProject

public void parseProject(com.mks.api.response.WorkItemIterator wit)
                  throws com.mks.api.response.APIException,
                         SQLException
Parses the output from the si viewproject command to get a list of members

Parameters:
wit - WorkItemIterator
Throws:
com.mks.api.response.APIException
SQLException

primeAuthorInformation

public void primeAuthorInformation(APISession api)
                            throws SQLException,
                                   IOException
Updates the author information for all the members in the project

Parameters:
api -
Throws:
SQLException
IOException

updateChecksum

public void updateChecksum(Hashtable<String,String> checksumHash)
                    throws SQLException,
                           IOException
Updates the underlying Integrity SCM Project table cache with the new checksum information

Parameters:
checksumHash - Checksum hashtable generated from a checkout operation
Throws:
SQLException
IOException

compareBaseline

public int compareBaseline(File baselineProjectDB,
                           APISession api)
                    throws SQLException,
                           IOException
Compares this version of the project to a previous/new version to determine what are the updates and what was deleted

Parameters:
baselineProjectDB - The previous baseline (build) for this Integrity CM Project
api - The current Integrity API Session to obtain the author information
return - The total number of changes found in the comparison
Throws:
SQLException
IOException

viewProject

public List<Hashtable<CM_PROJECT,Object>> viewProject()
                                               throws SQLException,
                                                      IOException
Project access function that returns the state of the current project NOTE: For maximum efficiency, this should be called only once and after the compareBasline() has been invoked!

Returns:
A List containing every member in this project, including any dropped artifacts
Throws:
SQLException
IOException

getChangeLog

public String getChangeLog(String version,
                           List<Hashtable<CM_PROJECT,Object>> projectMembersList)
                    throws DOMException
Returns the Change Log based on the project baseline comparison This assumes that compareBaseline() has been called already

Returns:
Throws:
DOMException

checkpoint

public com.mks.api.response.Response checkpoint(APISession api,
                                                String chkptLabel)
                                         throws com.mks.api.response.APIException
Performs a checkpoint on this Integrity CM Project

Parameters:
api - Authenticated Integrity API Session
chkptLabel - Checkpoint label string
Returns:
Integrity API Response object
Throws:
com.mks.api.response.APIException

addProjectLabel

public com.mks.api.response.Response addProjectLabel(APISession api,
                                                     String chkptLabel)
                                              throws com.mks.api.response.APIException
Applies a Project Label on this Integrity CM Project

Parameters:
api - Authenticated Integrity API Session
chkptLabel - Checkpoint label string
Returns:
Integrity API Response object
Throws:
com.mks.api.response.APIException

getDirList

public List<String> getDirList()
                        throws SQLException,
                               IOException
Returns a string list of relative paths to all directories in this project

Returns:
Throws:
SQLException
IOException

getProjectName

public String getProjectName()
Returns the project path for this Integrity CM Project

Returns:

getProjectRevision

public String getProjectRevision()
Returns the project revision for this Integrity SCM Project

Returns:

isNormal

public boolean isNormal()
Returns true is this is a Normal Project

Returns:

isVariant

public boolean isVariant()
Returns true if this is a Variant Project

Returns:

isBuild

public boolean isBuild()
Returns true if this is a Build Project

Returns:

getConfigurationPath

public String getConfigurationPath()
Returns the Full Configuration Path for this Integrity CM Project

Returns:

getLastCheckpointDate

public Date getLastCheckpointDate()
Returns the date when the last checkpoint was performed on this Project

Returns:


Copyright © 2004-2012 Hudson. All Rights Reserved.