Package com.atlassian.bamboo.v2.build
Interface CurrentlyBuilding
-
- All Superinterfaces:
BambooCustomDataAware,ExecutionStatus
- All Known Implementing Classes:
CurrentlyBuildingImpl
@ThreadSafe public interface CurrentlyBuilding extends ExecutionStatus, BambooCustomDataAware
This object encapsulates theBuildContextthat'd being built and theBuildAgentid it's related to
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description booleanabortFinishing()Attempt to stop finishing the build in case of database issues.@Nullable AgentTypegetAgentType()The current build agent type iff the build is current building on an agent.@Nullable LonggetBuildAgentId()The current build agent id iff the build is current building on an agent.@Nullable BuildCancelledDetailsgetBuildCancelledDetails()@Nullable BuildHungDetailsgetBuildHangDetails()Details about the build if it hung.@Nullable BuildQueueTimeoutDetailsgetBuildQueueTimeoutDetails()Details about the build if queue timeout was detected.default @NotNull Map<String,String>getCustomData()Container for custom data@NotNull DategetQueueTime()TheDatewhen the build was originally queued@Nullable DategetVcsUpdateTime()The timeDatewhen updating / checking out source repository beganbooleanisCurrentlyQueuedOnly()Is the build queued?booleanisDetachedFromAgent()Was it registered as building on agent, but agent requested another job since?booleanisUpdatingVcs()voidsetAgentType(@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)voidstartTimer()Deprecated.since 9.4 usesetStartTime(long)voidstopTimer()Deprecated.since 9.4 usesetStopTime(long)booleantryToFinish()Attempt to mark this object for operation requiring exclusive access: i.e.-
Methods inherited from interface com.atlassian.bamboo.core.BambooCustomDataAware
updateCustomDataEntry
-
Methods inherited from interface com.atlassian.bamboo.plan.ExecutionStatus
getAverageDuration, getBuildChanges, getBuildIdentifier, getElapsedTime, getProgressBar, getStartTime, getTriggerReason
-
-
-
-
Method Detail
-
getBuildAgentId
@Nullable @Nullable Long 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
@Nullable @Nullable AgentType 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
@NotNull default @NotNull Map<String,String> 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
@NotNull @NotNull Date getQueueTime()
TheDatewhen the build was originally queued- Specified by:
getQueueTimein interfaceExecutionStatus- Returns:
-
getVcsUpdateTime
@Nullable @Nullable Date getVcsUpdateTime()
The timeDatewhen updating / checking out source repository began- Returns:
-
getBuildHangDetails
@Nullable @Nullable BuildHungDetails getBuildHangDetails()
Details about the build if it hung. Will be null if build was fine.- Returns:
-
getBuildCancelledDetails
@Nullable @Nullable BuildCancelledDetails getBuildCancelledDetails()
-
getBuildQueueTimeoutDetails
@Nullable @Nullable BuildQueueTimeoutDetails getBuildQueueTimeoutDetails()
Details about the build if queue timeout was detected.- Returns:
-
setBuildAgentId
void setBuildAgentId(@Nullable @Nullable Long agentId)Sets the fact that the build will now be building on an agent- Parameters:
agentId- agent's id
-
setAgentType
void setAgentType(@Nullable @Nullable AgentType agentType)Sets the agent type- Parameters:
agentType- agent's type- Since:
- 9.3
-
setBuildCancelledDetails
void setBuildCancelledDetails(@Nullable @Nullable BuildCancelledDetails buildCancelledDetails)
-
setBuildHangDetails
void setBuildHangDetails(@Nullable @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 @NotNull Date vcsUpdateTime)
-
startTimer
@Deprecated void startTimer()
Deprecated.since 9.4 usesetStartTime(long)Starts an internal timer to the currently running build
-
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
-
stopTimer
@Deprecated void stopTimer()
Deprecated.since 9.4 usesetStopTime(long)Stops the internal timer for the current running build
-
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.
-
-