com.atlassian.bamboo.chains
Class ChainResultManagerImpl

java.lang.Object
  extended by com.atlassian.bamboo.chains.ChainResultManagerImpl
All Implemented Interfaces:
ChainResultManager

public class ChainResultManagerImpl
extends java.lang.Object
implements ChainResultManager


Constructor Summary
ChainResultManagerImpl(BuildResultsSummaryManager buildResultsSummaryManager, ResultsSummaryManager resultsSummaryManager, LimitedConcurrencyCaller limitedConcurrencyCaller, ErrorUpdateHandler errorUpdateHandler, com.opensymphony.xwork.TextProvider textProvider, ArtifactLinkManager artifactLinkManager, Persister persister)
           
 
Method Summary
 ChainStateResult create(BuildContext chainBuildContext, java.util.Map<ImmutableChainStage,java.util.Map<ImmutableJob,BuildContext>> jobBuildContexts, java.util.Collection<? extends ImmutableChainStage> stagesToExecute)
          Creates a ChainState from Chain and BuildContext and reports any errors
 long getAverageProgressDurationForStages(PlanIdentifier chain, java.util.Collection<ChainStageResult> stages, int numberOfResults)
          Calculates average duration of provided stages execution
 ChainStateResult updateForContinuedBuild(BuildContext chainBuildContext, java.util.Collection<BuildContext> jobBuildContexts, PlanExecutionConfig planExecutionConfig)
          Creates a ChainState for build already executed and stopped on manual stage of failed
 ChainStateResult updateForRerunBuild(BuildContext chainBuildContext, java.util.Collection<BuildContext> jobBuildContexts, PlanExecutionConfig planExecutionConfig)
          Creates a ChainState for build already executed and being rerun.
 void updateStateToInProgress(PlanResultKey chainResultKey, java.util.Date startDate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChainResultManagerImpl

public ChainResultManagerImpl(BuildResultsSummaryManager buildResultsSummaryManager,
                              ResultsSummaryManager resultsSummaryManager,
                              LimitedConcurrencyCaller limitedConcurrencyCaller,
                              ErrorUpdateHandler errorUpdateHandler,
                              com.opensymphony.xwork.TextProvider textProvider,
                              ArtifactLinkManager artifactLinkManager,
                              Persister persister)
Method Detail

updateStateToInProgress

public void updateStateToInProgress(@NotNull
                                    PlanResultKey chainResultKey,
                                    @NotNull
                                    java.util.Date startDate)
Specified by:
updateStateToInProgress in interface ChainResultManager

create

@NotNull
public ChainStateResult create(@NotNull
                                       BuildContext chainBuildContext,
                                       @NotNull
                                       java.util.Map<ImmutableChainStage,java.util.Map<ImmutableJob,BuildContext>> jobBuildContexts,
                                       @NotNull
                                       java.util.Collection<? extends ImmutableChainStage> stagesToExecute)
Description copied from interface: ChainResultManager
Creates a ChainState from Chain and BuildContext and reports any errors

Specified by:
create in interface ChainResultManager
Returns:
chainResultState

updateForContinuedBuild

@NotNull
public ChainStateResult updateForContinuedBuild(@NotNull
                                                        BuildContext chainBuildContext,
                                                        @NotNull
                                                        java.util.Collection<BuildContext> jobBuildContexts,
                                                        @NotNull
                                                        PlanExecutionConfig planExecutionConfig)
Description copied from interface: ChainResultManager
Creates a ChainState for build already executed and stopped on manual stage of failed

Specified by:
updateForContinuedBuild in interface ChainResultManager
planExecutionConfig - - controls the continue/restart execution
Returns:

updateForRerunBuild

@NotNull
public ChainStateResult updateForRerunBuild(@NotNull
                                                    BuildContext chainBuildContext,
                                                    @NotNull
                                                    java.util.Collection<BuildContext> jobBuildContexts,
                                                    @NotNull
                                                    PlanExecutionConfig planExecutionConfig)
Description copied from interface: ChainResultManager
Creates a ChainState for build already executed and being rerun. This means all succeeding manual stages that won't be executed should have their results wiped out.

Specified by:
updateForRerunBuild in interface ChainResultManager
planExecutionConfig - - controls the continue/restart execution
Returns:

getAverageProgressDurationForStages

public long getAverageProgressDurationForStages(@NotNull
                                                PlanIdentifier chain,
                                                @NotNull
                                                java.util.Collection<ChainStageResult> stages,
                                                int numberOfResults)
Description copied from interface: ChainResultManager
Calculates average duration of provided stages execution

Specified by:
getAverageProgressDurationForStages in interface ChainResultManager
stages - stages for current execution of plan included in calculation
numberOfResults - number of previous executions included in calculations
Returns:


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.