|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.buildforge.services.client.dbo.Build
public final class Build
An object representing a build within the Build Forge system. A build
(also called a job) usually refers to a running instance of a project,
a completed instance of a project, purge
activity,
or project clobber
activity. The type of
job can be identified using its getProcess()
method.
These objects are not created explicitly by a user. Instead, they are
generated automatically by the Build Forge system when a new job is
requested using methods like fire(APIClientConnection, int)
,
fire(APIClientConnection, int, String, String, boolean)
,
purge()
, and Project.clobber()
.
Field Summary | |
---|---|
static java.lang.Class<Build> |
CLASS
|
Method Summary | |
---|---|
void |
cancel()
Requests cancellation of a running job. |
static java.util.List<Build> |
findAll(APIClientConnection conn)
Finds all jobs defined within the system to which the user has access. |
static java.util.List<Build> |
findArchived(APIClientConnection conn)
Finds all archived jobs. |
static java.util.List<Build> |
findBetween(APIClientConnection conn,
java.util.Date beginDate,
java.util.Date endDate)
Finds all jobs with a start time that is between the specified begin and end dates, and to which the user has access. |
static Build |
findById(APIClientConnection conn,
int buildId)
Finds the job with the specified ID. |
static Build |
findById(APIClientConnection conn,
int buildId,
boolean withEnvironment)
Finds the job with the specified ID. |
static java.util.List<Build> |
findByProjectId(APIClientConnection conn,
int projectId)
Finds all jobs for the project with the specified ID to which the user has access. |
static java.util.List<Build> |
findByState(APIClientConnection conn,
BuildDBO.State state)
Finds all jobs with the specified state that are defined within the system and to which the user has access. |
static java.util.List<Build> |
findCompleted(APIClientConnection conn)
Finds all completed jobs. |
static java.util.List<Build> |
findLocked(APIClientConnection conn)
Finds all locked jobs. |
static java.util.List<Build> |
findRunning(APIClientConnection conn)
Finds all running jobs. |
static java.util.List<Build> |
findWaiting(APIClientConnection conn)
Finds all waiting jobs. |
static Build |
fire(APIClientConnection conn,
int projectId)
Creates a new job with the specified project's default selector and build class and engaging any linked adapters. |
static Build |
fire(APIClientConnection conn,
int projectId,
java.lang.String selectorId,
java.lang.String buildClassName,
boolean runLink)
Deprecated. Use fire(APIClientConnection, int, String, String, boolean, Environment) instead |
static Build |
fire(APIClientConnection conn,
int projectId,
java.lang.String selectorId,
java.lang.String buildClassName,
boolean runLink,
java.util.List<EnvironmentEntry> adHocEnvironmentOverrides)
Fires a build with the specified project, overriding the project's default selector, build class, and adaptor linkage, and environment. |
static Build |
fire(APIClientConnection conn,
int projectId,
java.lang.String selectorId,
java.lang.String buildClassName,
boolean runLink,
java.util.List<EnvironmentEntry> adHocEnvironmentOverrides,
java.lang.String tagOverride,
int levelOverride)
Fires a build with the specified project, overriding the project's default selector, build class, adaptor linkage, environment, build tag, and access group (the user must have access to the overriding access group). |
java.lang.String |
getBuildClass()
Returns the descriptive name of the build class for this job. |
int |
getBuildId()
Returns the unique identifier for this job. |
boolean |
getCancellation()
Returns whether or not this job is marked to be cancelled. |
int |
getChainedBuildId()
Returns the identifier of the build chained from this one, if a pass or fail chain was set on this Build. |
int |
getDuration()
Returns the length of time that the build has taken thus far, in seconds. |
java.lang.String |
getEngineId()
Returns the unique ID of the Build Forge engine that it assigned to this build. |
java.lang.String |
getEnvText()
Returns the environment block of this build. |
int |
getFailChainId()
Returns the identifier of the Project that will be executed
in the event that this Build fails. |
int |
getFired()
Returns the time at which this job was created as a timestamp. |
java.lang.String |
getGeoId()
Returns the UUID of the geographic location at which this Build is slated to execute via GDD. |
int |
getJobId()
Returns the process ID of the job management process on the engine that is running it. |
int |
getLevel()
Returns the access group ID assigned to this build. |
int |
getPassChainId()
Returns the identifier of the Project that will be executed
in the event that this Build succeeds. |
BuildDBO.Process |
getProcess()
Returns the type of job that this object represents. |
BuildDBO.Result |
getResult()
Returns the result of this job. |
java.util.List<Result> |
getResults()
Retrieves the step results for this job. |
java.lang.String |
getSelectorId()
Returns the selector ID for this job. |
java.lang.String |
getStage()
Returns the current stage of the job. |
int |
getStartTime()
Returns the timestamp for when this job was picked up by an engine. |
BuildDBO.State |
getState()
Returns the current state of this job. |
java.lang.String |
getTag()
Returns the build tag for this job. |
int |
getTargetId()
Returns the target of this job. |
int |
getUserId()
Returns the user ID of the user that created this job. |
void |
lock()
Locks this job. |
Build |
purge()
Requests that this job and its associated results be purged from Build Forge. |
java.lang.String |
toString()
|
void |
unlock()
Unlocks this job. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Class<Build> CLASS
Method Detail |
---|
public static java.util.List<Build> findAll(APIClientConnection conn) throws java.io.IOException, ServiceException
access group
.
conn
- the API client connection to use for the request
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic static Build findById(APIClientConnection conn, int buildId) throws java.io.IOException, ServiceException
findById(APIClientConnection, int, boolean)
with
false specified for the last parameter.
conn
- as for findById(APIClientConnection, int, boolean)
buildId
- as for findById(APIClientConnection, int, boolean)
findById(APIClientConnection, int, boolean)
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic static Build findById(APIClientConnection conn, int buildId, boolean withEnvironment) throws java.io.IOException, ServiceException
conn
- the API client connection to use for the requestbuildId
- the ID of the job to findwithEnvironment
- true to request the environment block
of the job, or false for the default behavior, as
provided by findById(APIClientConnection, int)
.
access group
.
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic static java.util.List<Build> findByProjectId(APIClientConnection conn, int projectId) throws java.io.IOException, ServiceException
access group
.
conn
- the API client connection to use for the requestprojectId
- the ID of the project for which to find matching jobs,
which must be a project to which the user has access, as described
in the entry for Project.findAll(APIClientConnection)
.
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic static java.util.List<Build> findByState(APIClientConnection conn, BuildDBO.State state) throws java.io.IOException, ServiceException
conn
- the API client connection to use for the requeststate
- the build state
of interest
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic static java.util.List<Build> findBetween(APIClientConnection conn, java.util.Date beginDate, java.util.Date endDate) throws java.io.IOException, ServiceException
conn
- the API client connection to use for the requestbeginDate
- the Date from which to start collection of builds for the returned listendDate
- the Date which is to be the last Date of a build in the returned list
java.io.IOException
- if an I/O error occurs
ServiceException
- if the request failspublic static java.util.List<Build> findWaiting(APIClientConnection conn) throws java.io.IOException, ServiceException
findByState(APIClientConnection, BuildDBO.State)
with
WAITING
specified for the state.
java.io.IOException
ServiceException
public static java.util.List<Build> findRunning(APIClientConnection conn) throws java.io.IOException, ServiceException
findByState(APIClientConnection, BuildDBO.State)
with
RUNNING
specified for the state.
java.io.IOException
ServiceException
public static java.util.List<Build> findCompleted(APIClientConnection conn) throws java.io.IOException, ServiceException
findByState(APIClientConnection, BuildDBO.State)
with
COMPLETED
specified for the state.
java.io.IOException
ServiceException
public static java.util.List<Build> findLocked(APIClientConnection conn) throws java.io.IOException, ServiceException
findByState(APIClientConnection, BuildDBO.State)
with
LOCKED
specified for the state.
java.io.IOException
ServiceException
public static java.util.List<Build> findArchived(APIClientConnection conn) throws java.io.IOException, ServiceException
findByState(APIClientConnection, BuildDBO.State)
with
ARCHIVED
specified for the state.
java.io.IOException
ServiceException
public java.util.List<Result> getResults() throws java.io.IOException, ServiceException
ordinary job
java.io.IOException
ServiceException
public void unlock() throws java.io.IOException, ServiceException
ordinary jobs
that have
previously been locked
.
java.io.IOException
ServiceException
public void lock() throws java.io.IOException, ServiceException
ordinary jobs
that have
completed
.
java.io.IOException
ServiceException
public Build purge() throws java.io.IOException, ServiceException
job
that will do the
purge. The caller may poll for the existence of this purge job using
findById(APIClientConnection, int)
to check on its progress.
When the purge has completed, the original job will either be deleted
or moved to the ARCHIVED
state, as
determined by the purge type
of the
job's build class
.
java.io.IOException
ServiceException
public static Build fire(APIClientConnection conn, int projectId) throws java.io.IOException, ServiceException
fire(APIClientConnection, int, String, String, boolean)
,
instead.
conn
- the connection to use for issuing the requestprojectId
- the project ID of the project to build
java.io.IOException
ServiceException
public static Build fire(APIClientConnection conn, int projectId, java.lang.String selectorId, java.lang.String buildClassName, boolean runLink) throws java.io.IOException, ServiceException
java.io.IOException
ServiceException
public static Build fire(APIClientConnection conn, int projectId, java.lang.String selectorId, java.lang.String buildClassName, boolean runLink, java.util.List<EnvironmentEntry> adHocEnvironmentOverrides) throws java.io.IOException, ServiceException
conn
- the connection to use for issuing the requestprojectId
- The identifier of the project to be executedselectorId
- The identifier of the selector to be usedbuildClassName
- The name of the build class to be usedrunLink
- Whether or not to also engage any linked adaptorsadHocEnvironmentOverrides
- Any overriding environment values
java.io.IOException
ServiceException
public static Build fire(APIClientConnection conn, int projectId, java.lang.String selectorId, java.lang.String buildClassName, boolean runLink, java.util.List<EnvironmentEntry> adHocEnvironmentOverrides, java.lang.String tagOverride, int levelOverride) throws java.io.IOException, ServiceException
conn
- the connection to use for issuing the requestprojectId
- The identifier of the project to be executedselectorId
- The identifier of the selector to be usedbuildClassName
- The name of the build class to be usedrunLink
- Whether or not to also engage any linked adaptorsadHocEnvironmentOverrides
- Any overriding environment valuestagOverride
- A static tag
java.io.IOException
ServiceException
public void cancel() throws java.io.IOException, ServiceException
RUNNING
or
WAITING
state
.
java.io.IOException
ServiceException
public java.lang.String getBuildClass()
build class
is to control the
purging behavior for a job.
public int getBuildId()
public boolean getCancellation()
COMPLETED
, then this indicates
whether or not the job was cancelled.
public int getChainedBuildId()
public int getDuration()
public java.lang.String getEngineId()
public java.lang.String getEnvText()
public int getFailChainId()
Project
that will be executed
in the event that this Build
fails.
Project
that will be executed
in the event that this Build
fails.public int getFired()
Timestamps are stored as the number of seconds elapsed since midnight on January 1, 1970, UTC.
public java.lang.String getGeoId()
public int getJobId()
public int getLevel()
public int getPassChainId()
Project
that will be executed
in the event that this Build
succeeds.
Project
that will be executed
in the event that this Build
succeeds.public BuildDBO.Process getProcess()
entry
.
public BuildDBO.Result getResult()
entry
.
public java.lang.String getSelectorId()
Selectors
are used to determine which server
to use for running
a particular step
. Steps may specify their own selector,
but those that do not specify a selector default to using the
selector that is specified in the build record. Special jobs
(purges
and
clobbers
) do not require a selector,
as they do not run any steps, but normal jobs must specify a default
selector.
public java.lang.String getStage()
public int getStartTime()
getFired()
timestamp.
Timestamps are stored as the number of seconds elapsed since midnight on January 1, 1970, UTC.
public BuildDBO.State getState()
entry
.
public java.lang.String getTag()
public int getTargetId()
project ID
of the project for which
this job was created. This applies to all jobs except
purges
, for which this returns
the build ID
that is to be purged by
this job.
public int getUserId()
scheduler entry
, then the user ID
is set to the owner
of the scheduler entry.
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |