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 theBuildContext
that'd being built and theBuildAgent
id it's related to
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description boolean
abortFinishing()
Attempt to stop finishing the build in case of database issues.@Nullable AgentType
getAgentType()
The current build agent type iff the build is current building on an agent.@Nullable Long
getBuildAgentId()
The current build agent id iff the build is current building on an agent.@Nullable BuildCancelledDetails
getBuildCancelledDetails()
@Nullable BuildHungDetails
getBuildHangDetails()
Details about the build if it hung.@Nullable BuildQueueTimeoutDetails
getBuildQueueTimeoutDetails()
Details about the build if queue timeout was detected.default @NotNull Map<String,String>
getCustomData()
Container for custom data@NotNull Date
getQueueTime()
TheDate
when the build was originally queued@Nullable Date
getVcsUpdateTime()
The timeDate
when updating / checking out source repository beganboolean
isCurrentlyQueuedOnly()
Is the build queued?boolean
isDetachedFromAgent()
Was it registered as building on agent, but agent requested another job since?boolean
isUpdatingVcs()
void
setAgentType(@Nullable AgentType agentType)
Sets the agent typevoid
setBuildAgentId(@Nullable Long agentId)
Sets the fact that the build will now be building on an agentvoid
setBuildCancelledDetails(@Nullable BuildCancelledDetails buildCancelledDetails)
void
setBuildHangDetails(@Nullable BuildHungDetails buildHungDetails)
Set the details if the build was detected to be hung.void
setBuildQueueTimeoutDetails(BuildQueueTimeoutDetails buildQueueTimeoutDetails)
Sets build queue timeout detailsvoid
setStartTime(long timestamp)
Sets the start timestamp of the build.void
setStopTime(long timestamp)
Sets the stop timestamp of the build.void
setVcsUpdateTime(@NotNull Date vcsUpdateTime)
void
startTimer()
Deprecated.since 9.4 usesetStartTime(long)
void
stopTimer()
Deprecated.since 9.4 usesetStopTime(long)
boolean
tryToFinish()
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()
TheDate
when the build was originally queued- Specified by:
getQueueTime
in interfaceExecutionStatus
- Returns:
-
getVcsUpdateTime
@Nullable @Nullable Date getVcsUpdateTime()
The timeDate
when 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.
-
-