Interface ChainState


@Internal public interface ChainState
In memory representation of the running Chain state
  • Method Details

    • getName

      @NotNull @NotNull String getName()
      Get Chain name
      Returns:
      name
    • getPlanResultKey

      @NotNull @NotNull PlanResultKey getPlanResultKey()
      PlanResultKey for the the Chain 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 the ChainBuildStates for the current ChainState
      Returns:
      buildStates
    • getPreviousStage

      @Nullable @Nullable StageState getPreviousStage()
      Gets the currently executing StageState
      Returns:
      chainStageStage or null
    • getCurrentStage

      @Nullable @Nullable StageState getCurrentStage()
      Gets the currently executing StageState
      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 the Chain has been completed
      Returns:
      completed
    • isSuccessful

      boolean isSuccessful()
      Checks if the Chain has successfully completed
      Returns:
      successful
    • isFailed

      boolean isFailed()
      Checks if the Chain has failed
      Returns:
      failed
    • isStopping

      boolean isStopping()
      Checks if the Chain is stopping
      Returns:
      stopping
    • isStopRequested

      boolean isStopRequested()
      Checks if the Chain has been requested to stop executing
      Returns:
      stopRequested
    • markAsStopping

      void markAsStopping()
      Marks the Chain as stopping
    • finishStopping

      void finishStopping()
      Marks the Chain 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()
      The BuildContext of the currently executing chain
      Returns:
      buildContext
    • getExecutionContext

      @NotNull @NotNull ExecutionContext getExecutionContext()
      Stores contextual data for the current ChainState
      Returns:
      executionContext
    • getAverageDuration

      long getAverageDuration()
      Average duration of the Chain in milliseconds
      Returns:
      averageDuration
    • getStartDate

      @Nullable @Nullable Date getStartDate()
      The start Date
      Returns:
      startDate
    • getQueueTime

      @NotNull @NotNull Date getQueueTime()
      The queue Date
      Returns:
      queue time
    • setStartDate

      boolean setStartDate(@NotNull @NotNull Date date)
      The first call sets the start Date. 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 the Chain 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)