Package com.atlassian.bamboo.v2.build
Class CurrentlyBuildingImpl
java.lang.Object
com.atlassian.bamboo.v2.build.CurrentlyBuildingImpl
- All Implemented Interfaces:
BambooCustomDataAware
,ExecutionStatus
,CurrentlyBuilding
-
Constructor Summary
ConstructorDescriptionCurrentlyBuildingImpl
(BuildIdentifier buildIdentifier, BuildChanges buildChanges, TriggerReason triggerReason, Long averageDuration) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Attempt to stop finishing the build in case of database issues.boolean
@Nullable AgentType
The current build agent type iff the build is current building on an agent.long
Estimated total execution time of a task.@Nullable Long
The current build agent id iff the build is current building on an agent.@Nullable BuildCancelledDetails
@NotNull BuildChanges
Changes associated with current build@Nullable BuildHungDetails
Details about the build if it hung.@NotNull BuildIdentifier
The ID of the buildDetails about the build if queue timeout was detected.Container for custom datalong
How long the task has taken up to now.@NotNull PlanResultKey
@NotNull ProgressBar
Because of XStream deserialization we need to lazy initialize buildProgressBar in getter@NotNull Date
TheDate
when the build was originally queued@Nullable Date
When was the execution started.@NotNull TriggerReason
The trigger reason of the current build@Nullable Date
The timeDate
when updating / checking out source repository beganint
hashCode()
boolean
Is the build queued?boolean
Was it registered as building on agent, but agent requested another job since?boolean
void
setAgentType
(@Nullable AgentType agentType) Sets the agent typevoid
setBuildAgentId
(@Nullable Long buildAgentId) 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) boolean
Attempt to mark this object for operation requiring exclusive access: i.e.void
updateCustomDataEntry
(@NotNull String key, @NotNull String value) Add or modify key value pair to Object's custom data map.
-
Constructor Details
-
CurrentlyBuildingImpl
public CurrentlyBuildingImpl(BuildIdentifier buildIdentifier, BuildChanges buildChanges, TriggerReason triggerReason, Long averageDuration)
-
-
Method Details
-
getPlanResultKey
-
getBuildIdentifier
Description copied from interface:ExecutionStatus
The ID of the build- Specified by:
getBuildIdentifier
in interfaceExecutionStatus
- Returns:
- buildIdentifier
-
getBuildChanges
Description copied from interface:ExecutionStatus
Changes associated with current build- Specified by:
getBuildChanges
in interfaceExecutionStatus
- Returns:
- buildChanges
-
getTriggerReason
Description copied from interface:ExecutionStatus
The trigger reason of the current build- Specified by:
getTriggerReason
in interfaceExecutionStatus
- Returns:
- triggerReason
-
getProgressBar
Because of XStream deserialization we need to lazy initialize buildProgressBar in getter- Specified by:
getProgressBar
in interfaceExecutionStatus
- Returns:
- progressBar
-
getAverageDuration
public long getAverageDuration()Description copied from interface:ExecutionStatus
Estimated total execution time of a task.- Specified by:
getAverageDuration
in interfaceExecutionStatus
- Returns:
- long representing estimated execution time - in millis
-
tryToFinish
public boolean tryToFinish()Description copied from interface:CurrentlyBuilding
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.- Specified by:
tryToFinish
in interfaceCurrentlyBuilding
- Returns:
- true iff thread is free to request removal of this object
-
abortFinishing
public boolean abortFinishing()Description copied from interface:CurrentlyBuilding
Attempt to stop finishing the build in case of database issues.- Specified by:
abortFinishing
in interfaceCurrentlyBuilding
- Returns:
- true if there was an attempt to finish the build.
-
getBuildAgentId
Description copied from interface:CurrentlyBuilding
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- Specified by:
getBuildAgentId
in interfaceCurrentlyBuilding
- Returns:
- agent's id
-
setBuildAgentId
Description copied from interface:CurrentlyBuilding
Sets the fact that the build will now be building on an agent- Specified by:
setBuildAgentId
in interfaceCurrentlyBuilding
- Parameters:
buildAgentId
- agent's id
-
getAgentType
Description copied from interface:CurrentlyBuilding
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- Specified by:
getAgentType
in interfaceCurrentlyBuilding
- Returns:
- agent's type
-
getCustomData
Description copied from interface:CurrentlyBuilding
Container for custom data- Specified by:
getCustomData
in interfaceCurrentlyBuilding
- Returns:
- map of key-value pairs
-
updateCustomDataEntry
Description copied from interface:BambooCustomDataAware
Add or modify key value pair to Object's custom data map.- Specified by:
updateCustomDataEntry
in interfaceBambooCustomDataAware
- Parameters:
key
- key to addvalue
- value to add
-
setAgentType
Description copied from interface:CurrentlyBuilding
Sets the agent type- Specified by:
setAgentType
in interfaceCurrentlyBuilding
- Parameters:
agentType
- agent's type
-
isCurrentlyQueuedOnly
public boolean isCurrentlyQueuedOnly()Description copied from interface:CurrentlyBuilding
Is the build queued?- Specified by:
isCurrentlyQueuedOnly
in interfaceCurrentlyBuilding
- Returns:
-
isDetachedFromAgent
public boolean isDetachedFromAgent()Description copied from interface:CurrentlyBuilding
Was it registered as building on agent, but agent requested another job since?- Specified by:
isDetachedFromAgent
in interfaceCurrentlyBuilding
-
getStartTime
Description copied from interface:ExecutionStatus
When was the execution started.- Specified by:
getStartTime
in interfaceExecutionStatus
- Returns:
- Date - when the execution started
-
getQueueTime
Description copied from interface:CurrentlyBuilding
TheDate
when the build was originally queued- Specified by:
getQueueTime
in interfaceCurrentlyBuilding
- Specified by:
getQueueTime
in interfaceExecutionStatus
- Returns:
- Date - when the process was queued for execution
-
getVcsUpdateTime
Description copied from interface:CurrentlyBuilding
The timeDate
when updating / checking out source repository began- Specified by:
getVcsUpdateTime
in interfaceCurrentlyBuilding
- Returns:
-
setVcsUpdateTime
- Specified by:
setVcsUpdateTime
in interfaceCurrentlyBuilding
-
getElapsedTime
public long getElapsedTime()Description copied from interface:ExecutionStatus
How long the task has taken up to now.- Specified by:
getElapsedTime
in interfaceExecutionStatus
- Returns:
- long representing task's elapsed time - in millis
-
isUpdatingVcs
public boolean isUpdatingVcs()- Specified by:
isUpdatingVcs
in interfaceCurrentlyBuilding
-
setStartTime
public void setStartTime(long timestamp) Description copied from interface:CurrentlyBuilding
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.- Specified by:
setStartTime
in interfaceCurrentlyBuilding
-
setStopTime
public void setStopTime(long timestamp) Description copied from interface:CurrentlyBuilding
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.- Specified by:
setStopTime
in interfaceCurrentlyBuilding
-
getBuildHangDetails
Description copied from interface:CurrentlyBuilding
Details about the build if it hung. Will be null if build was fine.- Specified by:
getBuildHangDetails
in interfaceCurrentlyBuilding
- Returns:
-
setBuildHangDetails
Description copied from interface:CurrentlyBuilding
Set the details if the build was detected to be hung.- Specified by:
setBuildHangDetails
in interfaceCurrentlyBuilding
-
getBuildCancelledDetails
- Specified by:
getBuildCancelledDetails
in interfaceCurrentlyBuilding
-
setBuildCancelledDetails
public void setBuildCancelledDetails(@Nullable @Nullable BuildCancelledDetails buildCancelledDetails) - Specified by:
setBuildCancelledDetails
in interfaceCurrentlyBuilding
-
getBuildQueueTimeoutDetails
Description copied from interface:CurrentlyBuilding
Details about the build if queue timeout was detected.- Specified by:
getBuildQueueTimeoutDetails
in interfaceCurrentlyBuilding
- Returns:
-
setBuildQueueTimeoutDetails
Description copied from interface:CurrentlyBuilding
Sets build queue timeout details- Specified by:
setBuildQueueTimeoutDetails
in interfaceCurrentlyBuilding
-
hashCode
public int hashCode() -
equals
-