Interface PlanCreationService
-
- All Known Subinterfaces:
ChainBranchCreationService
,ChainCreationService
,JobCreationService
- All Known Implementing Classes:
ChainBranchCreationServiceImpl
,ChainCreationServiceImpl
,JobCreationServiceImpl
,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
Nested Classes Modifier and Type Interface Description static class
PlanCreationService.EnablePlan
Enums for whether a plan, once created, will be enabled or disabled
-
Field Summary
Fields Modifier and Type Field Description static String
EXISTING_PROJECT_KEY
static String
NEW_PROJECT_MARKER
static String
PROJECT_DESCRIPTION
static String
PROJECT_KEY
static String
PROJECT_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
createPlan(@NotNull BuildConfiguration buildConfiguration, @NotNull ActionParametersMap actionParametersMap, @NotNull PlanCreationService.EnablePlan enabled)
Creates a plan from its components and saves it to the databaseBuildConfiguration
getBuildConfigurationWithDefaults()
Plan
getNewInstance()
String
savePlan(@NotNull PlanCreationBean planCreationBean)
Saves a already created plan to the databasevoid
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.atlassian.struts.ValidationAware validationAware, BuildConfiguration buildConfiguration, ActionParametersMap actionParametersMap)
Validates plan details and build configuration details for initial plan creation.
-
-
-
Field Detail
-
EXISTING_PROJECT_KEY
static final String EXISTING_PROJECT_KEY
- See Also:
- Constant Field Values
-
NEW_PROJECT_MARKER
static final String NEW_PROJECT_MARKER
- See Also:
- Constant Field Values
-
PROJECT_KEY
static final String PROJECT_KEY
- See Also:
- Constant Field Values
-
PROJECT_NAME
static final String PROJECT_NAME
- See Also:
- Constant Field Values
-
PROJECT_DESCRIPTION
static final String PROJECT_DESCRIPTION
- See Also:
- Constant Field Values
-
-
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 required defaults populated
-
validatePlan
void validatePlan(com.atlassian.struts.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 validateactionParametersMap
- - 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
String createPlan(@NotNull @NotNull BuildConfiguration buildConfiguration, @NotNull @NotNull ActionParametersMap actionParametersMap, @NotNull @NotNull PlanCreationService.EnablePlan enabled) throws PlanCreationDeniedException, PlanCreationException
Creates a plan from its components and saves it to the database- Parameters:
buildConfiguration
- of the plan to createactionParametersMap
- containing any other required params NOT in the buildConfigurationenabled
- 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
String savePlan(@NotNull @NotNull 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
-
-