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
ConstructorsConstructorDescriptionCurrentlyBuildingImpl(BuildIdentifier buildIdentifier, BuildChanges buildChanges, TriggerReason triggerReason, Long averageDuration) -
Method Summary
Modifier and TypeMethodDescriptionbooleanAttempt to stop finishing the build in case of database issues.boolean@Nullable AgentTypeThe current build agent type iff the build is current building on an agent.longEstimated total execution time of a task.@Nullable LongThe current build agent id iff the build is current building on an agent.@Nullable BuildCancelledDetails@NotNull BuildChangesChanges associated with current build@Nullable BuildHungDetailsDetails about the build if it hung.@NotNull BuildIdentifierThe ID of the buildDetails about the build if queue timeout was detected.Container for custom datalongHow long the task has taken up to now.@NotNull PlanResultKey@NotNull ProgressBarBecause of XStream deserialization we need to lazy initialize buildProgressBar in getter@NotNull DateTheDatewhen the build was originally queued@Nullable DateWhen was the execution started.@NotNull TriggerReasonThe trigger reason of the current build@Nullable DateThe timeDatewhen updating / checking out source repository beganinthashCode()booleanIs 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 buildAgentId) 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.voidupdateCustomDataEntry(@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:ExecutionStatusThe ID of the build- Specified by:
getBuildIdentifierin interfaceExecutionStatus- Returns:
- buildIdentifier
-
getBuildChanges
Description copied from interface:ExecutionStatusChanges associated with current build- Specified by:
getBuildChangesin interfaceExecutionStatus- Returns:
- buildChanges
-
getTriggerReason
Description copied from interface:ExecutionStatusThe trigger reason of the current build- Specified by:
getTriggerReasonin interfaceExecutionStatus- Returns:
- triggerReason
-
getProgressBar
Because of XStream deserialization we need to lazy initialize buildProgressBar in getter- Specified by:
getProgressBarin interfaceExecutionStatus- Returns:
- progressBar
-
getAverageDuration
public long getAverageDuration()Description copied from interface:ExecutionStatusEstimated total execution time of a task.- Specified by:
getAverageDurationin interfaceExecutionStatus- Returns:
- long representing estimated execution time - in millis
-
tryToFinish
public boolean tryToFinish()Description copied from interface:CurrentlyBuildingAttempt 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:
tryToFinishin interfaceCurrentlyBuilding- Returns:
- true iff thread is free to request removal of this object
-
abortFinishing
public boolean abortFinishing()Description copied from interface:CurrentlyBuildingAttempt to stop finishing the build in case of database issues.- Specified by:
abortFinishingin interfaceCurrentlyBuilding- Returns:
- true if there was an attempt to finish the build.
-
getBuildAgentId
Description copied from interface:CurrentlyBuildingThe 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:
getBuildAgentIdin interfaceCurrentlyBuilding- Returns:
- agent's id
-
setBuildAgentId
Description copied from interface:CurrentlyBuildingSets the fact that the build will now be building on an agent- Specified by:
setBuildAgentIdin interfaceCurrentlyBuilding- Parameters:
buildAgentId- agent's id
-
getAgentType
Description copied from interface:CurrentlyBuildingThe 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:
getAgentTypein interfaceCurrentlyBuilding- Returns:
- agent's type
-
getCustomData
Description copied from interface:CurrentlyBuildingContainer for custom data- Specified by:
getCustomDatain interfaceCurrentlyBuilding- Returns:
- map of key-value pairs
-
updateCustomDataEntry
Description copied from interface:BambooCustomDataAwareAdd or modify key value pair to Object's custom data map.- Specified by:
updateCustomDataEntryin interfaceBambooCustomDataAware- Parameters:
key- key to addvalue- value to add
-
setAgentType
Description copied from interface:CurrentlyBuildingSets the agent type- Specified by:
setAgentTypein interfaceCurrentlyBuilding- Parameters:
agentType- agent's type
-
isCurrentlyQueuedOnly
public boolean isCurrentlyQueuedOnly()Description copied from interface:CurrentlyBuildingIs the build queued?- Specified by:
isCurrentlyQueuedOnlyin interfaceCurrentlyBuilding- Returns:
-
isDetachedFromAgent
public boolean isDetachedFromAgent()Description copied from interface:CurrentlyBuildingWas it registered as building on agent, but agent requested another job since?- Specified by:
isDetachedFromAgentin interfaceCurrentlyBuilding
-
getStartTime
Description copied from interface:ExecutionStatusWhen was the execution started.- Specified by:
getStartTimein interfaceExecutionStatus- Returns:
- Date - when the execution started
-
getQueueTime
Description copied from interface:CurrentlyBuildingTheDatewhen the build was originally queued- Specified by:
getQueueTimein interfaceCurrentlyBuilding- Specified by:
getQueueTimein interfaceExecutionStatus- Returns:
- Date - when the process was queued for execution
-
getVcsUpdateTime
Description copied from interface:CurrentlyBuildingThe timeDatewhen updating / checking out source repository began- Specified by:
getVcsUpdateTimein interfaceCurrentlyBuilding- Returns:
-
setVcsUpdateTime
- Specified by:
setVcsUpdateTimein interfaceCurrentlyBuilding
-
getElapsedTime
public long getElapsedTime()Description copied from interface:ExecutionStatusHow long the task has taken up to now.- Specified by:
getElapsedTimein interfaceExecutionStatus- Returns:
- long representing task's elapsed time - in millis
-
isUpdatingVcs
public boolean isUpdatingVcs()- Specified by:
isUpdatingVcsin interfaceCurrentlyBuilding
-
setStartTime
public void setStartTime(long timestamp) Description copied from interface:CurrentlyBuildingSets 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:
setStartTimein interfaceCurrentlyBuilding
-
setStopTime
public void setStopTime(long timestamp) Description copied from interface:CurrentlyBuildingSets 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:
setStopTimein interfaceCurrentlyBuilding
-
getBuildHangDetails
Description copied from interface:CurrentlyBuildingDetails about the build if it hung. Will be null if build was fine.- Specified by:
getBuildHangDetailsin interfaceCurrentlyBuilding- Returns:
-
setBuildHangDetails
Description copied from interface:CurrentlyBuildingSet the details if the build was detected to be hung.- Specified by:
setBuildHangDetailsin interfaceCurrentlyBuilding
-
getBuildCancelledDetails
- Specified by:
getBuildCancelledDetailsin interfaceCurrentlyBuilding
-
setBuildCancelledDetails
public void setBuildCancelledDetails(@Nullable @Nullable BuildCancelledDetails buildCancelledDetails) - Specified by:
setBuildCancelledDetailsin interfaceCurrentlyBuilding
-
getBuildQueueTimeoutDetails
Description copied from interface:CurrentlyBuildingDetails about the build if queue timeout was detected.- Specified by:
getBuildQueueTimeoutDetailsin interfaceCurrentlyBuilding- Returns:
-
setBuildQueueTimeoutDetails
Description copied from interface:CurrentlyBuildingSets build queue timeout details- Specified by:
setBuildQueueTimeoutDetailsin interfaceCurrentlyBuilding
-
hashCode
public int hashCode() -
equals
-