com.atlassian.bamboo.plan.branch
Class ChainBranchManagerImpl

java.lang.Object
  extended by com.atlassian.bamboo.plan.branch.ChainBranchManagerImpl
All Implemented Interfaces:
ChainBranchManager

public class ChainBranchManagerImpl
extends java.lang.Object
implements ChainBranchManager


Constructor Summary
ChainBranchManagerImpl(PlanDao planDao)
           
 
Method Summary
 int getBranchCount(Plan plan)
          Returns the number of branches the given plan has
 java.util.List<ChainBranch> getBranchesForChain(ImmutableChain chain)
          Get all feature branches associated with the given chain
 java.util.Collection<Job> getBranchesForJob(Job job)
           
 java.util.List<ChainBranchIdentifier> getBranchIdentifiersForChain(PlanIdentifier chain)
          Get all feature branches associated with the given chain, however on pulls up minimal details about each branch.
 ChainBranchIdentifier getBranchWithName(ImmutableChain masterPlan, java.lang.String branchName)
          Returns ChainBranchIdentifier of ChainBranch with given master Chain and name.
 java.util.Set<java.lang.Long> getPlansWithBranches()
          Returns a list of plans that currently have branches
 boolean hasBranches(Plan plan)
          Returns whether or not the given plan has any branches
 boolean isPlanBranchNameConflicting(ImmutableChain masterPlan, long planIdToIgnore, java.lang.String branchName)
          Verifies whether a ChainBranch name is unique with a given master Chain

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChainBranchManagerImpl

public ChainBranchManagerImpl(PlanDao planDao)
Method Detail

getBranchesForChain

@NotNull
public java.util.List<ChainBranch> getBranchesForChain(@NotNull
                                                               ImmutableChain chain)
Description copied from interface: ChainBranchManager
Get all feature branches associated with the given chain

Specified by:
getBranchesForChain in interface ChainBranchManager
Parameters:
chain - - the master
Returns:
List ChainBranchs associated with the given chain.

getBranchesForJob

public java.util.Collection<Job> getBranchesForJob(Job job)
Specified by:
getBranchesForJob in interface ChainBranchManager

getBranchIdentifiersForChain

@NotNull
public java.util.List<ChainBranchIdentifier> getBranchIdentifiersForChain(@NotNull
                                                                                  PlanIdentifier chain)
Description copied from interface: ChainBranchManager
Get all feature branches associated with the given chain, however on pulls up minimal details about each branch.

Specified by:
getBranchIdentifiersForChain in interface ChainBranchManager
Parameters:
chain - - the master
Returns:
List ChainBranchIdentifier for branches associated with the given Chain.

hasBranches

public boolean hasBranches(@NotNull
                           Plan plan)
Description copied from interface: ChainBranchManager
Returns whether or not the given plan has any branches

Specified by:
hasBranches in interface ChainBranchManager
Parameters:
plan - to check for branches for
Returns:
true if branches exist of the plan

getBranchCount

public int getBranchCount(@NotNull
                          Plan plan)
Description copied from interface: ChainBranchManager
Returns the number of branches the given plan has

Specified by:
getBranchCount in interface ChainBranchManager
Parameters:
plan - to check for branches for
Returns:
number of branches for the plan

getPlansWithBranches

@NotNull
public java.util.Set<java.lang.Long> getPlansWithBranches()
Description copied from interface: ChainBranchManager
Returns a list of plans that currently have branches

Specified by:
getPlansWithBranches in interface ChainBranchManager
Returns:
a list of plan ids of the plans with branches.

isPlanBranchNameConflicting

public boolean isPlanBranchNameConflicting(ImmutableChain masterPlan,
                                           long planIdToIgnore,
                                           java.lang.String branchName)
Description copied from interface: ChainBranchManager
Verifies whether a ChainBranch name is unique with a given master Chain

Specified by:
isPlanBranchNameConflicting in interface ChainBranchManager
Parameters:
masterPlan - the master chain within which the name has to be unique
planIdToIgnore - the id of the ChainBranch that has to be ignored during lookup (when you're saving a ChainBranch, you should supply its id here)
branchName - displayed name of the ChainBranch inside the master's plan
Returns:
true if the name is in conflict

getBranchWithName

public ChainBranchIdentifier getBranchWithName(ImmutableChain masterPlan,
                                               java.lang.String branchName)
Description copied from interface: ChainBranchManager
Returns ChainBranchIdentifier of ChainBranch with given master Chain and name.

Specified by:
getBranchWithName in interface ChainBranchManager
Returns:
ChainBranchIdentifier or null if no such branch exists


Copyright © 2012 Atlassian. All Rights Reserved.