net.sourceforge.cruisecontrol.sourcecontrols
Class AllFusionHarvest

java.lang.Object
  extended bynet.sourceforge.cruisecontrol.sourcecontrols.AllFusionHarvest
All Implemented Interfaces:
java.io.Serializable, SourceControl

public class AllFusionHarvest
extends java.lang.Object
implements SourceControl

SourceControl for CA's AllFusion Harvest Change Manager

Author:
Nayan Hajratwala, Trinem Consulting Ltd
See Also:
Serialized Form

Nested Class Summary
 class AllFusionHarvest.MyLogStreamListener
          This class implements a Harvest log stream listener and takes messages from Harvest and gives them appropriate log levels in the Log4J stream for the AllFusionHarvest sourcecontrol.
 
Constructor Summary
AllFusionHarvest()
          Default contructor.
 
Method Summary
 java.util.List getModifications(java.util.Date lastBuild, java.util.Date now)
          Returns a List of Modifications detailing all the changes between the last build and the latest revision at the repository
 java.util.Map getProperties()
          Any properties that have been set in this sourcecontrol.
protected  boolean login()
          Internal method which connects to Harvest using the details provided.
protected  void logout()
          Internal method which disconnects from Harvest.
 void setBroker(java.lang.String broker)
          Sets the Harvest Broker for all calls to HSDK.
protected  void setEmailAddress(java.lang.String username, java.lang.String emailAddress)
          This is an accessor is only intended to be used for testing.
 void setPassword(java.lang.String password)
          Sets the Harvest password for all calls to HSDK.
 void setProject(java.lang.String project)
          Sets the Harvest project for all calls to HSDK.
 void setProperty(java.lang.String property)
          Sets the name of the property to set if a modification is detected.
 void setPropertyOnDelete(java.lang.String propertyOnDelete)
          Sets the name of the property to set if a file has been deleted.
 void setState(java.lang.String state)
          Sets the Harvest state for all calls to HSDK.
 void setUsername(java.lang.String username)
          Sets the Harvest username for all calls to HSDK.
protected  Modification transformJCaVersionContainerToModification(JCaContainerWrap versionList, int n)
          Transforms a set of version properties into a CruiseControl Modification object.
 void validate()
          Standard Bootstrapper validation method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AllFusionHarvest

public AllFusionHarvest()
Default contructor. Creates a new uninitialise Bootstrapper.

Method Detail

setBroker

public void setBroker(java.lang.String broker)
Sets the Harvest Broker for all calls to HSDK.

Parameters:
broker - Harvest Broker to use.

setUsername

public void setUsername(java.lang.String username)
Sets the Harvest username for all calls to HSDK.

Parameters:
username - Harvest username to use.

setPassword

public void setPassword(java.lang.String password)
Sets the Harvest password for all calls to HSDK.

Parameters:
password - Harvest password to use.

setProject

public void setProject(java.lang.String project)
Sets the Harvest project for all calls to HSDK.

Parameters:
project - Harvest project to use.

setState

public void setState(java.lang.String state)
Sets the Harvest state for all calls to HSDK.

Parameters:
state - Harvest state to use.

setProperty

public void setProperty(java.lang.String property)
Sets the name of the property to set if a modification is detected.

Parameters:
property - The name of the property.

setPropertyOnDelete

public void setPropertyOnDelete(java.lang.String propertyOnDelete)
Sets the name of the property to set if a file has been deleted.

Parameters:
propertyOnDelete - The name of the property.

getProperties

public java.util.Map getProperties()
Description copied from interface: SourceControl
Any properties that have been set in this sourcecontrol. Will be passed onto the Builder, which may then pass the properties to the underlying build implementation. For example, the Ant builder will define these properties so that the underlying Ant script can use them.

Specified by:
getProperties in interface SourceControl

validate

public void validate()
              throws CruiseControlException
Standard Bootstrapper validation method. Throws an exception if any of the required properties are not set.

Specified by:
validate in interface SourceControl
Throws:
CruiseControlException

getModifications

public java.util.List getModifications(java.util.Date lastBuild,
                                       java.util.Date now)
Returns a List of Modifications detailing all the changes between the last build and the latest revision at the repository

Specified by:
getModifications in interface SourceControl
Parameters:
lastBuild - last build time
now -
Returns:
maybe empty, never null.

transformJCaVersionContainerToModification

protected Modification transformJCaVersionContainerToModification(JCaContainerWrap versionList,
                                                                  int n)
Transforms a set of version properties into a CruiseControl Modification object.

Parameters:
versionList - a set of version information properties
n - the index of the property information to use
Returns:
a Modification object representing the change

login

protected boolean login()
Internal method which connects to Harvest using the details provided.


logout

protected void logout()
Internal method which disconnects from Harvest.


setEmailAddress

protected void setEmailAddress(java.lang.String username,
                               java.lang.String emailAddress)
This is an accessor is only intended to be used for testing. It inserts a dummy entry into the userEmailMapping table.

Parameters:
username - The name of the user who's email address is being set
emailAddress - The corresponding email address of that user