net.sourceforge.cruisecontrol.sourcecontrols
Class BuildStatus

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

public class BuildStatus
extends java.lang.Object
implements SourceControl

This class allows for starting builds based on the results of another build. It does this by examining the build's log files. Only successful builds count as modifications.

Author:
Garrick Olson
See Also:
Serialized Form

Field Summary
static java.lang.String MOST_RECENT_LOGDIR_KEY
          The location being checked for new log files.
static java.lang.String MOST_RECENT_LOGFILE_KEY
          The name of the newest logfile included in the modification set (e.g.
static java.lang.String MOST_RECENT_LOGLABEL_KEY
          The label of the newest build included in the modification set (e.g. "0.1").
static java.lang.String MOST_RECENT_LOGTIME_KEY
          The timestamp of the newest build included in the modification set (e.g. "20040120120000").
 
Constructor Summary
BuildStatus()
           
 
Method Summary
 java.util.List getModifications(java.util.Date lastBuild, java.util.Date unused)
          The modifications reported by this method will be the list of new log files created as the result of successful builds (the log files will include the build label).
 java.util.Map getProperties()
          This method is used to make certain attributes of the most recent modification available to Ant tasks.
 void setLogDir(java.lang.String logDir)
          Indicate where the build to be monitored places its output (log files).
 void setProperty(java.lang.String propertyName)
           
 void validate()
          Make sure any attributes provided by the user are correctly specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MOST_RECENT_LOGDIR_KEY

public static final java.lang.String MOST_RECENT_LOGDIR_KEY
The location being checked for new log files.

See Also:
Constant Field Values

MOST_RECENT_LOGFILE_KEY

public static final java.lang.String MOST_RECENT_LOGFILE_KEY
The name of the newest logfile included in the modification set (e.g. "log20040120120000L0.1.xml").

See Also:
Constant Field Values

MOST_RECENT_LOGTIME_KEY

public static final java.lang.String MOST_RECENT_LOGTIME_KEY
The timestamp of the newest build included in the modification set (e.g. "20040120120000").

See Also:
Constant Field Values

MOST_RECENT_LOGLABEL_KEY

public static final java.lang.String MOST_RECENT_LOGLABEL_KEY
The label of the newest build included in the modification set (e.g. "0.1").

See Also:
Constant Field Values
Constructor Detail

BuildStatus

public BuildStatus()
Method Detail

getProperties

public java.util.Map getProperties()
This method is used to make certain attributes of the most recent modification available to Ant tasks.

Specified by:
getProperties in interface SourceControl
Returns:
A Hashtable object containing no properties if there were no modifications, four properties if there were one or more modifications (keys are provided as constants on this class), or five is the property attribute was set. Never returns null.

setProperty

public void setProperty(java.lang.String propertyName)

setLogDir

public void setLogDir(java.lang.String logDir)
Indicate where the build to be monitored places its output (log files).

Parameters:
logDir - Absolute path to the log directory.

validate

public void validate()
              throws CruiseControlException
Make sure any attributes provided by the user are correctly specified.

Specified by:
validate in interface SourceControl
Throws:
CruiseControlException

getModifications

public java.util.List getModifications(java.util.Date lastBuild,
                                       java.util.Date unused)
The modifications reported by this method will be the list of new log files created as the result of successful builds (the log files will include the build label).

Specified by:
getModifications in interface SourceControl
Parameters:
lastBuild - Look for successful builds newer than this date (may not be null).
unused - The timestamp of the current build is passed here (as per SourceControl interface) but we don't use it.
Returns:
List of Modification objects