com.atlassian.bamboo.chains
Interface ChainState


public interface ChainState

In memory representation of the running Chain state


Method Summary
 void finishStopping()
          Marks the Chain as finished stopping.
 long getAverageDuration()
          Average duration of the Chain in milliseconds
 BuildContext getBuildContext()
          The BuildContext of the currently executing chain
 com.atlassian.bamboo.chains.ChainBuildState getChainBuildState(PlanResultKey planResultKey)
          Gets the build state for the given buildResultKey
 java.util.Collection<com.atlassian.bamboo.chains.ChainBuildState> getChainBuildStates()
          Gets all the ChainBuildStates for the current ChainState
 StageState getCurrentStage()
          Gets the currently executing StageState
 int getCurrentStageNumber()
          Returns the cardinal number of currently executed stage.
 long getElapsedTime()
          Time taken to execute the Chain in milliseconds
 ExecutionContext getExecutionContext()
          Stores contextual data for the current ChainState
 java.lang.String getName()
          Get Chain name
 StageState getNextStage()
          Get the next stage
 PlanResultKey getPlanResultKey()
          PlanResultKey for the the Chain execution
 StageState getPreviousStage()
          Gets the currently executing StageState
 java.util.List<StageState> getStages()
          Get all stages for Chain
 java.util.Date getStartDate()
          The start Date
 boolean isCompleted()
          Checks if the Chain has been completed
 boolean isFailed()
          Checks if the Chain has failed
 boolean isStopping()
          Checks if the Chain is stopping
 boolean isStopRequested()
          Checks if the Chain has been requested to stop executing
 boolean isSuccessful()
          Checks if the Chain has successfully completed
 void markAsStopping()
          Marks the Chain as stopping
 StageState proceedToNextStage()
          Replaces the current stage with the next stage in the queue and changes the reference to the current stage to the previous.
 void setStartDate(java.util.Date date)
          The first call sets the start Date.
 

Method Detail

getName

@NotNull
java.lang.String getName()
Get Chain name

Returns:
name

getPlanResultKey

@NotNull
PlanResultKey getPlanResultKey()
PlanResultKey for the the Chain execution

Returns:

getStages

@NotNull
java.util.List<StageState> getStages()
Get all stages for Chain

Returns:
stages

getChainBuildState

@Nullable
com.atlassian.bamboo.chains.ChainBuildState getChainBuildState(@NotNull
                                                                        PlanResultKey planResultKey)
Gets the build state for the given buildResultKey

Parameters:
planResultKey -
Returns:
buildState

getChainBuildStates

@NotNull
java.util.Collection<com.atlassian.bamboo.chains.ChainBuildState> getChainBuildStates()
Gets all the ChainBuildStates for the current ChainState

Returns:
buildStates

getPreviousStage

@Nullable
StageState getPreviousStage()
Gets the currently executing StageState

Returns:
chainStageStage or null

getCurrentStage

@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()
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.


getBuildContext

@NotNull
BuildContext getBuildContext()
The BuildContext of the currently executing chain

Returns:
buildContext

getExecutionContext

@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
java.util.Date getStartDate()
The start Date

Returns:
startDate

setStartDate

void setStartDate(@NotNull
                  java.util.Date date)
The first call sets the start Date. Subsequent calls have no effect.

Parameters:
date -

getElapsedTime

long getElapsedTime()
Time taken to execute the Chain in milliseconds

Returns:
executionTime


Copyright © 2010 Atlassian. All Rights Reserved.