com.atlassian.bamboo.build.strategy
Class BuildStrategyConfigurationServiceImpl

java.lang.Object
  extended by com.atlassian.bamboo.build.strategy.BuildStrategyConfigurationServiceImpl
All Implemented Interfaces:
BuildStrategyConfigurationService

public class BuildStrategyConfigurationServiceImpl
extends java.lang.Object
implements BuildStrategyConfigurationService


Field Summary
 
Fields inherited from interface com.atlassian.bamboo.build.strategy.BuildStrategyConfigurationService
NEW_REPOSITORY_INDICATOR
 
Constructor Summary
BuildStrategyConfigurationServiceImpl(BuildDefinitionManager buildDefinitionManager, BuildStrategyManager buildStrategyManager, com.opensymphony.xwork.TextProvider textProvider, PlanManager planManager, AuditLogService auditLogService, ScopedExclusionService scopedExclusionService)
           
 
Method Summary
 void addTriggeringRepository(Chain chain, long repositoryId)
          Updates all repository aware triggers of Chain by adding a new repository.
 BuildStrategy createBuildStrategy(PlanKey planKey, java.lang.String userDescription, java.util.Set<java.lang.Long> triggeringRepositories, org.apache.commons.configuration.HierarchicalConfiguration configuration)
          Creates a BuildStrategy and saves it in Chain configuration.
 void deleteBuildStrategy(PlanKey planKey, long buildStrategyId)
          Delete a given BuildStrategy from Chain configuration.
 BuildStrategy editBuildStrategy(PlanKey planKey, long buildStrategyId, java.lang.String userDescription, java.util.Set<java.lang.Long> triggeringRepositories, org.apache.commons.configuration.HierarchicalConfiguration configuration)
          Update the details of specific build strategy
protected  BuildStrategy getBuildStrategyById(java.util.List<BuildStrategy> tasks, long id)
           
 void updateRepositoryIdsInTriggers(Chain chain, java.util.Map<java.lang.Long,java.lang.Long> repositoryIdsChanges)
          Updates Chain configurations affected by repository edition.
 void updateRepositoryIdsInTriggers(Chain chain, java.util.Map<java.lang.Long,java.lang.Long> repositoryIdsChanges, boolean withQuartzJobRestart)
          Updates Chain configurations affected by repository edition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildStrategyConfigurationServiceImpl

public BuildStrategyConfigurationServiceImpl(@NotNull
                                             BuildDefinitionManager buildDefinitionManager,
                                             @NotNull
                                             BuildStrategyManager buildStrategyManager,
                                             @NotNull
                                             com.opensymphony.xwork.TextProvider textProvider,
                                             @NotNull
                                             PlanManager planManager,
                                             @NotNull
                                             AuditLogService auditLogService,
                                             @NotNull
                                             ScopedExclusionService scopedExclusionService)
Method Detail

getBuildStrategyById

@Nullable
protected BuildStrategy getBuildStrategyById(@NotNull
                                                      java.util.List<BuildStrategy> tasks,
                                                      long id)

createBuildStrategy

public BuildStrategy createBuildStrategy(@NotNull
                                         PlanKey planKey,
                                         @NotNull
                                         java.lang.String userDescription,
                                         @NotNull
                                         java.util.Set<java.lang.Long> triggeringRepositories,
                                         @NotNull
                                         org.apache.commons.configuration.HierarchicalConfiguration configuration)
                                  throws java.lang.IllegalArgumentException
Description copied from interface: BuildStrategyConfigurationService
Creates a BuildStrategy and saves it in Chain configuration.

Specified by:
createBuildStrategy in interface BuildStrategyConfigurationService
Parameters:
planKey - of the plan to add the build strategy to, plan should be Chain
Throws:
java.lang.IllegalArgumentException - if planKey is invalid (e.g. doesn't exist or is not a Chain)

deleteBuildStrategy

public void deleteBuildStrategy(@NotNull
                                PlanKey planKey,
                                long buildStrategyId)
                         throws java.lang.IllegalArgumentException,
                                java.lang.IllegalStateException
Description copied from interface: BuildStrategyConfigurationService
Delete a given BuildStrategy from Chain configuration.

Specified by:
deleteBuildStrategy in interface BuildStrategyConfigurationService
Parameters:
planKey - for the plan to delete the Build Strategy from.
buildStrategyId - of the Build Strategy to delete.
Throws:
java.lang.IllegalArgumentException - if planKey is invalid (e.g. doesn't exist or is not a Chain),
java.lang.IllegalStateException - if the build strategy list has changed since submitting request, i.e the build strategy isn't there to delete anymore.

editBuildStrategy

public BuildStrategy editBuildStrategy(@NotNull
                                       PlanKey planKey,
                                       long buildStrategyId,
                                       @NotNull
                                       java.lang.String userDescription,
                                       @NotNull
                                       java.util.Set<java.lang.Long> triggeringRepositories,
                                       @NotNull
                                       org.apache.commons.configuration.HierarchicalConfiguration configuration)
                                throws java.lang.IllegalArgumentException,
                                       java.lang.IllegalStateException
Description copied from interface: BuildStrategyConfigurationService
Update the details of specific build strategy

Specified by:
editBuildStrategy in interface BuildStrategyConfigurationService
Parameters:
planKey - - the plan the build strategy belongs to, must be a chain
buildStrategyId - - the taskDefinition to edit
Returns:
BuildStrategy with updates.
Throws:
java.lang.IllegalArgumentException - if planKey or taskId is invalid.
java.lang.IllegalStateException - if if the build strategy list has changed since submitting request, i.e the build strategy isn't there to edit anymore.

updateRepositoryIdsInTriggers

public void updateRepositoryIdsInTriggers(@NotNull
                                          Chain chain,
                                          java.util.Map<java.lang.Long,java.lang.Long> repositoryIdsChanges,
                                          boolean withQuartzJobRestart)
Description copied from interface: BuildStrategyConfigurationService
Updates Chain configurations affected by repository edition. If map contains entry for NEW_REPOSITORY_INDICATOR this repository is added to all the triggers.

Specified by:
updateRepositoryIdsInTriggers in interface BuildStrategyConfigurationService
repositoryIdsChanges - mapping between old and new repositories ids
withQuartzJobRestart - indicates if respective polling jobs should be (re)started

updateRepositoryIdsInTriggers

public void updateRepositoryIdsInTriggers(@NotNull
                                          Chain chain,
                                          java.util.Map<java.lang.Long,java.lang.Long> repositoryIdsChanges)
Description copied from interface: BuildStrategyConfigurationService
Updates Chain configurations affected by repository edition. If map contains entry for NEW_REPOSITORY_INDICATOR this repository is added to all the triggers.

Specified by:
updateRepositoryIdsInTriggers in interface BuildStrategyConfigurationService
repositoryIdsChanges - mapping between old and new repositories ids

addTriggeringRepository

public void addTriggeringRepository(@NotNull
                                    Chain chain,
                                    long repositoryId)
Description copied from interface: BuildStrategyConfigurationService
Updates all repository aware triggers of Chain by adding a new repository.

Specified by:
addTriggeringRepository in interface BuildStrategyConfigurationService


Copyright © 2012 Atlassian. All Rights Reserved.