Package com.atlassian.bamboo.plan.branch
Interface ChainBranchManager
- All Known Implementing Classes:
 ChainBranchManagerImpl
public interface ChainBranchManager
- 
Method Summary
Modifier and TypeMethodDescriptionvoidclearInvalidMetadataFlagInBranches(long masterId) Clears 'invalid' flag in all branches of a chain.intgetBranchCount(@NotNull ImmutablePlan plan) Returns the number of branches the given plan has@NotNull List<ChainBranch>getBranchesForChain(@NotNull ImmutableChain chain) Get all feature branches associated with the given chaingetBranchesForChain(@NotNull PlanKey chainKey) Get all feature branches associated with the chain identified by the given keygetBranchesForJob(Job job) @NotNull List<ChainBranchIdentifier>getBranchIdentifiersForChain(@NotNull PlanIdentifier chain) Get all feature branches associated with the given chain, however on pulls up minimal details about each branch.@Nullable ChainBranchIdentifiergetBranchWithName(ImmutableChain masterPlan, String branchName) longRetrieving suggested number for next branch key in given chain.Returns a list of plans that currently have branchesvoidhandleVcsBranchDeletedOfPlanBranch(@NotNull ImmutableChain chainBranch, @NotNull PlanRepositoryDefinition planRepositoryDefinition) Handles deletion of a VCS branch from any of the plan branch's repositories.voidhandleVcsBranchDeletedOfPlanBranch(ImmutableChain chainBranch) Handles deletion of a VCS branch from plan branch's default repository.booleanhasBranches(@NotNull Plan plan) Returns whether or not the given plan has any branchesbooleanisPlanBranchNameConflicting(ImmutableChain masterPlan, long chainBranchIdToIgnore, String branchName) Verifies whether aChainBranchname is unique with a given masterChainvoidmarkMetadataInvalid(@NotNull PlanKey branchKey) Marks the chain as 'invalid', which means metadata no longer match vcs data.voidupdateNextBranchKeyNumber(ImmutablePlan chain, long number) Set suggested number for next branch key in given chainvoidupdatePlanBranchMetadata(@NotNull PlanKey branchKey) Update plan branch metadata to reflect the current state of chain. 
- 
Method Details
- 
getBranchesForChain
Get all feature branches associated with the given chain- Parameters:
 chain- - the master- Returns:
 - List 
ChainBranchs associated with the given chain. 
 - 
getBranchesForChain
Get all feature branches associated with the chain identified by the given key- Parameters:
 chainKey- - the chain key- Returns:
 - List 
ChainBranchs associated with the chain identified by the given key. - Since:
 - 9.5
 
 - 
getBranchIdentifiersForChain
@NotNull @NotNull List<ChainBranchIdentifier> getBranchIdentifiersForChain(@NotNull @NotNull PlanIdentifier chain) Get all feature branches associated with the given chain, however on pulls up minimal details about each branch.- Parameters:
 chain- - the master- Returns:
 - List 
ChainBranchIdentifierfor branches associated with the given Chain. 
 - 
hasBranches
Returns whether or not the given plan has any branches- Parameters:
 plan- to check for branches for- Returns:
 - true if branches exist of the plan
 
 - 
getBranchCount
Returns the number of branches the given plan has- Parameters:
 plan- to check for branches for- Returns:
 - number of branches for the plan
 
 - 
getPlansWithBranches
Returns a list of plans that currently have branches- Returns:
 - a list of plan ids of the plans with branches.
 
 - 
isPlanBranchNameConflicting
boolean isPlanBranchNameConflicting(ImmutableChain masterPlan, long chainBranchIdToIgnore, String branchName) Verifies whether aChainBranchname is unique with a given masterChain- Parameters:
 masterPlan- the master chain within which the name has to be uniquechainBranchIdToIgnore- 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
 - Since:
 - 4.0
 
 - 
getBranchWithName
@Nullable @Nullable ChainBranchIdentifier getBranchWithName(ImmutableChain masterPlan, String branchName) - Parameters:
 masterPlan-branchName-- Returns:
 ChainBranchIdentifieror null if no such branch exists- Since:
 - 4.2
 
 - 
handleVcsBranchDeletedOfPlanBranch
Handles deletion of a VCS branch from plan branch's default repository. If the passed in chain is a plan branch it will be disabled and it's default VCS branch will be marked as deleted.- Parameters:
 chainBranch- the plan branch of which a default VCS branch was deleted
 - 
handleVcsBranchDeletedOfPlanBranch
void handleVcsBranchDeletedOfPlanBranch(@NotNull @NotNull ImmutableChain chainBranch, @NotNull @NotNull PlanRepositoryDefinition planRepositoryDefinition) Handles deletion of a VCS branch from any of the plan branch's repositories. If the passed in chain is a plan branch it will be disabled. If the deleted branch is the default branch it will mark that VCS branch as deleted.- Parameters:
 chainBranch- the plan branch of which a VCS branch was deletedplanRepositoryDefinition- plan repository whose branch was deleted
 - 
getBranchesForJob
 - 
getNextBranchKeyNumber
Retrieving suggested number for next branch key in given chain. If it's first branch it will return 0.- Parameters:
 chain-- Returns:
 
 - 
updateNextBranchKeyNumber
Set suggested number for next branch key in given chain- Parameters:
 chain-number-
 - 
updatePlanBranchMetadata
Update plan branch metadata to reflect the current state of chain.- Since:
 - 8.2
 
 - 
markMetadataInvalid
Marks the chain as 'invalid', which means metadata no longer match vcs data.- Since:
 - 8.2
 
 - 
clearInvalidMetadataFlagInBranches
@Internal void clearInvalidMetadataFlagInBranches(long masterId) Clears 'invalid' flag in all branches of a chain.- Since:
 - 8.2
 
 
 -