Package com.atlassian.bamboo.chains
Class ChainResultManagerImpl
java.lang.Object
com.atlassian.bamboo.chains.ChainResultManagerImpl
- All Implemented Interfaces:
ChainResultManager
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.bamboo.chains.ChainResultManager
ChainResultManager.JobResultInfoForRerun -
Constructor Summary
ConstructorsConstructorDescriptionChainResultManagerImpl(BuildResultsSummaryManager buildResultsSummaryManager, ResultsSummaryManager resultsSummaryManager, LimitedConcurrencyCaller limitedConcurrencyCaller, ErrorUpdateHandler errorUpdateHandler, org.apache.struts2.text.TextProvider textProvider, ArtifactLinkManager artifactLinkManager, Persister persister, BuildContextBuilderFactory buildContextBuilderFactory, TriggerManager triggerManager, AuthorCreatorService authorCreatorService) -
Method Summary
Modifier and TypeMethodDescriptioncleanForRerunBuild(@NotNull BuildContext chainBuildContext) Removes all job and stage results.@NotNull ChainStateResultcreate(@NotNull BuildContext chainBuildContext, @NotNull Map<ImmutableChainStage, Map<ImmutableJob, BuildContext>> jobBuildContexts, @NotNull Collection<? extends ImmutableChainStage> stagesToExecute) voidcreateRepositorySpecFailedResult(@NotNull ImmutableChain plan, @NotNull VcsRepositoryData repositoryData, @NotNull BuildChanges buildChanges, int buildNumber, @NotNull VcsLocationBambooSpecsState specsState) Create and save chain result for plan which was not updated when Repository stored specs execution was failedvoidcreateRepositorySpecSuccessResult(@NotNull ImmutableChain plan, @NotNull VcsRepositoryData repositoryData, @NotNull BuildChanges buildChanges, int buildNumber) Create and save chain result for plan which was updated when Repository stored specs executed@NotNull ChainStateResultcreateStateForRerunBuild(@NotNull BuildContext chainBuildContext, @NotNull Map<ImmutableChainStage, Map<ImmutableJob, BuildContext>> jobBuildContexts, PlanExecutionConfig planExecutionConfig, @NotNull Map<PlanResultKey, ChainResultManager.JobResultInfoForRerun> jobResultInfoForRerunMap) Creates aChainStateas well stage and job results for build already executed and being rerun.longgetAverageProgressDurationForStages(@NotNull PlanIdentifier chain, @NotNull Collection<ChainStageResult> stages, int numberOfResults) Calculates average duration of provided stages execution@NotNull ChainStateResultupdateForContinuedBuild(@NotNull BuildContext chainBuildContext, @NotNull Collection<BuildContext> jobBuildContexts, @NotNull PlanExecutionConfig planExecutionConfig) Creates aChainStatefor build already executed and stopped on manual stage of failedvoidupdateStateToInProgress(@NotNull PlanResultKey chainResultKey, @NotNull Date startDate)
-
Constructor Details
-
ChainResultManagerImpl
public ChainResultManagerImpl(BuildResultsSummaryManager buildResultsSummaryManager, ResultsSummaryManager resultsSummaryManager, LimitedConcurrencyCaller limitedConcurrencyCaller, ErrorUpdateHandler errorUpdateHandler, org.apache.struts2.text.TextProvider textProvider, ArtifactLinkManager artifactLinkManager, Persister persister, BuildContextBuilderFactory buildContextBuilderFactory, TriggerManager triggerManager, AuthorCreatorService authorCreatorService)
-
-
Method Details
-
updateStateToInProgress
public void updateStateToInProgress(@NotNull @NotNull PlanResultKey chainResultKey, @NotNull @NotNull Date startDate) - Specified by:
updateStateToInProgressin interfaceChainResultManager- Parameters:
chainResultKey-startDate-
-
create
@NotNull public @NotNull ChainStateResult create(@NotNull @NotNull BuildContext chainBuildContext, @NotNull @NotNull Map<ImmutableChainStage, Map<ImmutableJob, BuildContext>> jobBuildContexts, @NotNull @NotNull Collection<? extends ImmutableChainStage> stagesToExecute) Description copied from interface:ChainResultManager- Specified by:
createin interfaceChainResultManager- Parameters:
chainBuildContext-jobBuildContexts-stagesToExecute-- Returns:
- chainResultState
-
updateForContinuedBuild
@NotNull public @NotNull ChainStateResult updateForContinuedBuild(@NotNull @NotNull BuildContext chainBuildContext, @NotNull @NotNull Collection<BuildContext> jobBuildContexts, @NotNull @NotNull PlanExecutionConfig planExecutionConfig) throws IOException Description copied from interface:ChainResultManagerCreates aChainStatefor build already executed and stopped on manual stage of failed- Specified by:
updateForContinuedBuildin interfaceChainResultManager- Parameters:
chainBuildContext-jobBuildContexts-planExecutionConfig- - controls the continue/restart execution- Returns:
- Throws:
IOException
-
cleanForRerunBuild
@NotNull public @NotNull Map<PlanResultKey,ChainResultManager.JobResultInfoForRerun> cleanForRerunBuild(@NotNull @NotNull BuildContext chainBuildContext) Description copied from interface:ChainResultManagerRemoves all job and stage results.- Specified by:
cleanForRerunBuildin interfaceChainResultManager- Returns:
- re
-
createStateForRerunBuild
@NotNull public @NotNull ChainStateResult createStateForRerunBuild(@NotNull @NotNull BuildContext chainBuildContext, @NotNull @NotNull Map<ImmutableChainStage, Map<ImmutableJob, throws IOExceptionBuildContext>> jobBuildContexts, PlanExecutionConfig planExecutionConfig, @NotNull @NotNull Map<PlanResultKey, ChainResultManager.JobResultInfoForRerun> jobResultInfoForRerunMap) Description copied from interface:ChainResultManagerCreates aChainStateas well stage and job results for build already executed and being rerun. Must be called afterChainResultManager.cleanForRerunBuild(BuildContext)- Specified by:
createStateForRerunBuildin interfaceChainResultManager- Throws:
IOException
-
getAverageProgressDurationForStages
public long getAverageProgressDurationForStages(@NotNull @NotNull PlanIdentifier chain, @NotNull @NotNull Collection<ChainStageResult> stages, int numberOfResults) Description copied from interface:ChainResultManagerCalculates average duration of provided stages execution- Specified by:
getAverageProgressDurationForStagesin interfaceChainResultManager- Parameters:
chain-stages- stages for current execution of plan included in calculationnumberOfResults- number of previous executions included in calculations- Returns:
-
createRepositorySpecFailedResult
public void createRepositorySpecFailedResult(@NotNull @NotNull ImmutableChain plan, @NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull BuildChanges buildChanges, int buildNumber, @NotNull @NotNull VcsLocationBambooSpecsState specsState) Description copied from interface:ChainResultManagerCreate and save chain result for plan which was not updated when Repository stored specs execution was failed- Specified by:
createRepositorySpecFailedResultin interfaceChainResultManager
-
createRepositorySpecSuccessResult
public void createRepositorySpecSuccessResult(@NotNull @NotNull ImmutableChain plan, @NotNull @NotNull VcsRepositoryData repositoryData, @NotNull @NotNull BuildChanges buildChanges, int buildNumber) Description copied from interface:ChainResultManagerCreate and save chain result for plan which was updated when Repository stored specs executed- Specified by:
createRepositorySpecSuccessResultin interfaceChainResultManager
-