Class BranchDetectionServiceImpl

java.lang.Object
com.atlassian.bamboo.plan.branch.BranchDetectionServiceImpl
All Implemented Interfaces:
BranchDetectionService

public class BranchDetectionServiceImpl extends Object implements BranchDetectionService
  • Field Details

  • Constructor Details

  • Method Details

    • scheduleBranchListInitialisation

      public boolean scheduleBranchListInitialisation(@NotNull @NotNull Chain chain)
      Description copied from interface: BranchDetectionService
      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.
      Specified by:
      scheduleBranchListInitialisation in interface BranchDetectionService
      Parameters:
      chain - chain which vcs branches list should be initialized
      Returns:
      false if another detection for this chain is already in progress or in queue
    • scheduleBranchDetectionForRepository

      public boolean scheduleBranchDetectionForRepository(long repositoryId)
      Description copied from interface: BranchDetectionService
      Schedules branch detection for given repository
      Specified by:
      scheduleBranchDetectionForRepository in interface BranchDetectionService
    • detectBranchesForRepository

      public void detectBranchesForRepository(long repositoryId, boolean ignoreChainsConfig)
      Description copied from interface: BranchDetectionService
      Immediately executes branch detection for a given repository and creates new plan branches for chains using this repository as default. This method blocks until the detection is finished.
      Specified by:
      detectBranchesForRepository in interface BranchDetectionService
      Parameters:
      repositoryId - id of the repository
      ignoreChainsConfig - allows to force branch creation and cleanup for all related chains. If true branch detection will be executed even if a chain is not configured to automatically manage branches.
    • getOpenBranches

      @NotNull public @NotNull Optional<List<VcsBranch>> getOpenBranches(@NotNull @NotNull VariableSubstitutor variableSubstitutor, @NotNull @NotNull VcsRepositoryData vcsRepositoryData, @NotNull @NotNull VcsBranchDetector branchDetector, @Nullable @Nullable ErrorCollection errorCollection, @NotNull @NotNull Iterable<ImmutableChain> chains)
      Description copied from interface: BranchDetectionService
      Returns a list of currently open branches for given repository. List ordering determined by underlying repository (preference is for native ordering e.g. last updated first for hg)
      Specified by:
      getOpenBranches in interface BranchDetectionService
      Parameters:
      variableSubstitutor - variable substitutor to use for substituting repository configuration
      vcsRepositoryData - the repository
      branchDetector - executor responsible for branch detection
      errorCollection - errors collection to add errors to
      chains - list of chains against which errors will be recorded
      Returns:
      list of branches open in VCS or nothing if there's been an error fetching branches