com.atlassian.bamboo.plan.branch
Interface BranchDetectionService

All Known Implementing Classes:
BranchDetectionServiceImpl

public interface BranchDetectionService

A service for detecting new branches in VCS repositories and creating new branches for a plan. This service is responsible for throttling the detection requests.


Method Summary
 void createPlanBranches(ImmutableChain chain, java.util.Collection<VcsBranch> branches, ErrorCollection errorCollection)
          Given a list of branch names, create Plan Branches for these, with overriding repository definitions
 void detectBranchesForChain(ImmutableChain chain)
          Immediately executes the detection for a given Chain and creates new plan branches if new branches found in the plan's default repository.
 java.util.List<VcsBranch> getOpenBranches(ImmutableChain chain, ErrorCollection errorCollection)
          Returns a list of currently open branches for the chain's default repository List ordering determined by underlying repository (preference is for native ordering e.g.
 boolean scheduleBranchDetectionForChain(ImmutableChain chain)
          Registers branch detection request for a given Chain.
 boolean scheduleBranchListInitialisation(Chain chain)
          Schedules initialisation of existing vcs branch list.
 

Method Detail

scheduleBranchDetectionForChain

boolean scheduleBranchDetectionForChain(@NotNull
                                        ImmutableChain chain)
Registers branch detection request for a given Chain. The BranchDetectionService will try to flatten the real branch detection execution density over time.

Parameters:
chain -
Returns:
false if another detection for this chain is already in progress or in queue

scheduleBranchListInitialisation

boolean scheduleBranchListInitialisation(@NotNull
                                         Chain chain)
Schedules initialisation of existing vcs branch list. The next branch detection for the chain will only seek for existing branches but will not create any ChainBranches.

Parameters:
chain -
Returns:
false if another detection for this chain is already in progress or in queue

detectBranchesForChain

void detectBranchesForChain(@NotNull
                            ImmutableChain chain)
Immediately executes the detection for a given Chain and creates new plan branches if new branches found in the plan's default repository. This method blocks until the detection is finished.

Parameters:
chain -

getOpenBranches

@Nullable
java.util.List<VcsBranch> getOpenBranches(@NotNull
                                                   ImmutableChain chain,
                                                   ErrorCollection errorCollection)
Returns a list of currently open branches for the chain's default repository List ordering determined by underlying repository (preference is for native ordering e.g. last updated first for hg)

Parameters:
chain - to find branches for.
errorCollection - to add any errors to during detection
Returns:
a list of currently open branches for the chain's default repository

createPlanBranches

void createPlanBranches(@NotNull
                        ImmutableChain chain,
                        @NotNull
                        java.util.Collection<VcsBranch> branches,
                        @Nullable
                        ErrorCollection errorCollection)
Given a list of branch names, create Plan Branches for these, with overriding repository definitions

Parameters:
chain - to create branches under
branches - to create.
errorCollection - - to add errors to, if you dont supply an error collection, they will just get logged.


Copyright © 2012 Atlassian. All Rights Reserved.