com.atlassian.bamboo.v2.build
Interface CurrentlyBuilding

All Superinterfaces:
ExecutionStatus
All Known Implementing Classes:
CurrentlyBuildingImpl

@ThreadSafe
public interface CurrentlyBuilding
extends ExecutionStatus

This object encapsulates the BuildContext that'd being built and the BuildAgent id it's related to


Nested Class Summary
static class CurrentlyBuilding.ExecutableInfo
          Executable information.
 
Method Summary
 java.lang.Long getBuildAgentId()
          The current build agent id iff the build is current building on an agent
 BuildCancelledDetails getBuildCancelledDetails()
           
 BuildHungDetails getBuildHangDetails()
          Details about the build if it hung.
 BuildQueueTimeoutDetails getBuildQueueTimeoutDetails()
          Details about the build if queue timeout was detected.
 java.lang.Long getBuildTime()
          Deprecated. use getElapsedTime()
 java.util.Collection<BuildAgent> getExecutableBuildAgents()
          Get the list of executable agents for this build.
 java.util.Collection<ElasticImageConfiguration> getExecutableElasticImages()
          Get the list of elastic images that can execute this plan.
 java.util.Date getQueueTime()
          The Date when the build was originally queued
 java.util.Date getVcsUpdateTime()
          The time Date when updating / checking out source repository began
 boolean hasExecutableAgents()
          Determine whether this plan currently has any agent that can run it.
 boolean isCurrentlyQueuedOnly()
          Is the build queued? Effectively checks if the getBuildAgentId() returns null
 boolean isExecutableAgentInfoInitialized()
           
 boolean isUpdatingVcs()
           
 void setBuildAgentId(java.lang.Long agentId)
          Sets the fact that the build will now be building on an agent
 void setBuildCancelledDetails(BuildCancelledDetails buildCancelledDetails)
           
 void setBuildHangDetails(BuildHungDetails buildHungDetails)
          Set the details if the build was detected to be hung.
 void setBuildQueueTimeoutDetails(BuildQueueTimeoutDetails buildQueueTimeoutDetails)
          Sets build queue timeout details
 void setExecutableInfo(CurrentlyBuilding.ExecutableInfo info)
          Set the information about the current agents and elastic images.
 void setVcsUpdateTime(java.util.Date vcsUpdateTime)
           
 void startTimer()
          Starts an internal timer to the currently running build
 void stopTimer()
          Stops the internal timer for the current running build
 boolean tryToFinish()
          Attempt to mark this object for operation requiring exclusive access: i.e.
 
Methods inherited from interface com.atlassian.bamboo.plan.ExecutionStatus
getAverageDuration, getBuildChanges, getBuildIdentifier, getElapsedTime, getProgressBar, getStartTime, getTriggerReason
 

Method Detail

getExecutableBuildAgents

@NotNull
java.util.Collection<BuildAgent> getExecutableBuildAgents()
Get the list of executable agents for this build. This mirrors the agent id's in the JMS message on the queue.

Returns:
- a list of BuildAgent which can execute this build.

getExecutableElasticImages

@NotNull
java.util.Collection<ElasticImageConfiguration> getExecutableElasticImages()
Get the list of elastic images that can execute this plan.

Returns:
collection of ElasticImageConfiguration which can execute this plan

hasExecutableAgents

boolean hasExecutableAgents()
Determine whether this plan currently has any agent that can run it.

Returns:
True if at least one agent: meets all of the plans requirements is enabled is active (i.e. online), otherwise False.

getBuildAgentId

@Nullable
java.lang.Long getBuildAgentId()
The current build agent id iff the build is current building on an agent

Returns:

isCurrentlyQueuedOnly

boolean isCurrentlyQueuedOnly()
Is the build queued? Effectively checks if the getBuildAgentId() returns null

Returns:

getBuildTime

@Deprecated
@NotNull
java.lang.Long getBuildTime()
Deprecated. use getElapsedTime()

How long has the build taken so far since checkout has finished? Method name should be getBuildDuration...

Returns:
Long representing build time - in millis. 0 if not started
Since:
2.7

isUpdatingVcs

boolean isUpdatingVcs()

getQueueTime

@NotNull
java.util.Date getQueueTime()
The Date when the build was originally queued

Returns:

getVcsUpdateTime

@Nullable
java.util.Date getVcsUpdateTime()
The time Date when updating / checking out source repository began

Returns:

getBuildHangDetails

@Nullable
BuildHungDetails getBuildHangDetails()
Details about the build if it hung. Will be null if build was fine.

Returns:

getBuildCancelledDetails

@Nullable
BuildCancelledDetails getBuildCancelledDetails()

getBuildQueueTimeoutDetails

@Nullable
BuildQueueTimeoutDetails getBuildQueueTimeoutDetails()
Details about the build if queue timeout was detected.

Returns:

isExecutableAgentInfoInitialized

boolean isExecutableAgentInfoInitialized()
Returns:
true if executable agent lists have been updated at least once since triggering of the build

setBuildAgentId

void setBuildAgentId(@NotNull
                     java.lang.Long agentId)
Sets the fact that the build will now be building on an agent

Parameters:
agentId -

setBuildCancelledDetails

void setBuildCancelledDetails(@Nullable
                              BuildCancelledDetails buildCancelledDetails)

setBuildHangDetails

void setBuildHangDetails(@Nullable
                         BuildHungDetails buildHungDetails)
Set the details if the build was detected to be hung.

Parameters:
buildHungDetails -

setBuildQueueTimeoutDetails

void setBuildQueueTimeoutDetails(BuildQueueTimeoutDetails buildQueueTimeoutDetails)
Sets build queue timeout details

Parameters:
buildQueueTimeoutDetails -

setVcsUpdateTime

void setVcsUpdateTime(@NotNull
                      java.util.Date vcsUpdateTime)

setExecutableInfo

void setExecutableInfo(CurrentlyBuilding.ExecutableInfo info)
Set the information about the current agents and elastic images.

Parameters:
info - to set.

startTimer

void startTimer()
Starts an internal timer to the currently running build


stopTimer

void stopTimer()
Stops the internal timer for the current running build


tryToFinish

boolean tryToFinish()
Attempt to mark this object for operation requiring exclusive access: i.e. finishing build. Return value indicates if current thread is the first to call this method.

Returns:
true iff thread is free to request removal of this object


Copyright © 2010 Atlassian. All Rights Reserved.