Package com.atlassian.bamboo.chains
Interface ChainState
-
@Internal public interface ChainState
In memory representation of the runningChain
state
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
finishStopping()
Marks theChain
as finished stopping.long
getAverageDuration()
Average duration of theChain
in milliseconds@NotNull BuildContext
getBuildContext()
TheBuildContext
of the currently executing chain@Nullable ChainBuildState
getChainBuildState(@NotNull PlanResultKey planResultKey)
Gets the build state for the given buildResultKey@NotNull Collection<ChainBuildState>
getChainBuildStates()
Gets all theChainBuildState
s for the currentChainState
@Nullable StageState
getCurrentStage()
Gets the currently executingStageState
int
getCurrentStageNumber()
Returns the cardinal number of currently executed stage.long
getElapsedTime()
Time taken to execute theChain
in milliseconds@NotNull ExecutionContext
getExecutionContext()
Stores contextual data for the currentChainState
@Nullable MergeResultSummary
getMergeResult()
@Nullable VcsWorkingCopy
getMergeWorkingCopy()
@NotNull String
getName()
Get Chain nameStageState
getNextStage()
Get the next stagePlanExecutionConfig.PlanExecutionType
getPlanExecutionType()
How this chain was executed, i.e.@NotNull PlanResultKey
getPlanResultKey()
PlanResultKey
for the theChain
execution@Nullable StageState
getPreviousStage()
Gets the currently executingStageState
@NotNull Date
getQueueTime()
The queueDate
@NotNull List<StageState>
getStages()
Get all stages for Chain@Nullable Date
getStartDate()
The startDate
boolean
isBeingFinalised()
Indicates that Bamboo has decided this chain is complete and is currently processing the results.boolean
isCompleted()
Checks if theChain
has been completedboolean
isContinuable()
true if user will be able to manually continue the build after this execution endsboolean
isFailed()
Checks if theChain
has failedboolean
isGoingToStopAtManualStage()
true if the successfully finished chain is expected to stop at the (proceeding) manual stageboolean
isStopping()
Checks if theChain
is stoppingboolean
isStopRequested()
Checks if theChain
has been requested to stop executingboolean
isSuccessful()
Checks if theChain
has successfully completedvoid
markAsBeingFinalised()
Marks this chain as being finished and results being processed.void
markAsStopping()
Marks theChain
as stoppingStageState
proceedToNextStage(@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.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 Detail
-
getName
@NotNull @NotNull String getName()
Get Chain name- Returns:
- name
-
getPlanResultKey
@NotNull @NotNull PlanResultKey getPlanResultKey()
PlanResultKey
for the theChain
execution- 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 theChainBuildState
s 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 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
@NotNull @NotNull BuildContext getBuildContext()
TheBuildContext
of 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 theChain
in 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 theChain
in 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)
-
-