Package com.atlassian.bamboo.chains
Interface ChainState
@Internal
public interface ChainState
In memory representation of the running
Chain
state-
Method Summary
Modifier and TypeMethodDescriptionvoid
Marks theChain
as finished stopping.long
Average duration of theChain
in milliseconds@NotNull BuildContext
TheBuildContext
of the currently executing chain@Nullable ChainBuildState
getChainBuildState
(@NotNull PlanResultKey planResultKey) Gets the build state for the given buildResultKey@NotNull Collection<ChainBuildState>
Gets all theChainBuildState
s for the currentChainState
@Nullable StageState
Gets the currently executingStageState
int
Returns the cardinal number of currently executed stage.long
Time taken to execute theChain
in milliseconds@NotNull ExecutionContext
Stores contextual data for the currentChainState
@Nullable MergeResultSummary
@Nullable VcsWorkingCopy
@NotNull String
getName()
Get Chain nameGet the next stageHow this chain was executed, i.e.@NotNull PlanResultKey
PlanResultKey
for the theChain
execution@Nullable StageState
Gets the currently executingStageState
@NotNull Date
The queueDate
@NotNull List<StageState>
Get all stages for Chain@Nullable Date
The startDate
boolean
Indicates that Bamboo has decided this chain is complete and is currently processing the results.boolean
Checks if theChain
has been completedboolean
true if user will be able to manually continue the build after this execution endsboolean
isFailed()
Checks if theChain
has failedboolean
true if the successfully finished chain is expected to stop at the (proceeding) manual stageboolean
Checks if theChain
is stoppingboolean
Checks if theChain
has been requested to stop executingboolean
Checks if theChain
has successfully completedvoid
Marks this chain as being finished and results being processed.void
Marks theChain
as 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.void
setMergeResult
(@NotNull MergeResultSummary mergeResult) void
setMergeWorkingCopy
(VcsWorkingCopy workingCopy) boolean
setStartDate
(@NotNull Date date) The first call sets the startDate
.void
updateVariableContext
(@NotNull Map<String, VariableDefinitionContext> resultVariables) void
updateVariableContextAndMergeResult
(@NotNull VariableContext variableContext, @Nullable MergeResultContext mergeResultSummary)
-
Method Details
-
getName
Get Chain name- Returns:
- name
-
getPlanResultKey
PlanResultKey
for the theChain
execution- 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 theChainBuildState
s 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 theChain
has been completed- Returns:
- completed
-
isSuccessful
boolean isSuccessful()Checks if theChain
has successfully completed- Returns:
- successful
-
isFailed
boolean isFailed()Checks if theChain
has failed- Returns:
- failed
-
isStopping
boolean isStopping()Checks if theChain
is stopping- Returns:
- stopping
-
isStopRequested
boolean isStopRequested()Checks if theChain
has been requested to stop executing- Returns:
- stopRequested
-
markAsStopping
void markAsStopping()Marks theChain
as stopping -
finishStopping
void finishStopping()Marks theChain
as 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
TheBuildContext
of the currently executing chain- Returns:
- buildContext
-
getExecutionContext
Stores contextual data for the currentChainState
- Returns:
- executionContext
-
getAverageDuration
long getAverageDuration()Average duration of theChain
in 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 theChain
in 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
-