com.atlassian.bamboo.build.creation
Interface PlanCreationService

All Known Implementing Classes:
BuildCreationService, ChainCreationService, JobCreationService, PlanCreationTemplate

public interface PlanCreationService

Provides an way to create plans of any concrete type. Common code is handled by the PlanCreationTemplate and details specific to each concrete type are looked after in the individual implementations.


Nested Class Summary
static class PlanCreationService.EnablePlan
          Enums for whether a plan, once created, will be enabled or disabled
 
Method Summary
 java.lang.String createPlan(BuildConfiguration buildConfiguration, ActionParametersMap actionParametersMap, PlanCreationService.EnablePlan enabled)
          Creates a plan from its components and saves it to the database
 BuildConfiguration getBuildConfigurationWithDefaults()
           
 Plan getNewInstance()
           
 java.lang.String savePlan(PlanCreationBean planCreationBean)
          Saves a already created plan to the database
 void triggerCreationCompleteEvents(PlanKey planKey)
          Trigger the appropriate events after the plan has been saved successfully Calling this method is responsibility of class using this service.
 void validatePlan(com.opensymphony.xwork.ValidationAware validationAware, BuildConfiguration buildConfiguration, ActionParametersMap actionParametersMap)
          Validates plan details and build configuration details for initial plan creation.
 

Method Detail

getNewInstance

Plan getNewInstance()
Returns:
A new plan instance, concrete type determined by implementation classes

getBuildConfigurationWithDefaults

BuildConfiguration getBuildConfigurationWithDefaults()
Returns:
A buildConfiguration instance with the requried defaults populated

validatePlan

void validatePlan(com.opensymphony.xwork.ValidationAware validationAware,
                  BuildConfiguration buildConfiguration,
                  ActionParametersMap actionParametersMap)
Validates plan details and build configuration details for initial plan creation. Adds errors to the validationAware object.

Parameters:
validationAware - - object to add errors to (usually an action class)
buildConfiguration - - build configuration to validate
actionParametersMap - - parameter map containing any plan details not in the build configuration.

triggerCreationCompleteEvents

void triggerCreationCompleteEvents(PlanKey planKey)
Trigger the appropriate events after the plan has been saved successfully Calling this method is responsibility of class using this service.

Parameters:
planKey. -

createPlan

java.lang.String createPlan(BuildConfiguration buildConfiguration,
                            ActionParametersMap actionParametersMap,
                            PlanCreationService.EnablePlan enabled)
                            throws PlanCreationDeniedException,
                                   PlanCreationException
Creates a plan from its components and saves it to the database

Parameters:
buildConfiguration - of the plan to create
actionParametersMap - containing any other required params NOT in the buildConfiguration
enabled - whether the plan should start enabled or disabled
Returns:
the full key of the created plan
Throws:
PlanCreationDeniedException - if plan creation fails because you already have too many plans.
PlanCreationException - if plan creation fails for any other reason

savePlan

java.lang.String savePlan(PlanCreationBean planCreationBean)
                          throws PlanCreationDeniedException,
                                 PlanCreationException
Saves a already created plan to the database

Parameters:
planCreationBean - containing the required components for saving
Returns:
The full key of the build just created
Throws:
PlanCreationDeniedException - if plan creation fails because you already have too many plans.
PlanCreationException - if plan creation fails for any other reason


Copyright © 2010 Atlassian. All Rights Reserved.