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.
  • Field Details

  • 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 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

      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 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

      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