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
Modifier and TypeInterfaceDescriptionstatic enum
Enums for whether a plan, once created, will be enabled or disabled -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreatePlan
(@NotNull BuildConfiguration buildConfiguration, @NotNull ActionParametersMap actionParametersMap, @NotNull PlanCreationService.EnablePlan enabled) Creates a plan from its components and saves it to the databasesavePlan
(@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 Details
-
EXISTING_PROJECT_KEY
- See Also:
-
NEW_PROJECT_MARKER
- See Also:
-
PROJECT_KEY
- See Also:
-
PROJECT_NAME
- See Also:
-
PROJECT_DESCRIPTION
- See Also:
-
-
Method Details
-
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
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
-