com.buildforge.services.client.dbo
Class Cron

java.lang.Object
  extended by com.buildforge.services.client.dbo.Cron

public final class Cron
extends java.lang.Object


Field Summary
static java.lang.Class<Cron> CLASS
           
 
Constructor Summary
Cron(APIClientConnection conn)
           
 
Method Summary
 void activate()
          Acticates this Cron object.
 void activate(CronDBO.Active active)
          Sets the activation state of this Cron object to an explicit value of the allowed enumeration of activation values.
 Cron create()
          Creates this Cron object in the database
 void deactivate()
          Deactivates this Cron object.
 void delete()
          Removes this Cron object from the database
static void deleteById(APIClientConnection conn, int cronId)
          Removes the specified Cron object from the database
static java.util.List<Cron> findAll(APIClientConnection conn)
          Returns a List of all Cron objects in the database
static Cron findById(APIClientConnection conn, int cronId)
          Retrieves a specific Cron object by identifier
 CronDBO.Active getActive()
          Returns the activation state for this Cron object
 java.lang.String getBuildClass()
          Returns the name of the class to use when running this scheduled build.
 int getCronId()
          Returns the unique identifier for this Cron object.
 java.lang.String getDayOfMonth()
          Returns the days of the month on which the build should run.
 java.lang.String getDayOfWeek()
          Returns the days of the week on which the build should run.
 java.lang.String getDescription()
          Returns the user-supplied description for the Cron object.
 int getEnvGroupId()
           
 int getEnvironmentGroupId()
          Returns the environment group id of the environment used when kicking off this scheduled build.
 java.lang.String getEnvironmentText()
          Returns the text of the environment store
 java.lang.String getEnvText()
           
 int getFired()
          Returns a timestamp of the last time this Cron was executed.
 java.lang.String getHour()
          Returns the hours (according to a 24 hour clock) during which the build should run.
 java.lang.String getMinute()
          Returns the number of minutes past the hour at which the build should run.
 java.lang.String getMonth()
          Returns the months during which the build should run.
 int getNextRun()
          Returns the timestamp (seconds since epoch) of the next time at which the scheduler entry is expected to be run.
 long getNextRunInMillis()
          Returns the timestamp (seconds since epoch) normally returned by getNextRun() adjusted for long length by multiplying by 1000.
 int getOwnerId()
          Returns the user id of the user that created this scheduler entry.
 int getProjectId()
          Returns the project id of the project to be run by this sceduler entry.
 java.lang.String getSelectorId()
          Returns the identifier of the Selector used to determine server to run this scheduled job
 void oneShot()
          Activates this Cron object for the next evaluation.
 void setActive(CronDBO.Active active)
          Sets the activation state for this Cron object
 void setBuildClass(java.lang.String buildClass)
          Sets the name of the class to use when running this scheduled build.
 void setDayOfMonth(java.lang.String dayOfMonth)
          Sets the days of the month on which the build should run.
 void setDayOfWeek(java.lang.String dayOfWeek)
          Sets the days of the week on which the build should run.
 void setDescription(java.lang.String description)
          Sets the user-supplied description for the Cron object.
 void setEnvGroupId(int groupId)
           
 void setEnvironmentGroupId(int environmentGroupId)
          Sets the environment group id of the environment used when kicking off this scheduled build.
 void setEnvironmentText(java.lang.String envText)
          Sets the text of the environment store
 void setEnvText(java.lang.String envText)
           
 void setHour(java.lang.String hour)
          Sets the hours (according to a 24 hour clock) during which the build should run.
 void setMinute(java.lang.String minute)
          Sets the number of minutes past the hour at which the build should run.
 void setMonth(java.lang.String month)
          Sets the months during which the build should run.
 void setProjectId(int projectId)
          Sets the project id of the project to be run by this sceduler entry.
 void setSelectorId(java.lang.String selectorId)
          Sets the identifier of the Selector used to determine server to run this scheduled job.
 java.lang.String toString()
           
 Cron update()
          Commits the values in this Cron object to the database
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS

public static final java.lang.Class<Cron> CLASS
Constructor Detail

Cron

public Cron(APIClientConnection conn)
Method Detail

findAll

public static java.util.List<Cron> findAll(APIClientConnection conn)
                                    throws java.io.IOException,
                                           ServiceException
Returns a List of all Cron objects in the database

Parameters:
conn -
Returns:
Throws:
java.io.IOException
ServiceException

findById

public static Cron findById(APIClientConnection conn,
                            int cronId)
                     throws java.io.IOException,
                            ServiceException
Retrieves a specific Cron object by identifier

Parameters:
conn -
cronId - The identifier of the Cron object to retrieve
Returns:
The located Cron object or null if not found
Throws:
java.io.IOException
ServiceException

deactivate

public void deactivate()
                throws java.io.IOException,
                       ServiceException
Deactivates this Cron object. It will no longer be considered for execution.

Throws:
java.io.IOException
ServiceException

activate

public void activate()
              throws java.io.IOException,
                     ServiceException
Acticates this Cron object. It will be considered for execution on the next evaluation.

Throws:
java.io.IOException
ServiceException

oneShot

public void oneShot()
             throws java.io.IOException,
                    ServiceException
Activates this Cron object for the next evaluation. This Cron object will run once and then no longer be considered for execution in subsequent evaluations.

Throws:
java.io.IOException
ServiceException

activate

public void activate(CronDBO.Active active)
              throws java.io.IOException,
                     ServiceException
Sets the activation state of this Cron object to an explicit value of the allowed enumeration of activation values.

Parameters:
active -
Throws:
java.io.IOException
ServiceException

create

public Cron create()
            throws java.io.IOException,
                   ServiceException
Creates this Cron object in the database

Returns:
Throws:
java.io.IOException
ServiceException

update

public Cron update()
            throws java.io.IOException,
                   ServiceException
Commits the values in this Cron object to the database

Returns:
Throws:
java.io.IOException
ServiceException

delete

public void delete()
            throws java.io.IOException,
                   ServiceException
Removes this Cron object from the database

Throws:
java.io.IOException
ServiceException

deleteById

public static void deleteById(APIClientConnection conn,
                              int cronId)
                       throws java.io.IOException,
                              ServiceException
Removes the specified Cron object from the database

Parameters:
conn -
cronId - The identifier of the Cron object to remove
Throws:
java.io.IOException
ServiceException

getActive

public CronDBO.Active getActive()
Returns the activation state for this Cron object


getBuildClass

public java.lang.String getBuildClass()
Returns the name of the class to use when running this scheduled build. If this is blank, then the project's default class is used.


getCronId

public int getCronId()
Returns the unique identifier for this Cron object.


getDayOfMonth

public java.lang.String getDayOfMonth()
Returns the days of the month on which the build should run.


getDayOfWeek

public java.lang.String getDayOfWeek()
Returns the days of the week on which the build should run. The full range is 0 (Sunday) to 6 (Saturday).


getDescription

public java.lang.String getDescription()
Returns the user-supplied description for the Cron object.


getEnvironmentGroupId

public int getEnvironmentGroupId()
Returns the environment group id of the environment used when kicking off this scheduled build.


getEnvironmentText

public java.lang.String getEnvironmentText()
Returns the text of the environment store


getFired

public int getFired()
Returns a timestamp of the last time this Cron was executed.


getHour

public java.lang.String getHour()
Returns the hours (according to a 24 hour clock) during which the build should run. The full range is 0 to 23.


getMinute

public java.lang.String getMinute()
Returns the number of minutes past the hour at which the build should run. The full range is 0 to 59.


getMonth

public java.lang.String getMonth()
Returns the months during which the build should run. The full range is 1 to 12.


getNextRun

public int getNextRun()
Returns the timestamp (seconds since epoch) of the next time at which the scheduler entry is expected to be run. The following sentinel values are used:
ValueMeaning
0Not yet been calculated. This should be updated within 15 seconds if the scheduler is running.
-1An invalid value was specified for one or more of the cron fields, preventing the proper calculation of the next run time.
-2The cron fields specified will never be matched. For example, if #month is 4 and #dayOfMonth is 3


getNextRunInMillis

public long getNextRunInMillis()
Returns the timestamp (seconds since epoch) normally returned by getNextRun() adjusted for long length by multiplying by 1000. This is purely for the convenience of Date object creation and contains no additional resolution.


getOwnerId

public int getOwnerId()
Returns the user id of the user that created this scheduler entry.


getProjectId

public int getProjectId()
Returns the project id of the project to be run by this sceduler entry. If this is a class purge schedule, then the value will be 0.


getSelectorId

public java.lang.String getSelectorId()
Returns the identifier of the Selector used to determine server to run this scheduled job


setActive

public void setActive(CronDBO.Active active)
Sets the activation state for this Cron object

Parameters:
active -

setBuildClass

public void setBuildClass(java.lang.String buildClass)
Sets the name of the class to use when running this scheduled build. If this is blank, then the project's default class is used.

Parameters:
buildClass -

setDayOfMonth

public void setDayOfMonth(java.lang.String dayOfMonth)
Sets the days of the month on which the build should run. The full range is 0 to 31, although using dates in the 29-31 range has obvious disadvantages.

Parameters:
dayOfMonth -

setDayOfWeek

public void setDayOfWeek(java.lang.String dayOfWeek)
Sets the days of the week on which the build should run. The full range is 0 (Sunday) to 6 (Saturday).

Parameters:
dayOfWeek -

setDescription

public void setDescription(java.lang.String description)
Sets the user-supplied description for the Cron object.

Parameters:
description -

setEnvironmentGroupId

public void setEnvironmentGroupId(int environmentGroupId)
Sets the environment group id of the environment used when kicking off this scheduled build.

Parameters:
environmentGroupId -

setEnvironmentText

public void setEnvironmentText(java.lang.String envText)
Sets the text of the environment store

Parameters:
envText -

setHour

public void setHour(java.lang.String hour)
Sets the hours (according to a 24 hour clock) during which the build should run. The full range is 0 to 23.

Parameters:
hour -

setMinute

public void setMinute(java.lang.String minute)
Sets the number of minutes past the hour at which the build should run. The full range is 0 to 59.

Parameters:
minute -

setMonth

public void setMonth(java.lang.String month)
Sets the months during which the build should run. The full range is 1 to 12.

Parameters:
month -

setProjectId

public void setProjectId(int projectId)
Sets the project id of the project to be run by this sceduler entry. For a class purge schedule, set the value to 0.

Parameters:
projectId -

setSelectorId

public void setSelectorId(java.lang.String selectorId)
Sets the identifier of the Selector used to determine server to run this scheduled job.

Parameters:
selectorId -

getEnvGroupId

public int getEnvGroupId()

getEnvText

public java.lang.String getEnvText()

setEnvGroupId

public void setEnvGroupId(int groupId)

setEnvText

public void setEnvText(java.lang.String envText)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object