public interface ChainBranchManager
Modifier and Type | Method and Description |
---|---|
void |
clearInvalidMetadataFlagInBranches(long masterId)
Clears 'invalid' flag in all branches of a chain.
|
int |
getBranchCount(@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 chain
|
Collection<Job> |
getBranchesForJob(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 ChainBranchIdentifier |
getBranchWithName(ImmutableChain masterPlan,
String branchName)
|
long |
getNextBranchKeyNumber(ImmutablePlan chain)
Retrieving suggested number for next branch key in given chain.
|
@NotNull Set<Long> |
getPlansWithBranches()
Returns a list of plans that currently have branches
|
void |
handleVcsBranchDeletedOfPlanBranch(ImmutableChain chainBranch)
Handles deletion of a VCS branch from plan branch's default repository.
|
void |
handleVcsBranchDeletedOfPlanBranch(@NotNull ImmutableChain chainBranch,
@NotNull PlanRepositoryDefinition planRepositoryDefinition)
Handles deletion of a VCS branch from any of the plan branch's repositories.
|
boolean |
hasBranches(@NotNull Plan plan)
Returns whether or not the given plan has any branches
|
boolean |
isPlanBranchNameConflicting(ImmutableChain masterPlan,
long chainBranchIdToIgnore,
String branchName)
Verifies whether a
ChainBranch name is unique with a given master Chain |
void |
markMetadataInvalid(@NotNull PlanKey branchKey)
Marks the chain as 'invalid', which means metadata no longer match vcs data.
|
void |
updateNextBranchKeyNumber(ImmutablePlan chain,
long number)
Set suggested number for next branch key in given chain
|
void |
updatePlanBranchMetadata(@NotNull PlanKey branchKey)
Update plan branch metadata to reflect the current state of chain.
|
@NotNull @NotNull List<ChainBranch> getBranchesForChain(@NotNull @NotNull ImmutableChain chain)
chain
- - the masterChainBranch
s associated with the given chain.@NotNull @NotNull List<ChainBranchIdentifier> getBranchIdentifiersForChain(@NotNull @NotNull PlanIdentifier chain)
chain
- - the masterChainBranchIdentifier
for branches associated with the given Chain.boolean hasBranches(@NotNull @NotNull Plan plan)
plan
- to check for branches forint getBranchCount(@NotNull @NotNull ImmutablePlan plan)
plan
- to check for branches for@NotNull @NotNull Set<Long> getPlansWithBranches()
boolean isPlanBranchNameConflicting(ImmutableChain masterPlan, long chainBranchIdToIgnore, String branchName)
ChainBranch
name is unique with a given master Chain
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@Nullable @Nullable ChainBranchIdentifier getBranchWithName(ImmutableChain masterPlan, String branchName)
masterPlan
- branchName
- ChainBranchIdentifier
or null if no such branch existsvoid handleVcsBranchDeletedOfPlanBranch(ImmutableChain chainBranch)
chainBranch
- the plan branch of which a default VCS branch was deletedvoid handleVcsBranchDeletedOfPlanBranch(@NotNull @NotNull ImmutableChain chainBranch, @NotNull @NotNull PlanRepositoryDefinition planRepositoryDefinition)
chainBranch
- the plan branch of which a VCS branch was deletedplanRepositoryDefinition
- plan repository whose branch was deletedCollection<Job> getBranchesForJob(Job job)
long getNextBranchKeyNumber(ImmutablePlan chain)
chain
- void updateNextBranchKeyNumber(ImmutablePlan chain, long number)
chain
- number
- void updatePlanBranchMetadata(@NotNull @NotNull PlanKey branchKey)
void markMetadataInvalid(@NotNull @NotNull PlanKey branchKey)
@Internal void clearInvalidMetadataFlagInBranches(long masterId)
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.