Package com.atlassian.bamboo.plan.cache
Class ImmutablePlanManagerImpl
- java.lang.Object
-
- com.atlassian.bamboo.plan.cache.ImmutablePlanManagerImpl
-
- All Implemented Interfaces:
ImmutablePlanManager
public class ImmutablePlanManagerImpl extends Object implements ImmutablePlanManager
- Since:
- v3.4
-
-
Constructor Summary
Constructors Constructor Description ImmutablePlanManagerImpl(PlanManager planManager, PlanDtoManager planDtoManager, ResultsSummaryManager resultsSummaryManager, BuildDefinitionManager buildDefinitionManager, BuildLoggerManager buildLoggerManager, LabelManager labelManager, RepositoryDefinitionManager repositoryDefinitionManager, TaskManager taskManager, TriggerManager triggerManager, VariableDefinitionManager variableDefinitionManager, BambooSpecsManager bambooSpecsManager, NotificationManager notificationManager, RequirementManager requirementManager, VersionDao versionDao)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull ImmutableChain
createImmutableChain(@NotNull Chain chain)
@NotNull ImmutableJob
createImmutableJob(@NotNull ImmutableChain parent, @NotNull ImmutableChainStage stage, @NotNull Job job)
@NotNull ImmutableJob
createImmutableJobBasedOnDto(@NotNull ImmutableChain parent, @NotNull ImmutableChainStage stage, @NotNull EnrichedPlanDto jobDto, @NotNull Map<Long,EnrichedPlanDto> jobsGroupedById, boolean isLightWeight)
Create immutableImmutableJob
.ImmutableChainStage
createImmutableStage(@NotNull ImmutableChain parent, @NotNull ChainStage stage)
Create immutableChainStage
.@NotNull ImmutableChainStage
createImmutableStageBasedOnDto(@NotNull ImmutableChain parent, @NotNull FlatChainStageDto stageDto, @NotNull Map<Long,List<EnrichedPlanDto>> jobsGroupedByStageId, @NotNull Map<Long,EnrichedPlanDto> jobsGroupedById, boolean isLightWeight)
Create immutableChainStage
.ChainResultDetails
getChainResultDetails(PlanResultKey planResultKey)
@Nullable ImmutableResultsSummary
getLatestResultForPlan(@NotNull ImmutableChain immutableChain)
@Nullable ImmutableResultsSummary
getLatestResultForPlan(PlanKey planKey)
@Nullable ImmutableChain
getPlanByKey(@NotNull PlanKey planKey)
@NotNull Map<Long,Long>
getPlanVersions(@NotNull Set<Long> planIds)
Gets the plans' versions corresponding to the given ids.@NotNull List<ImmutableChain>
loadAllPlans(ForkJoinPool executorService)
Get all available plans.
-
-
-
Constructor Detail
-
ImmutablePlanManagerImpl
public ImmutablePlanManagerImpl(PlanManager planManager, PlanDtoManager planDtoManager, ResultsSummaryManager resultsSummaryManager, BuildDefinitionManager buildDefinitionManager, BuildLoggerManager buildLoggerManager, LabelManager labelManager, RepositoryDefinitionManager repositoryDefinitionManager, TaskManager taskManager, TriggerManager triggerManager, VariableDefinitionManager variableDefinitionManager, BambooSpecsManager bambooSpecsManager, NotificationManager notificationManager, RequirementManager requirementManager, VersionDao versionDao)
-
-
Method Detail
-
getPlanByKey
@Nullable public @Nullable ImmutableChain getPlanByKey(@NotNull @NotNull PlanKey planKey)
- Specified by:
getPlanByKey
in interfaceImmutablePlanManager
-
getPlanVersions
@NotNull public @NotNull Map<Long,Long> getPlanVersions(@NotNull @NotNull Set<Long> planIds)
Description copied from interface:ImmutablePlanManager
Gets the plans' versions corresponding to the given ids.- Specified by:
getPlanVersions
in interfaceImmutablePlanManager
- Parameters:
planIds
- list of plan ids- Returns:
- map of plan id to plan version
-
getLatestResultForPlan
@Nullable public @Nullable ImmutableResultsSummary getLatestResultForPlan(PlanKey planKey)
- Specified by:
getLatestResultForPlan
in interfaceImmutablePlanManager
-
getLatestResultForPlan
@Nullable public @Nullable ImmutableResultsSummary getLatestResultForPlan(@NotNull @NotNull ImmutableChain immutableChain)
- Specified by:
getLatestResultForPlan
in interfaceImmutablePlanManager
-
getChainResultDetails
public ChainResultDetails getChainResultDetails(PlanResultKey planResultKey)
- Specified by:
getChainResultDetails
in interfaceImmutablePlanManager
-
createImmutableChain
@NotNull public @NotNull ImmutableChain createImmutableChain(@NotNull @NotNull Chain chain)
- Specified by:
createImmutableChain
in interfaceImmutablePlanManager
-
createImmutableJob
@NotNull public @NotNull ImmutableJob createImmutableJob(@NotNull @NotNull ImmutableChain parent, @NotNull @NotNull ImmutableChainStage stage, @NotNull @NotNull Job job)
- Specified by:
createImmutableJob
in interfaceImmutablePlanManager
- Parameters:
parent
- instance of ImmutablePlanImplstage
- instance of ImmutableChainStageImpl- Returns:
-
createImmutableStage
public ImmutableChainStage createImmutableStage(@NotNull @NotNull ImmutableChain parent, @NotNull @NotNull ChainStage stage)
Description copied from interface:ImmutablePlanManager
Create immutableChainStage
. Used to create immutable cached object from persisted entity.- Specified by:
createImmutableStage
in interfaceImmutablePlanManager
- Parameters:
parent
-Chain
object (expecting an immutable object here as well)stage
-ChainStage
object used as a source of all properties including jobs- Returns:
-
loadAllPlans
@NotNull public @NotNull List<ImmutableChain> loadAllPlans(ForkJoinPool executorService)
Description copied from interface:ImmutablePlanManager
Get all available plans. This method is a very heavy one and the execution may take a long time.- Specified by:
loadAllPlans
in interfaceImmutablePlanManager
-
createImmutableStageBasedOnDto
@NotNull public @NotNull ImmutableChainStage createImmutableStageBasedOnDto(@NotNull @NotNull ImmutableChain parent, @NotNull @NotNull FlatChainStageDto stageDto, @NotNull @NotNull Map<Long,List<EnrichedPlanDto>> jobsGroupedByStageId, @NotNull @NotNull Map<Long,EnrichedPlanDto> jobsGroupedById, boolean isLightWeight)
Description copied from interface:ImmutablePlanManager
Create immutableChainStage
. Used to create immutable cached object from flat components - dto.- Specified by:
createImmutableStageBasedOnDto
in interfaceImmutablePlanManager
- Parameters:
parent
-Chain
object (expecting an immutable object here as well)stageDto
-FlatChainStageDto
flat object used as a source of core attributesjobsGroupedByStageId
- Map of flat job objects grouped by stage idjobsGroupedById
- Map of flat job objects grouped by their main idisLightWeight
- informs whether it is a derived stage from a lightweight branch or not- Returns:
-
createImmutableJobBasedOnDto
@NotNull public @NotNull ImmutableJob createImmutableJobBasedOnDto(@NotNull @NotNull ImmutableChain parent, @NotNull @NotNull ImmutableChainStage stage, @NotNull @NotNull EnrichedPlanDto jobDto, @NotNull @NotNull Map<Long,EnrichedPlanDto> jobsGroupedById, boolean isLightWeight)
Description copied from interface:ImmutablePlanManager
Create immutableImmutableJob
. Used to create immutable cached object from flat components - dto.- Specified by:
createImmutableJobBasedOnDto
in interfaceImmutablePlanManager
- Parameters:
parent
-Chain
object (expecting an immutable object here as well)stage
-ChainStage
object (expecting an immutable object here as well)jobDto
-EnrichedPlanDto
flat object used as a source of core attributesjobsGroupedById
- Map of flat job objects grouped by their main idisLightWeight
- informs whether it is a derived job from a lightweight branch or not- Returns:
-
-