net.sourceforge.cruisecontrol.sourcecontrols
Class Accurev

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

public class Accurev
extends java.lang.Object
implements SourceControl, AccurevInputParser

This class handles all Accurev aspects of determining the modifications since the last good build.

Author:
Jason Chown , Nicola Orru'
See Also:
Serialized Form

Constructor Summary
Accurev()
           
 
Method Summary
 java.util.List getModifications(java.util.Date lastBuild, java.util.Date now)
          Calls "accurev hist -s [stream] -t "[now] - [lastBuild]" or something like that ; )
 java.util.Map getProperties()
          Any properties that have been set in this sourcecontrol.
 boolean parseStream(java.io.InputStream input)
          Parse the output from Accurev.
 void setProperty(java.lang.String propertyName)
          Choose a property to be set if the project has modifications
 void setRunner(Runner runner)
           
 void setStream(java.lang.String stream)
          Sets the Accurev stream to search for changes
 void setVerbose(boolean verbose)
          Enables/disables verbose logging
 void validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Accurev

public Accurev()
Method Detail

setStream

public void setStream(java.lang.String stream)
Sets the Accurev stream to search for changes

Parameters:
stream - the name of the stream

setVerbose

public void setVerbose(boolean verbose)
Enables/disables verbose logging

Parameters:
verbose - set to true to enable verbose logging

setProperty

public void setProperty(java.lang.String propertyName)
Choose a property to be set if the project has modifications

Parameters:
propertyName - the name of the property

validate

public void validate()
              throws CruiseControlException
Specified by:
validate in interface SourceControl
Throws:
CruiseControlException

getModifications

public java.util.List getModifications(java.util.Date lastBuild,
                                       java.util.Date now)
Calls "accurev hist -s [stream] -t "[now] - [lastBuild]" or something like that ; )

Specified by:
getModifications in interface SourceControl
Parameters:
lastBuild - the date and time of the last successful build
now - the current date and time
Returns:
the List of all detected modifications

parseStream

public boolean parseStream(java.io.InputStream input)
                    throws java.io.IOException,
                           CruiseControlException
Parse the output from Accurev. These are lines of the form: transaction <id>; <verb>; YYYY/MM/DD hh:mm:ss ; user: <user> # <comment> \.\PathTo\FileChanged.cpp <version>

Where can be promote, chstream or purge. There can be multiple lines of comments and files.

Specified by:
parseStream in interface AccurevInputParser
Parameters:
input - the output of the "accurev hist" command run
Returns:
true at the end
Throws:
java.io.IOException
CruiseControlException - if fatal errors are found

setRunner

public void setRunner(Runner runner)

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