com.atlassian.bamboo.build
Class PlanDependencyManagerImpl

java.lang.Object
  extended by com.atlassian.bamboo.build.PlanDependencyManagerImpl
All Implemented Interfaces:
PlanDependencyManager

public class PlanDependencyManagerImpl
extends java.lang.Object
implements PlanDependencyManager


Constructor Summary
PlanDependencyManagerImpl(PlanDependencyDao planDependencyDao, PlanManager planManager)
           
 
Method Summary
 void adjustChildDependencyList(java.lang.String dependencyKey, Plan plan, java.util.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.
 void adjustParentDependencyList(java.lang.String dependencyKey, Plan childPlan, java.util.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.
 java.util.Set<PlanDependency> getAllDependencies()
          Retrieves all dependency relationships in the system regardless of the plan involved
 java.util.Set<java.lang.String> getChildBuildKeys(Plan plan)
           
 java.util.Set<java.lang.String> getChildChainKeys(Plan plan)
          Retrieves all chain that are children of the current plan
 java.util.Set<PlanDependency> getChildPlanDependencies(Plan plan)
          Retrievs all plan dependencies in which the given plan features as a parent
 java.util.Set<java.lang.String> getChildPlanKeys(Plan plan)
          Retrievs all plan that are children of the current plan
 java.util.Set<java.lang.String> getNotEditableChildKeys(Plan plan)
          Retrieves a list of keys representing the children that are not editable of the given plan
 java.util.Set<java.lang.String> getNotEditableParentKeys(Plan plan)
          Retrieves a list of keys representing the children that are not editable of the given plan
 java.util.Set<java.lang.String> getParentChainKeys(Plan plan)
          Retrieves all chain that are children of the current plan
 java.util.Set<PlanDependency> getParentPlanDependencies(Plan plan)
          Retrieves all plan dependencies in which the given plan features as a child
 java.util.Set<java.lang.String> getParentPlanKeys(Plan plan)
          Retrievs all plans that are a parent of the current plan
 void removeAllDependenciesForPlan(Plan plan)
          Deletes any existing dependency featuring the given plan.
 boolean savePlanDependency(PlanDependency dependency)
          Save the given dependency.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlanDependencyManagerImpl

public PlanDependencyManagerImpl(PlanDependencyDao planDependencyDao,
                                 PlanManager planManager)
Method Detail

getAllDependencies

@NotNull
public java.util.Set<PlanDependency> getAllDependencies()
Retrieves all dependency relationships in the system regardless of the plan involved

Specified by:
getAllDependencies in interface PlanDependencyManager
Returns:
all plan dependencies.

getChildPlanDependencies

@NotNull
public java.util.Set<PlanDependency> getChildPlanDependencies(@NotNull
                                                                      Plan plan)
Description copied from interface: PlanDependencyManager
Retrievs all plan dependencies in which the given plan features as a parent

Specified by:
getChildPlanDependencies in interface PlanDependencyManager
Parameters:
plan - - the parent
Returns:
set of all children of the given plan

getParentChainKeys

@NotNull
public java.util.Set<java.lang.String> getParentChainKeys(@NotNull
                                                                  Plan plan)
Description copied from interface: PlanDependencyManager
Retrieves all chain that are children of the current plan

Specified by:
getParentChainKeys in interface PlanDependencyManager
Parameters:
plan - - the parent
Returns:
set of chain keys representing all children of the given plan

getChildChainKeys

@NotNull
public java.util.Set<java.lang.String> getChildChainKeys(@NotNull
                                                                 Plan plan)
Description copied from interface: PlanDependencyManager
Retrieves all chain that are children of the current plan

Specified by:
getChildChainKeys in interface PlanDependencyManager
Parameters:
plan - - the parent
Returns:
set of chain keys representing all children of the given plan

getNotEditableChildKeys

@NotNull
public java.util.Set<java.lang.String> getNotEditableChildKeys(@NotNull
                                                                       Plan plan)
Description copied from interface: PlanDependencyManager
Retrieves a list of keys representing the children that are not editable of the given plan

Specified by:
getNotEditableChildKeys in interface PlanDependencyManager
Parameters:
plan - parent
Returns:
Set of un-editable dependencies representing the children of the given plan

getNotEditableParentKeys

@NotNull
public java.util.Set<java.lang.String> getNotEditableParentKeys(@NotNull
                                                                        Plan plan)
Description copied from interface: PlanDependencyManager
Retrieves a list of keys representing the children that are not editable of the given plan

Specified by:
getNotEditableParentKeys in interface PlanDependencyManager
Parameters:
plan - parent
Returns:
Set of un-editable dependencies representing the children of the given plan

getParentPlanDependencies

@NotNull
public java.util.Set<PlanDependency> getParentPlanDependencies(@NotNull
                                                                       Plan plan)
Description copied from interface: PlanDependencyManager
Retrieves all plan dependencies in which the given plan features as a child

Specified by:
getParentPlanDependencies in interface PlanDependencyManager
Parameters:
plan - - the child
Returns:
newly created set of all parents to the given plan

removeAllDependenciesForPlan

public void removeAllDependenciesForPlan(@NotNull
                                         Plan plan)
Description copied from interface: PlanDependencyManager
Deletes any existing dependency featuring the given plan. Used when deleting a plan.

Specified by:
removeAllDependenciesForPlan in interface PlanDependencyManager
Parameters:
plan - to be removed

getChildPlanKeys

@NotNull
public java.util.Set<java.lang.String> getChildPlanKeys(@NotNull
                                                                Plan plan)
Description copied from interface: PlanDependencyManager
Retrievs all plan that are children of the current plan

Specified by:
getChildPlanKeys in interface PlanDependencyManager
Parameters:
plan - - the parent
Returns:
set of plan keys representing all children of the given plan

getChildBuildKeys

@NotNull
public java.util.Set<java.lang.String> getChildBuildKeys(@NotNull
                                                                 Plan plan)

getParentPlanKeys

@NotNull
public java.util.Set<java.lang.String> getParentPlanKeys(@NotNull
                                                                 Plan plan)
Description copied from interface: PlanDependencyManager
Retrievs all plans that are a parent of the current plan

Specified by:
getParentPlanKeys in interface PlanDependencyManager
Parameters:
plan - - the child
Returns:
set of plan keys representing all parents of the given plan

adjustChildDependencyList

public void adjustChildDependencyList(@NotNull
                                      java.lang.String dependencyKey,
                                      @NotNull
                                      Plan plan,
                                      @NotNull
                                      java.util.Set<PlanKey> newChildPlanKeys,
                                      boolean overwriteExisting)
Description copied from interface: PlanDependencyManager
Update the existing children dependencies of the given plan and dependency Type to match the provided list of new children.

Specified by:
adjustChildDependencyList in interface PlanDependencyManager
Parameters:
dependencyKey - of the dependencies being adjusted
plan - parent
newChildPlanKeys - 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
                                       java.lang.String dependencyKey,
                                       @NotNull
                                       Plan childPlan,
                                       @NotNull
                                       java.util.Set<PlanKey> newParentPlanKeys,
                                       boolean overwriteExisting)
Description copied from interface: PlanDependencyManager
Update the existing parent dependencies of the given plan and dependency Type to match the provided list of new parents.

Specified by:
adjustParentDependencyList in interface PlanDependencyManager
Parameters:
dependencyKey - of the dependencies being adjusted
childPlan - parent
newParentPlanKeys - 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

public boolean savePlanDependency(@Nullable
                                  PlanDependency dependency)
Description copied from interface: PlanDependencyManager
Save the given dependency. Will check if it exists or if the dependency is invalid.

Specified by:
savePlanDependency in interface PlanDependencyManager
Parameters:
dependency - to save
Returns:
true if it saved it, false otherwise


Copyright © 2011 Atlassian. All Rights Reserved.