Package com.atlassian.bamboo.build
Class PlanDependencyManagerImpl
java.lang.Object
com.atlassian.bamboo.build.PlanDependencyManagerImpl
- All Implemented Interfaces:
PlanDependencyManager
-
Constructor Summary
ConstructorsConstructorDescriptionPlanDependencyManagerImpl(PlanDependencyDao planDependencyDao, PlanManager planManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidadjustChildDependencyList(@NotNull String dependencyType, @NotNull Plan plan, @NotNull Set<PlanKey> newChildPlanKeys, boolean overwriteExisting) Update the existing children dependencies of the given plan and dependency Type to match the provided list of new children.voidadjustParentDependencyList(@NotNull String dependencyKey, @NotNull Plan childPlan, @NotNull Set<PlanKey> newParentPlanKeys, boolean overwriteExisting) Update the existing parent dependencies of the given plan and dependency Type to match the provided list of new parents.@NotNull Set<PlanDependency>Retrieves all dependency relationships in the system regardless of the plan involvedgetChildChainKeys(@NotNull PlanIdentifier plan) Retrieves all chain that are children of the current plan@NotNull Set<PlanDependency>getChildPlanDependencies(@NotNull PlanIdentifier plan) Retrieves all plan dependencies in which the given plan features as a parentgetChildPlanKeys(@NotNull PlanIdentifier plan) Retrievs all plan that are children of the current plangetEffectiveChildPlans(@NotNull ImmutablePlan chain) getEffectiveParentPlans(@NotNull ImmutablePlan chain) getNotEditableChildKeys(@NotNull PlanIdentifier plan) Retrieves a list of keys representing the children that are not editable of the given plangetNotEditableParentKeys(@NotNull PlanIdentifier plan) Retrieves a list of keys representing the children that are not editable of the given plangetParentChainKeys(@NotNull PlanIdentifier plan) Retrieves all chain that are children of the current plan@NotNull Set<PlanDependency>getParentPlanDependencies(@NotNull PlanIdentifier plan) Retrieves all plan dependencies in which the given plan features as a childgetParentPlanKeys(@NotNull PlanIdentifier plan) Retrievs all plans that are a parent of the current planvoidremoveAllDependenciesForPlan(@NotNull PlanIdentifier plan) Deletes any existing dependency featuring the given plan.booleansavePlanDependency(@Nullable PlanDependency dependency) Save the given dependency.@NotNull ErrorCollectionvalidateChildDependencyList(@NotNull String dependencyType, @NotNull Plan plan, @NotNull Set<PlanKey> newChildPlanKeys, boolean overwriteExisting) Validate child dependency list
-
Constructor Details
-
PlanDependencyManagerImpl
@Inject public PlanDependencyManagerImpl(PlanDependencyDao planDependencyDao, PlanManager planManager)
-
-
Method Details
-
getAllDependencies
Retrieves all dependency relationships in the system regardless of the plan involved- Specified by:
getAllDependenciesin interfacePlanDependencyManager- Returns:
- all plan dependencies.
-
getChildPlanDependencies
@NotNull public @NotNull Set<PlanDependency> getChildPlanDependencies(@NotNull @NotNull PlanIdentifier plan) Description copied from interface:PlanDependencyManagerRetrieves all plan dependencies in which the given plan features as a parent- Specified by:
getChildPlanDependenciesin interfacePlanDependencyManager- Parameters:
plan- - the parent- Returns:
- set of all children of the given plan
-
getParentChainKeys
Description copied from interface:PlanDependencyManagerRetrieves all chain that are children of the current plan- Specified by:
getParentChainKeysin interfacePlanDependencyManager- Parameters:
plan- - the parent- Returns:
- set of chain keys representing all children of the given plan
-
getChildChainKeys
Description copied from interface:PlanDependencyManagerRetrieves all chain that are children of the current plan- Specified by:
getChildChainKeysin interfacePlanDependencyManager- Parameters:
plan- - the parent- Returns:
- set of chain keys representing all children of the given plan
-
getNotEditableChildKeys
Description copied from interface:PlanDependencyManagerRetrieves a list of keys representing the children that are not editable of the given plan- Specified by:
getNotEditableChildKeysin interfacePlanDependencyManager- Parameters:
plan- parent- Returns:
- Set of un-editable dependencies representing the children of the given plan
-
getNotEditableParentKeys
@NotNull public @NotNull Set<String> getNotEditableParentKeys(@NotNull @NotNull PlanIdentifier plan) Description copied from interface:PlanDependencyManagerRetrieves a list of keys representing the children that are not editable of the given plan- Specified by:
getNotEditableParentKeysin interfacePlanDependencyManager- Parameters:
plan- parent- Returns:
- Set of un-editable dependencies representing the children of the given plan
-
getParentPlanDependencies
@NotNull public @NotNull Set<PlanDependency> getParentPlanDependencies(@NotNull @NotNull PlanIdentifier plan) Description copied from interface:PlanDependencyManagerRetrieves all plan dependencies in which the given plan features as a child- Specified by:
getParentPlanDependenciesin interfacePlanDependencyManager- Parameters:
plan- - the child- Returns:
- newly created set of all parents to the given plan
-
removeAllDependenciesForPlan
Description copied from interface:PlanDependencyManagerDeletes any existing dependency featuring the given plan. Used when deleting a plan.- Specified by:
removeAllDependenciesForPlanin interfacePlanDependencyManager- Parameters:
plan- to be removed
-
getChildPlanKeys
Description copied from interface:PlanDependencyManagerRetrievs all plan that are children of the current plan- Specified by:
getChildPlanKeysin interfacePlanDependencyManager- Parameters:
plan- - the parent- Returns:
- set of plan keys representing all children of the given plan
-
getParentPlanKeys
Description copied from interface:PlanDependencyManagerRetrievs all plans that are a parent of the current plan- Specified by:
getParentPlanKeysin interfacePlanDependencyManager- Parameters:
plan- - the child- Returns:
- set of plan keys representing all parents of the given plan
-
validateChildDependencyList
@NotNull public @NotNull ErrorCollection validateChildDependencyList(@NotNull @NotNull String dependencyType, @NotNull @NotNull Plan plan, @NotNull @NotNull Set<PlanKey> newChildPlanKeys, boolean overwriteExisting) Description copied from interface:PlanDependencyManagerValidate child dependency list- Specified by:
validateChildDependencyListin interfacePlanDependencyManager
-
adjustChildDependencyList
public void adjustChildDependencyList(@NotNull @NotNull String dependencyType, @NotNull @NotNull Plan plan, @NotNull @NotNull Set<PlanKey> newChildPlanKeys, boolean overwriteExisting) Description copied from interface:PlanDependencyManagerUpdate the existing children dependencies of the given plan and dependency Type to match the provided list of new children.- Specified by:
adjustChildDependencyListin interfacePlanDependencyManager- Parameters:
dependencyType- of the dependencies being adjustedplan- parentnewChildPlanKeys- the new list of parents (as plan keys)overwriteExisting- whether or not to overwrite any existing dependencies (of a different type) with one of the new type
-
adjustParentDependencyList
public void adjustParentDependencyList(@NotNull @NotNull String dependencyKey, @NotNull @NotNull Plan childPlan, @NotNull @NotNull Set<PlanKey> newParentPlanKeys, boolean overwriteExisting) Description copied from interface:PlanDependencyManagerUpdate the existing parent dependencies of the given plan and dependency Type to match the provided list of new parents.- Specified by:
adjustParentDependencyListin interfacePlanDependencyManager- Parameters:
dependencyKey- of the dependencies being adjustedchildPlan- parentnewParentPlanKeys- the new list of parents (as plan keys)overwriteExisting- whether or not to overwrite any existing dependencies (of a different type) with one of the new type
-
savePlanDependency
Description copied from interface:PlanDependencyManagerSave the given dependency. Will check if it exists or if the dependency is invalid.- Specified by:
savePlanDependencyin interfacePlanDependencyManager- Parameters:
dependency- to save- Returns:
- true if it saved it, false otherwise
-
getEffectiveChildPlans
- Specified by:
getEffectiveChildPlansin interfacePlanDependencyManager
-
getEffectiveParentPlans
- Specified by:
getEffectiveParentPlansin interfacePlanDependencyManager
-