net.sourceforge.cruisecontrol
Class Schedule

java.lang.Object
  extended bynet.sourceforge.cruisecontrol.Schedule
All Implemented Interfaces:
java.io.Serializable

public class Schedule
extends java.lang.Object
implements java.io.Serializable

Handles scheduling different builds.

Author:
alden almagro, ThoughtWorks, Inc. 2001-2
See Also:
Serialized Form

Constructor Summary
Schedule()
           
 
Method Summary
 void add(Builder builder)
           
 void add(PauseBuilder pause)
           
 org.jdom.Element build(int buildNumber, java.util.Date lastBuild, java.util.Date now, java.util.Map properties, java.lang.String buildTarget)
          Select the correct Builder and start a build.
 java.util.List getBuilders()
           
 long getInterval()
           
 boolean isPaused(java.util.Date now)
          Determine if CruiseControl should run a build, given the current time.
protected  Builder selectBuilder(int buildNumber, java.util.Date lastBuild, java.util.Date now)
          Select the correct build based on the current buildNumber and time.
 void setInterval(long intervalBetweenModificationChecks)
           
 void validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Schedule

public Schedule()
Method Detail

add

public void add(Builder builder)

add

public void add(PauseBuilder pause)

isPaused

public boolean isPaused(java.util.Date now)
Determine if CruiseControl should run a build, given the current time.

Parameters:
now - The current date
Returns:
true if CruiseControl is currently paused (no build should run).

build

public org.jdom.Element build(int buildNumber,
                              java.util.Date lastBuild,
                              java.util.Date now,
                              java.util.Map properties,
                              java.lang.String buildTarget)
                       throws CruiseControlException
Select the correct Builder and start a build.

Parameters:
buildNumber - The sequential build number.
lastBuild - The date of the last build.
now - The current time.
properties - Properties that would need to be passed in to the actual build tool.
buildTarget - the build target to use instead of the configured one (pass in null if no override is needed)
Returns:
JDOM Element representation of build log.
Throws:
CruiseControlException

selectBuilder

protected Builder selectBuilder(int buildNumber,
                                java.util.Date lastBuild,
                                java.util.Date now)
                         throws CruiseControlException
Select the correct build based on the current buildNumber and time.

Parameters:
buildNumber - The sequential build number
lastBuild - The date of the last build.
now - The current time.
Returns:
The Builder that should be run.
Throws:
CruiseControlException

setInterval

public void setInterval(long intervalBetweenModificationChecks)

getInterval

public long getInterval()

validate

public void validate()
              throws CruiseControlException
Throws:
CruiseControlException

getBuilders

public java.util.List getBuilders()