com.atlassian.bamboo.build.creation
Class BuildPlanCreationServiceImpl

java.lang.Object
  extended by com.atlassian.bamboo.build.creation.BuildPlanCreationServiceImpl
All Implemented Interfaces:
BuildPlanCreationService

public class BuildPlanCreationServiceImpl
extends java.lang.Object
implements BuildPlanCreationService


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.bamboo.build.creation.BuildPlanCreationService
BuildPlanCreationService.EnablePlan
 
Field Summary
static java.util.regex.Pattern BUILD_KEY_PATTERN
           
static java.lang.String ILLEGAL_NAME_CHARACTERS
           
static java.util.regex.Pattern PROJECT_KEY_PATTERN
           
 
Constructor Summary
BuildPlanCreationServiceImpl(ProjectManager projectManager, BuildManager buildManager, RepositoryManager repositoryManager, BuildStrategyManager buildStrategyManager, NotificationManager notificationManager, BuildDefinitionConverter buildDefinitionConverter, HibernateMutableAclService aclService, com.atlassian.event.EventManager eventManager, com.opensymphony.xwork.TextProvider textProvider)
           
 
Method Summary
 void addNewRequirementForBuilder(BuildConfiguration buildConfiguration, java.lang.String selectedLabel, Builder selectedBuilder, RequirementSet requirementSet)
          Adds the default requirements from the selected builder & label
 void addNotificationRule(Build build, NotificationRule newRule)
          Add a notification to the build's noticatin set.
 void cloneBuildPlan(BuildCreationBean buildCreationBean, java.lang.String buildKeyToClone, java.lang.String planOwner)
          Clones the passe plan into the BuildCreationBean
 BuildConfiguration newBuildConfigurationWithDefaults()
          Instantiates a new BuildConfiguration, running through the Repository and Builder to generate the defaults
 BuildConfiguration newBuildConfigurationWithNoDefaults()
          Instantiates a new BuildConfiguration
 Build newBuildPlan()
          Returns a new autowired build plan
 void persistPlanToDatabase(BuildCreationBean buildCreationBean)
          Takes a BuildCreationBean and persists a plan.
 void persistPlanToDatabase(BuildCreationBean buildCreationBean, BuildPlanCreationService.EnablePlan enablePlan)
          Takes a BuildCreationBean and persists a plan, optionall disabling the plan on creation
 void removeRequirementsForBuilder(BuildConfiguration buildConfiguration, java.lang.String builderLabel, Builder builder, RequirementSet requirementSet)
          Removes the default requirements from the selected builder & label
 void setBuilder(BuildCreationBean buildCreationBean, Builder builder, java.lang.String label)
          Sets the Builder in the BuildCreationBean.getBuildBeingCreated()
 void setBuildStrategy(BuildCreationBean buildCreationBean, BuildStrategy buildStrategy)
          Sets the BuildStrategy in BuildCreationBean.getBuildBeingCreated()
 void setRepository(BuildCreationBean buildCreationBean, Repository repository)
          Sets the Repository in BuildCreationBean.getBuildBeingCreated()
 void setWebRepositoryViewer(BuildCreationBean buildCreationBean, WebRepositoryViewer webRepositoryViewer)
          Sets the WebRepositoryViewer in BuildCreationBean.getBuildBeingCreated()
 void validateNewBuildForExistingProject(com.opensymphony.xwork.ValidationAware validationAware, java.lang.String existingProjectKey, java.lang.String buildKey, java.lang.String buildName)
          Validate that name new plan is unique within the project
 void validateNewPlanDetails(com.opensymphony.xwork.ValidationAware validationAware, java.lang.String buildKey, java.lang.String buildName)
          Ensure that the build key & name are valid
 void validateNewProjectDetails(com.opensymphony.xwork.ValidationAware validationAware, java.lang.String projectName, java.lang.String projectKey)
          Validate that the new project details are valid
 void validatePlanKey(com.opensymphony.xwork.ValidationAware validationAware, java.lang.String planKeyField, java.lang.String planKey)
          Ensure that the plan key is valid
 void validatePlanName(com.opensymphony.xwork.ValidationAware validationAware, java.lang.String planNameField, java.lang.String planName)
          Ensure that the plan name is valid
 void validatePlanToCloneExists(com.opensymphony.xwork.ValidationAware validationAware, java.lang.String buildKeyToClone)
          Validate that the plan t clone exists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ILLEGAL_NAME_CHARACTERS

public static final java.lang.String ILLEGAL_NAME_CHARACTERS
See Also:
Constant Field Values

BUILD_KEY_PATTERN

public static final java.util.regex.Pattern BUILD_KEY_PATTERN

PROJECT_KEY_PATTERN

public static final java.util.regex.Pattern PROJECT_KEY_PATTERN
Constructor Detail

BuildPlanCreationServiceImpl

public BuildPlanCreationServiceImpl(ProjectManager projectManager,
                                    BuildManager buildManager,
                                    RepositoryManager repositoryManager,
                                    BuildStrategyManager buildStrategyManager,
                                    NotificationManager notificationManager,
                                    BuildDefinitionConverter buildDefinitionConverter,
                                    HibernateMutableAclService aclService,
                                    com.atlassian.event.EventManager eventManager,
                                    com.opensymphony.xwork.TextProvider textProvider)
Method Detail

validatePlanKey

public void validatePlanKey(@NotNull
                            com.opensymphony.xwork.ValidationAware validationAware,
                            @NotNull
                            java.lang.String planKeyField,
                            @Nullable
                            java.lang.String planKey)
Description copied from interface: BuildPlanCreationService
Ensure that the plan key is valid

Specified by:
validatePlanKey in interface BuildPlanCreationService
Parameters:
validationAware - Action to be fed with possible validation errors
planKeyField - Name of the UI field for plan key
planKey - Plan key

validatePlanName

public void validatePlanName(@NotNull
                             com.opensymphony.xwork.ValidationAware validationAware,
                             @NotNull
                             java.lang.String planNameField,
                             @Nullable
                             java.lang.String planName)
Description copied from interface: BuildPlanCreationService
Ensure that the plan name is valid

Specified by:
validatePlanName in interface BuildPlanCreationService
Parameters:
validationAware - Action to be fed with possible validation errors
planNameField - Name of the UI field for plan name
planName - Plan name

validatePlanToCloneExists

public void validatePlanToCloneExists(@NotNull
                                      com.opensymphony.xwork.ValidationAware validationAware,
                                      @Nullable
                                      java.lang.String buildKeyToClone)
Description copied from interface: BuildPlanCreationService
Validate that the plan t clone exists

Specified by:
validatePlanToCloneExists in interface BuildPlanCreationService

validateNewPlanDetails

public void validateNewPlanDetails(@NotNull
                                   com.opensymphony.xwork.ValidationAware validationAware,
                                   java.lang.String buildKey,
                                   java.lang.String buildName)
Description copied from interface: BuildPlanCreationService
Ensure that the build key & name are valid

Specified by:
validateNewPlanDetails in interface BuildPlanCreationService

validateNewBuildForExistingProject

public void validateNewBuildForExistingProject(@NotNull
                                               com.opensymphony.xwork.ValidationAware validationAware,
                                               java.lang.String existingProjectKey,
                                               java.lang.String buildKey,
                                               java.lang.String buildName)
Description copied from interface: BuildPlanCreationService
Validate that name new plan is unique within the project

Specified by:
validateNewBuildForExistingProject in interface BuildPlanCreationService

validateNewProjectDetails

public void validateNewProjectDetails(@NotNull
                                      com.opensymphony.xwork.ValidationAware validationAware,
                                      java.lang.String projectName,
                                      java.lang.String projectKey)
Description copied from interface: BuildPlanCreationService
Validate that the new project details are valid

Specified by:
validateNewProjectDetails in interface BuildPlanCreationService

newBuildPlan

@NotNull
public Build newBuildPlan()
Description copied from interface: BuildPlanCreationService
Returns a new autowired build plan

Specified by:
newBuildPlan in interface BuildPlanCreationService
Returns:

persistPlanToDatabase

public void persistPlanToDatabase(@NotNull
                                  BuildCreationBean buildCreationBean)
                           throws PlanCreationDeniedException
Description copied from interface: BuildPlanCreationService
Takes a BuildCreationBean and persists a plan.

Specified by:
persistPlanToDatabase in interface BuildPlanCreationService
Throws:
PlanCreationDeniedException

persistPlanToDatabase

public void persistPlanToDatabase(@NotNull
                                  BuildCreationBean buildCreationBean,
                                  @NotNull
                                  BuildPlanCreationService.EnablePlan enablePlan)
                           throws PlanCreationDeniedException
Description copied from interface: BuildPlanCreationService
Takes a BuildCreationBean and persists a plan, optionall disabling the plan on creation

Specified by:
persistPlanToDatabase in interface BuildPlanCreationService
Throws:
PlanCreationDeniedException

setRepository

public void setRepository(@NotNull
                          BuildCreationBean buildCreationBean,
                          @NotNull
                          Repository repository)
                   throws PlanCreationException
Description copied from interface: BuildPlanCreationService
Sets the Repository in BuildCreationBean.getBuildBeingCreated()

Specified by:
setRepository in interface BuildPlanCreationService
Throws:
PlanCreationException

setWebRepositoryViewer

public void setWebRepositoryViewer(@NotNull
                                   BuildCreationBean buildCreationBean,
                                   @NotNull
                                   WebRepositoryViewer webRepositoryViewer)
                            throws PlanCreationException
Description copied from interface: BuildPlanCreationService
Sets the WebRepositoryViewer in BuildCreationBean.getBuildBeingCreated()

Specified by:
setWebRepositoryViewer in interface BuildPlanCreationService
Throws:
PlanCreationException

setBuilder

public void setBuilder(@NotNull
                       BuildCreationBean buildCreationBean,
                       @NotNull
                       Builder builder,
                       java.lang.String label)
                throws PlanCreationException
Description copied from interface: BuildPlanCreationService
Sets the Builder in the BuildCreationBean.getBuildBeingCreated()

Specified by:
setBuilder in interface BuildPlanCreationService
Throws:
PlanCreationException

addNotificationRule

public void addNotificationRule(@NotNull
                                Build build,
                                @NotNull
                                NotificationRule newRule)
Description copied from interface: BuildPlanCreationService
Add a notification to the build's noticatin set. You can add multiple times

Specified by:
addNotificationRule in interface BuildPlanCreationService

setBuildStrategy

public void setBuildStrategy(@NotNull
                             BuildCreationBean buildCreationBean,
                             @NotNull
                             BuildStrategy buildStrategy)
Description copied from interface: BuildPlanCreationService
Sets the BuildStrategy in BuildCreationBean.getBuildBeingCreated()

Specified by:
setBuildStrategy in interface BuildPlanCreationService

cloneBuildPlan

public void cloneBuildPlan(@NotNull
                           BuildCreationBean buildCreationBean,
                           @NotNull
                           java.lang.String buildKeyToClone,
                           @NotNull
                           java.lang.String planOwner)
                    throws PlanCreationException
Description copied from interface: BuildPlanCreationService
Clones the passe plan into the BuildCreationBean

Specified by:
cloneBuildPlan in interface BuildPlanCreationService
Throws:
PlanCreationException

newBuildConfigurationWithDefaults

@NotNull
public BuildConfiguration newBuildConfigurationWithDefaults()
Description copied from interface: BuildPlanCreationService
Instantiates a new BuildConfiguration, running through the Repository and Builder to generate the defaults

Specified by:
newBuildConfigurationWithDefaults in interface BuildPlanCreationService
Returns:

newBuildConfigurationWithNoDefaults

@NotNull
public BuildConfiguration newBuildConfigurationWithNoDefaults()
Description copied from interface: BuildPlanCreationService
Instantiates a new BuildConfiguration

Specified by:
newBuildConfigurationWithNoDefaults in interface BuildPlanCreationService
Returns:

addNewRequirementForBuilder

public void addNewRequirementForBuilder(@NotNull
                                        BuildConfiguration buildConfiguration,
                                        @NotNull
                                        java.lang.String selectedLabel,
                                        @NotNull
                                        Builder selectedBuilder,
                                        @NotNull
                                        RequirementSet requirementSet)
Description copied from interface: BuildPlanCreationService
Adds the default requirements from the selected builder & label

Specified by:
addNewRequirementForBuilder in interface BuildPlanCreationService

removeRequirementsForBuilder

public void removeRequirementsForBuilder(@NotNull
                                         BuildConfiguration buildConfiguration,
                                         @NotNull
                                         java.lang.String builderLabel,
                                         @NotNull
                                         Builder builder,
                                         @NotNull
                                         RequirementSet requirementSet)
Description copied from interface: BuildPlanCreationService
Removes the default requirements from the selected builder & label

Specified by:
removeRequirementsForBuilder in interface BuildPlanCreationService


Copyright © 2010 Atlassian. All Rights Reserved.