Package com.atlassian.bamboo.v2.build
Interface CurrentlyBuilding
- All Superinterfaces:
BambooCustomDataAware,ExecutionStatus
- All Known Implementing Classes:
CurrentlyBuildingImpl
This object encapsulates the
BuildContext that'd being built and the BuildAgent id it's related to-
Method Summary
Modifier and TypeMethodDescriptionbooleanAttempt to stop finishing the build in case of database issues.@Nullable AgentTypeThe current build agent type iff the build is current building on an agent.@Nullable LongThe current build agent id iff the build is current building on an agent.@Nullable BuildCancelledDetails@Nullable BuildHungDetailsDetails about the build if it hung.@Nullable BuildQueueTimeoutDetailsDetails about the build if queue timeout was detected.Container for custom data@NotNull DateTheDatewhen the build was originally queued@Nullable DateThe timeDatewhen updating / checking out source repository beganbooleanIs the build queued?booleanWas it registered as building on agent, but agent requested another job since?booleanvoidsetAgentType(@Nullable AgentType agentType) Sets the agent typevoidsetBuildAgentId(@Nullable Long agentId) Sets the fact that the build will now be building on an agentvoidsetBuildCancelledDetails(@Nullable BuildCancelledDetails buildCancelledDetails) voidsetBuildHangDetails(@Nullable BuildHungDetails buildHungDetails) Set the details if the build was detected to be hung.voidsetBuildQueueTimeoutDetails(BuildQueueTimeoutDetails buildQueueTimeoutDetails) Sets build queue timeout detailsvoidsetStartTime(long timestamp) Sets the start timestamp of the build.voidsetStopTime(long timestamp) Sets the stop timestamp of the build.voidsetVcsUpdateTime(@NotNull Date vcsUpdateTime) booleanAttempt to mark this object for operation requiring exclusive access: i.e. finishing build.Methods inherited from interface com.atlassian.bamboo.core.BambooCustomDataAware
updateCustomDataEntryMethods inherited from interface com.atlassian.bamboo.plan.ExecutionStatus
getAverageDuration, getBuildChanges, getBuildIdentifier, getElapsedTime, getProgressBar, getStartTime, getTriggerReason
-
Method Details
-
getBuildAgentId
The current build agent id iff the build is current building on an agent. This will be null if the build has not been picked up by an agent or the agent handed off the build to the server- Returns:
- agent's id
-
getAgentType
The current build agent type iff the build is current building on an agent. This will be null if the build has not been picked up by an agent or the agent handed off the build to the server- Returns:
- agent's type
- Since:
- 9.3
-
getCustomData
Container for custom data- Returns:
- map of key-value pairs
- Since:
- 9.3
-
isCurrentlyQueuedOnly
boolean isCurrentlyQueuedOnly()Is the build queued?- Returns:
-
isDetachedFromAgent
boolean isDetachedFromAgent()Was it registered as building on agent, but agent requested another job since? -
isUpdatingVcs
boolean isUpdatingVcs() -
getQueueTime
TheDatewhen the build was originally queued- Specified by:
getQueueTimein interfaceExecutionStatus- Returns:
-
getVcsUpdateTime
The timeDatewhen updating / checking out source repository began- Returns:
-
getBuildHangDetails
Details about the build if it hung. Will be null if build was fine.- Returns:
-
getBuildCancelledDetails
-
getBuildQueueTimeoutDetails
Details about the build if queue timeout was detected.- Returns:
-
setBuildAgentId
Sets the fact that the build will now be building on an agent- Parameters:
agentId- agent's id
-
setAgentType
Sets the agent type- Parameters:
agentType- agent's type- Since:
- 9.3
-
setBuildCancelledDetails
-
setBuildHangDetails
Set the details if the build was detected to be hung.- Parameters:
buildHungDetails-
-
setBuildQueueTimeoutDetails
Sets build queue timeout details- Parameters:
buildQueueTimeoutDetails-
-
setVcsUpdateTime
-
setStartTime
void setStartTime(long timestamp) Sets the start timestamp of the build. If there was the time already defined, it will not be overwritten and the passed value will be discarded.- Since:
- 9.4
-
setStopTime
void setStopTime(long timestamp) Sets the stop timestamp of the build. If there was the time already defined, it will not be overwritten and the passed value will be discarded.- Since:
- 9.4
-
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
-
abortFinishing
boolean abortFinishing()Attempt to stop finishing the build in case of database issues.- Returns:
- true if there was an attempt to finish the build.
-