Package com.atlassian.bamboo.chains
Interface ChainState
-
@Internal public interface ChainStateIn memory representation of the runningChainstate
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidfinishStopping()Marks theChainas finished stopping.longgetAverageDuration()Average duration of theChainin milliseconds@NotNull BuildContextgetBuildContext()TheBuildContextof the currently executing chain@Nullable ChainBuildStategetChainBuildState(@NotNull PlanResultKey planResultKey)Gets the build state for the given buildResultKey@NotNull Collection<ChainBuildState>getChainBuildStates()Gets all theChainBuildStates for the currentChainState@Nullable StageStategetCurrentStage()Gets the currently executingStageStateintgetCurrentStageNumber()Returns the cardinal number of currently executed stage.longgetElapsedTime()Time taken to execute theChainin milliseconds@NotNull ExecutionContextgetExecutionContext()Stores contextual data for the currentChainState@Nullable MergeResultSummarygetMergeResult()@Nullable VcsWorkingCopygetMergeWorkingCopy()@NotNull StringgetName()Get Chain nameStageStategetNextStage()Get the next stagePlanExecutionConfig.PlanExecutionTypegetPlanExecutionType()How this chain was executed, i.e.@NotNull PlanResultKeygetPlanResultKey()PlanResultKeyfor the theChainexecution@Nullable StageStategetPreviousStage()Gets the currently executingStageState@NotNull DategetQueueTime()The queueDate@NotNull List<StageState>getStages()Get all stages for Chain@Nullable DategetStartDate()The startDatebooleanisBeingFinalised()Indicates that Bamboo has decided this chain is complete and is currently processing the results.booleanisCompleted()Checks if theChainhas been completedbooleanisContinuable()true if user will be able to manually continue the build after this execution endsbooleanisFailed()Checks if theChainhas failedbooleanisGoingToStopAtManualStage()true if the successfully finished chain is expected to stop at the (proceeding) manual stagebooleanisStopping()Checks if theChainis stoppingbooleanisStopRequested()Checks if theChainhas been requested to stop executingbooleanisSuccessful()Checks if theChainhas successfully completedvoidmarkAsBeingFinalised()Marks this chain as being finished and results being processed.voidmarkAsStopping()Marks theChainas stoppingStageStateproceedToNextStage(@NotNull com.google.common.collect.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 Detail
-
getName
@NotNull @NotNull String getName()
Get Chain name- Returns:
- name
-
getPlanResultKey
@NotNull @NotNull PlanResultKey getPlanResultKey()
PlanResultKeyfor the theChainexecution- Returns:
-
getStages
@NotNull @NotNull List<StageState> 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
@NotNull @NotNull Collection<ChainBuildState> getChainBuildStates()
Gets all theChainBuildStates for the currentChainState- Returns:
- buildStates
-
getPreviousStage
@Nullable @Nullable StageState getPreviousStage()
Gets the currently executingStageState- Returns:
- chainStageStage or null
-
getCurrentStage
@Nullable @Nullable StageState 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 com.google.common.collect.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
@NotNull @NotNull BuildContext getBuildContext()
TheBuildContextof the currently executing chain- Returns:
- buildContext
-
getExecutionContext
@NotNull @NotNull ExecutionContext getExecutionContext()
Stores contextual data for the currentChainState- Returns:
- executionContext
-
getAverageDuration
long getAverageDuration()
Average duration of theChainin milliseconds- Returns:
- averageDuration
-
setStartDate
boolean setStartDate(@NotNull @NotNull Date date)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
@NotNull PlanExecutionConfig.PlanExecutionType 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
@Nullable @Nullable MergeResultSummary getMergeResult()
-
setMergeResult
void setMergeResult(@NotNull @NotNull MergeResultSummary mergeResult)
-
updateVariableContextAndMergeResult
void updateVariableContextAndMergeResult(@NotNull @NotNull VariableContext variableContext, @Nullable @Nullable MergeResultContext mergeResultSummary)- Since:
- 9.0
-
updateVariableContext
void updateVariableContext(@NotNull @NotNull Map<String,VariableDefinitionContext> resultVariables)- Parameters:
resultVariables-- Since:
- 9.5
-
getMergeWorkingCopy
@Nullable @Nullable VcsWorkingCopy getMergeWorkingCopy()
- Since:
- 5.14
-
setMergeWorkingCopy
void setMergeWorkingCopy(VcsWorkingCopy workingCopy)
-
-