com.atlassian.bamboo.plan.branch
Class BranchDetectionServiceImpl

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

public class BranchDetectionServiceImpl
extends java.lang.Object
implements BranchDetectionService


Constructor Summary
BranchDetectionServiceImpl(PlanManager planManager, ChainBranchCreationService chainBranchCreationService, RepositoryManager repositoryManager, VcsBranchManager vcsBranchManager, RepositoryCachingFacade repositoryCachingFacade, ErrorHandler errorHandler, ScopedExclusionService scopedExclusionService, com.atlassian.event.api.EventPublisher eventPublisher, JiraBranchLinkingService jiraBranchLinkingService, VariableDefinitionManager variableDefinitionManager, CustomVariableContext customVariableContext, org.springframework.orm.hibernate.HibernateTemplate hibernateTemplate, CachedPlanManager cachedPlanManager)
           
 
Method Summary
 java.util.Collection<PlanKey> 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.
 java.util.Collection<PlanKey> createPlanBranches(ImmutableChain chain, java.util.Collection<VcsBranch> branches, ErrorCollection errorCollection, PlanCreationService.EnablePlan enablePlan)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BranchDetectionServiceImpl

public BranchDetectionServiceImpl(PlanManager planManager,
                                  ChainBranchCreationService chainBranchCreationService,
                                  RepositoryManager repositoryManager,
                                  VcsBranchManager vcsBranchManager,
                                  RepositoryCachingFacade repositoryCachingFacade,
                                  ErrorHandler errorHandler,
                                  ScopedExclusionService scopedExclusionService,
                                  com.atlassian.event.api.EventPublisher eventPublisher,
                                  JiraBranchLinkingService jiraBranchLinkingService,
                                  VariableDefinitionManager variableDefinitionManager,
                                  CustomVariableContext customVariableContext,
                                  org.springframework.orm.hibernate.HibernateTemplate hibernateTemplate,
                                  CachedPlanManager cachedPlanManager)
Method Detail

scheduleBranchListInitialisation

public boolean scheduleBranchListInitialisation(@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
Returns:
false if another detection for this chain is already in progress or in queue

scheduleBranchDetectionForChain

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

Specified by:
scheduleBranchDetectionForChain in interface BranchDetectionService
Returns:
false if another detection for this chain is already in progress or in queue

detectBranchesForChain

public void detectBranchesForChain(@NotNull
                                   ImmutableChain chain)
Description copied from interface: BranchDetectionService
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.

Specified by:
detectBranchesForChain in interface BranchDetectionService

createPlanBranches

@NotNull
public java.util.Collection<PlanKey> createPlanBranches(@NotNull
                                                                ImmutableChain chain,
                                                                @NotNull
                                                                java.util.Collection<VcsBranch> branches,
                                                                @Nullable
                                                                ErrorCollection errorCollection)
Description copied from interface: BranchDetectionService
Given a list of branch names, create Plan Branches for these, with overriding repository definitions. Branches created using this method are excluded from expiration by default.

Specified by:
createPlanBranches in interface BranchDetectionService
Parameters:
chain - to create branches under
branches - to create.
errorCollection - - to add errors to, if you don't supply an error collection, they will just get logged.
Returns:
collection of keys of created plans

createPlanBranches

@NotNull
public java.util.Collection<PlanKey> createPlanBranches(@NotNull
                                                                ImmutableChain chain,
                                                                @NotNull
                                                                java.util.Collection<VcsBranch> branches,
                                                                @Nullable
                                                                ErrorCollection errorCollection,
                                                                PlanCreationService.EnablePlan enablePlan)
Description copied from interface: BranchDetectionService
Given a list of branch names, create Plan Branches for these, with overriding repository definitions. Branches created using this method are excluded from expiration by default.

Specified by:
createPlanBranches in interface BranchDetectionService
Parameters:
chain - to create branches under
branches - to create.
errorCollection - - to add errors to, if you don't supply an error collection, they will just get logged.
enablePlan - - defines whether newly created branches should be enabled or disabled after creation
Returns:
collection of keys of created plans

getOpenBranches

@Nullable
public java.util.List<VcsBranch> getOpenBranches(@NotNull
                                                          ImmutableChain chain,
                                                          ErrorCollection errorCollection)
Description copied from interface: BranchDetectionService
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)

Specified by:
getOpenBranches in interface BranchDetectionService
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


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.