Package com.atlassian.bamboo.chains
Interface ChainState
@Internal
public interface ChainState
In memory representation of the running
Chain state-
Method Summary
Modifier and TypeMethodDescriptionvoidMarks theChainas finished stopping.longAverage duration of theChainin milliseconds@NotNull BuildContextTheBuildContextof the currently executing chain@Nullable ChainBuildStategetChainBuildState(@NotNull PlanResultKey planResultKey) Gets the build state for the given buildResultKey@NotNull Collection<ChainBuildState> Gets all theChainBuildStates for the currentChainState@Nullable StageStateGets the currently executingStageStateintReturns the cardinal number of currently executed stage.longTime taken to execute theChainin milliseconds@NotNull ExecutionContextStores contextual data for the currentChainState@Nullable MergeResultSummary@Nullable VcsWorkingCopy@NotNull StringgetName()Get Chain nameGet the next stageHow this chain was executed, i.e. regularly, manually, etc.@NotNull PlanResultKeyPlanResultKeyfor the theChainexecution@Nullable StageStateGets the currently executingStageState@NotNull DateThe queueDate@NotNull List<StageState> Get all stages for Chain@Nullable DateThe startDatebooleanIndicates that Bamboo has decided this chain is complete and is currently processing the results.booleanChecks if theChainhas been completedbooleantrue if user will be able to manually continue the build after this execution endsbooleanisFailed()Checks if theChainhas failedbooleantrue if the successfully finished chain is expected to stop at the (proceeding) manual stagebooleanChecks if theChainis stoppingbooleanChecks if theChainhas been requested to stop executingbooleanChecks if theChainhas successfully completedvoidMarks this chain as being finished and results being processed.voidMarks theChainas stoppingproceedToNextStage(@NotNull Multimap<String, Artifact> publishedChainArtifacts, boolean lastExecutedStageSuccessful) Replaces the current stage with the next stage in the queue and changes the reference to the current stage to the previous.voidsetMergeResult(@NotNull MergeResultSummary mergeResult) voidsetMergeWorkingCopy(VcsWorkingCopy workingCopy) booleansetStartDate(@NotNull Date date) The first call sets the startDate.voidupdateVariableContext(@NotNull Map<String, VariableDefinitionContext> resultVariables) voidupdateVariableContextAndMergeResult(@NotNull VariableContext variableContext, @Nullable MergeResultContext mergeResultSummary)
-
Method Details
-
getName
Get Chain name- Returns:
- name
-
getPlanResultKey
PlanResultKeyfor the theChainexecution- Returns:
-
getStages
Get all stages for Chain- Returns:
- stages
-
getChainBuildState
@Nullable @Nullable ChainBuildState getChainBuildState(@NotNull @NotNull PlanResultKey planResultKey) Gets the build state for the given buildResultKey- Parameters:
planResultKey-- Returns:
- buildState
-
getChainBuildStates
Gets all theChainBuildStates for the currentChainState- Returns:
- buildStates
-
getPreviousStage
Gets the currently executingStageState- Returns:
- chainStageStage or null
-
getCurrentStage
Gets the currently executingStageState- Returns:
- chainStageStage or null
-
getCurrentStageNumber
int getCurrentStageNumber()Returns the cardinal number of currently executed stage.- Returns:
- int
-
getNextStage
StageState getNextStage()Get the next stage- Returns:
- stage
-
proceedToNextStage
StageState proceedToNextStage(@NotNull @NotNull Multimap<String, Artifact> publishedChainArtifacts, boolean lastExecutedStageSuccessful) Replaces the current stage with the next stage in the queue and changes the reference to the current stage to the previous.- Returns:
- currentStage
-
isCompleted
boolean isCompleted()Checks if theChainhas been completed- Returns:
- completed
-
isSuccessful
boolean isSuccessful()Checks if theChainhas successfully completed- Returns:
- successful
-
isFailed
boolean isFailed()Checks if theChainhas failed- Returns:
- failed
-
isStopping
boolean isStopping()Checks if theChainis stopping- Returns:
- stopping
-
isStopRequested
boolean isStopRequested()Checks if theChainhas been requested to stop executing- Returns:
- stopRequested
-
markAsStopping
void markAsStopping()Marks theChainas stopping -
finishStopping
void finishStopping()Marks theChainas finished stopping. -
isBeingFinalised
boolean isBeingFinalised()Indicates that Bamboo has decided this chain is complete and is currently processing the results.- Since:
- 9.4
-
markAsBeingFinalised
void markAsBeingFinalised()Marks this chain as being finished and results being processed.- Since:
- 9.4
-
getBuildContext
TheBuildContextof the currently executing chain- Returns:
- buildContext
-
getExecutionContext
Stores contextual data for the currentChainState- Returns:
- executionContext
-
getAverageDuration
long getAverageDuration()Average duration of theChainin milliseconds- Returns:
- averageDuration
-
getStartDate
The startDate- Returns:
- startDate
-
getQueueTime
The queueDate- Returns:
- queue time
-
setStartDate
The first call sets the startDate. Subsequent calls have no effect.- Parameters:
date-- Returns:
- true if date has been set, false if has been set before
-
getElapsedTime
long getElapsedTime()Time taken to execute theChainin milliseconds- Returns:
- executionTime
-
getPlanExecutionType
How this chain was executed, i.e. regularly, manually, etc.- Returns:
- executionType
-
isGoingToStopAtManualStage
boolean isGoingToStopAtManualStage()true if the successfully finished chain is expected to stop at the (proceeding) manual stage- Returns:
-
isContinuable
boolean isContinuable()true if user will be able to manually continue the build after this execution ends -
getMergeResult
-
setMergeResult
-
updateVariableContextAndMergeResult
void updateVariableContextAndMergeResult(@NotNull @NotNull VariableContext variableContext, @Nullable @Nullable MergeResultContext mergeResultSummary) - Since:
- 9.0
-
updateVariableContext
- Parameters:
resultVariables-- Since:
- 9.5
-
getMergeWorkingCopy
- Since:
- 5.14
-
setMergeWorkingCopy
-