net.sourceforge.cruisecontrol
Interface LabelIncrementer

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
DefaultLabelIncrementer, EmptyLabelIncrementer, FormattedLabelIncrementer, P4ChangelistLabelIncrementer, PropertyFileLabelIncrementer

public interface LabelIncrementer
extends java.io.Serializable

This interface defines the method required to increment the label used in the MasterBuild process. This label is incorporated into the log filename when a successful build occurs.

Author:
alden almagro, Paul Julius

Method Summary
 java.lang.String getDefaultLabel()
          Called by Project when there is no previously serialized label.
 java.lang.String incrementLabel(java.lang.String oldLabel, org.jdom.Element buildLog)
          Increments the label when a successful build occurs.
 boolean isPreBuildIncrementer()
          Some implementations of LabelIncrementer, such as those involving dates, are better suited to being incremented before building rather than after building.
 boolean isValidLabel(java.lang.String label)
          Check the validity of a user-supplied label, making sure that it can be incremented successfully by the appropriate implementation of LabelIncrementer
 

Method Detail

incrementLabel

public java.lang.String incrementLabel(java.lang.String oldLabel,
                                       org.jdom.Element buildLog)
Increments the label when a successful build occurs. The oldLabel should be transformed and returned as the new label. The build log is also passed in so that some more complex label incrementing can be handled. For example, a label incrementer could find the ant target that was called and increment based on that information.

Parameters:
buildLog - JDOM Element representation of the build.
oldLabel - Label from previous successful build.
Returns:
Label to use for most recent successful build.

isPreBuildIncrementer

public boolean isPreBuildIncrementer()
Some implementations of LabelIncrementer, such as those involving dates, are better suited to being incremented before building rather than after building. This method determines whether to increment before building or after building.


isValidLabel

public boolean isValidLabel(java.lang.String label)
Check the validity of a user-supplied label, making sure that it can be incremented successfully by the appropriate implementation of LabelIncrementer

Parameters:
label - user-supplied label
Returns:
true if it is a valid label.

getDefaultLabel

public java.lang.String getDefaultLabel()
Called by Project when there is no previously serialized label.

Returns:
defaultLabel