Class ChainCreationServiceImpl
java.lang.Object
com.atlassian.bamboo.build.creation.PlanCreationTemplate
com.atlassian.bamboo.build.creation.ChainCreationServiceImpl
- All Implemented Interfaces:
ChainCreationService,PlanCreationService
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.bamboo.build.creation.PlanCreationService
PlanCreationService.EnablePlan -
Field Summary
Fields inherited from class com.atlassian.bamboo.build.creation.PlanCreationTemplate
aclUpdateHelper, artifactDefinitionManager, artifactSubscriptionManager, auditLogService, authenticationContext, bambooLicenseManager, branchCommitInformationManager, buildDefinitionConverter, eventPublisher, notificationManager, planManager, planValidationService, projectManager, repositoryDefinitionManager, triggerConfigurationService, variableDefinitionManager, vcsBranchManagerFields inherited from interface com.atlassian.bamboo.build.creation.ChainCreationService
BRANCH_DEPENDENCY_TRIGGER_CFG_KEY, CHAIN_DESCRIPTION, CHAIN_KEY, CHAIN_NAME, DEPENDENCIES_CONFIGURATION_PREFIX, PUBLIC_PLAN_ACCESS, RERUNNABLE, TRIGGER_DEPENDENCIES_ONLY_AFTER_ALL_STAGESFields inherited from interface com.atlassian.bamboo.build.creation.PlanCreationService
EXISTING_PROJECT_KEY, NEW_PROJECT_MARKER, PROJECT_DESCRIPTION, PROJECT_KEY, PROJECT_NAME -
Constructor Summary
ConstructorsConstructorDescriptionChainCreationServiceImpl(PlanManager planManager, ProjectManager projectManager, BambooAclUpdateHelper aclUpdateHelper, BambooAuthenticationContext authenticationContext, BambooLicenseManager bambooLicenseManager, HibernateMutableAclService aclService, PlanScheduler planScheduler, com.atlassian.event.api.EventPublisher eventPublisher, PlanValidationService planValidationService, AuditLogService auditLogService, BuildDefinitionConverter buildDefinitionConverter, NotificationManager notificationManager, JobCreationService jobCreationService, ArtifactDefinitionManager artifactDefinitionManager, ArtifactSubscriptionManager artifactSubscriptionManager, VariableDefinitionManager variableDefinitionManager, RepositoryDefinitionManager repositoryDefinitionManager, TaskConfigurationService taskConfigurationService, ScopedExclusionService scopedExclusionService, BranchCommitInformationManager branchCommitInformationManager, VcsBranchManager vcsBranchManager, BranchCreationFacade branchCreationFacade, TriggerConfigurationService triggerConfigurationService, PlanVcsRevisionHistoryService planVcsRevisionHistoryService, BuildNumberGeneratorService buildNumberGeneratorService, LabelManager labelManager, TransactionAndHibernateTemplate hibernateTemplate) -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanBuildConfiguration(@NotNull BuildConfiguration buildConfiguration, @NotNull Plan plan) Clean build configuration for saving.createPlan(@NotNull BuildConfiguration buildConfiguration, @NotNull ActionParametersMap params, @NotNull PlanCreationService.EnablePlan enabled) Creates a plan from its components and saves it to the databaseprotected org.acegisecurity.acls.MutableAclgetDefaultPermissionsForPlan(boolean accessForAllUsers) Generate the permissions to be stored against the plan on creation.protected booleanperformCloneIfRequired(@NotNull BuildConfiguration buildConfiguration, @NotNull PlanCreationBean planCreationBean, @NotNull ActionParametersMap params) Using the action parameters determine if cloning is required and if so, perform the clone.protected voidperformPostCreateAction(@NotNull Plan plan) Perform plan specific actions that need to be run immediately after plan creation.protected voidpostCreationSynchronisation(@NotNull PlanCreationBean planCreationBean) Perform any state synchronisation required after creating plan.protected voidprepareBuildConfiguration(@NotNull BuildConfiguration buildConfiguration, @NotNull Plan plan, @NotNull PlanCreationBean planCreationBean) Prepare build configuration for saving.protected voidsaveAndUpdateParents(@NotNull PlanCreationBean planCreationBean) Perform any necessary database operations required before saving the plan.protected voidsetFullPlanKey(@NotNull Plan plan) Set the full key for this planvoidtriggerCreationCompleteEvents(PlanKey planKey) Trigger the appropriate events after the plan has been saved successfully Calling this method is responsibility of class using this template.voidvalidateChainDetails(org.apache.struts2.interceptor.ValidationAware validationAware, ActionParametersMap params) voidvalidateCloneDetails(org.apache.struts2.interceptor.ValidationAware validationAware, ActionParametersMap params) voidvalidatePlan(org.apache.struts2.interceptor.ValidationAware validationAware, BuildConfiguration buildConfiguration, ActionParametersMap params) Validates plan details and build configuration details for initial plan creation.Methods inherited from class com.atlassian.bamboo.build.creation.PlanCreationTemplate
cleanBuildConfiguration, clonePlanPermissionsToSession, createPlan, logBuildConfiguration, saveAndUpdateParents, savePlan, validateThrowingPlanCreationExceptionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.bamboo.build.creation.PlanCreationService
savePlan
-
Constructor Details
-
ChainCreationServiceImpl
public ChainCreationServiceImpl(PlanManager planManager, ProjectManager projectManager, BambooAclUpdateHelper aclUpdateHelper, BambooAuthenticationContext authenticationContext, BambooLicenseManager bambooLicenseManager, HibernateMutableAclService aclService, PlanScheduler planScheduler, com.atlassian.event.api.EventPublisher eventPublisher, PlanValidationService planValidationService, AuditLogService auditLogService, BuildDefinitionConverter buildDefinitionConverter, NotificationManager notificationManager, JobCreationService jobCreationService, ArtifactDefinitionManager artifactDefinitionManager, ArtifactSubscriptionManager artifactSubscriptionManager, VariableDefinitionManager variableDefinitionManager, RepositoryDefinitionManager repositoryDefinitionManager, TaskConfigurationService taskConfigurationService, ScopedExclusionService scopedExclusionService, BranchCommitInformationManager branchCommitInformationManager, VcsBranchManager vcsBranchManager, BranchCreationFacade branchCreationFacade, TriggerConfigurationService triggerConfigurationService, PlanVcsRevisionHistoryService planVcsRevisionHistoryService, BuildNumberGeneratorService buildNumberGeneratorService, LabelManager labelManager, TransactionAndHibernateTemplate hibernateTemplate)
-
-
Method Details
-
validatePlan
public void validatePlan(org.apache.struts2.interceptor.ValidationAware validationAware, BuildConfiguration buildConfiguration, ActionParametersMap params) Description copied from interface:PlanCreationServiceValidates plan details and build configuration details for initial plan creation. Adds errors to the validationAware object.- Specified by:
validatePlanin interfacePlanCreationService- Parameters:
validationAware- - object to add errors to (usually an action class)buildConfiguration- - build configuration to validateparams- - parameter map containing any plan details not in the build configuration.
-
validateChainDetails
public void validateChainDetails(org.apache.struts2.interceptor.ValidationAware validationAware, ActionParametersMap params) - Specified by:
validateChainDetailsin interfaceChainCreationService
-
validateCloneDetails
public void validateCloneDetails(org.apache.struts2.interceptor.ValidationAware validationAware, ActionParametersMap params) - Specified by:
validateCloneDetailsin interfaceChainCreationService
-
getNewInstance
- Specified by:
getNewInstancein interfacePlanCreationService- Returns:
- A new plan instance, concrete type determined by implementation classes
-
getDefaultPermissionsForPlan
protected org.acegisecurity.acls.MutableAcl getDefaultPermissionsForPlan(boolean accessForAllUsers) Description copied from class:PlanCreationTemplateGenerate the permissions to be stored against the plan on creation.- Specified by:
getDefaultPermissionsForPlanin classPlanCreationTemplate- Parameters:
accessForAllUsers- anyone that can access Bamboo instance (logged-in users and depending on configuration anonymous) will be able to view this plan.- Returns:
- the permissions to be stored against the plan on creation
-
getBuildConfigurationWithDefaults
- Specified by:
getBuildConfigurationWithDefaultsin interfacePlanCreationService- Returns:
- A buildConfiguration instance with the required defaults populated
-
performCloneIfRequired
protected boolean performCloneIfRequired(@NotNull @NotNull BuildConfiguration buildConfiguration, @NotNull @NotNull PlanCreationBean planCreationBean, @NotNull @NotNull ActionParametersMap params) throws PlanCreationDeniedException Description copied from class:PlanCreationTemplateUsing the action parameters determine if cloning is required and if so, perform the clone. Cloned details are put in the PlanCreationBean.- Specified by:
performCloneIfRequiredin classPlanCreationTemplate- Parameters:
buildConfiguration- for any extra configuration to override when cloningplanCreationBean- containing the plan and acls (currently does not contain buildConfiguration)params- containing any properties provided from the UI- Returns:
- true if cloning has been completed
- Throws:
PlanCreationDeniedException- if cloning required but can't be completed due to licensing restrictions
-
prepareBuildConfiguration
protected void prepareBuildConfiguration(@NotNull @NotNull BuildConfiguration buildConfiguration, @NotNull @NotNull Plan plan, @NotNull @NotNull PlanCreationBean planCreationBean) Description copied from class:PlanCreationTemplatePrepare build configuration for saving. Only occurs if cloning did NOT occur.- Specified by:
prepareBuildConfigurationin classPlanCreationTemplate- Parameters:
buildConfiguration- the current build configuration.plan- the current plan (will already have details populated)
-
cleanBuildConfiguration
public void cleanBuildConfiguration(@NotNull @NotNull BuildConfiguration buildConfiguration, @NotNull @NotNull Plan plan) Description copied from class:PlanCreationTemplateClean build configuration for saving. Build Config may have been cloned.- Specified by:
cleanBuildConfigurationin interfaceChainCreationService- Specified by:
cleanBuildConfigurationin classPlanCreationTemplate- Parameters:
buildConfiguration- the current build configuration.plan- the current plan (will already have details populated)
-
createPlan
public String createPlan(@NotNull @NotNull BuildConfiguration buildConfiguration, @NotNull @NotNull ActionParametersMap params, @NotNull @NotNull PlanCreationService.EnablePlan enabled) throws PlanCreationDeniedException, PlanCreationException Description copied from interface:PlanCreationServiceCreates a plan from its components and saves it to the database- Specified by:
createPlanin interfacePlanCreationService- Parameters:
buildConfiguration- of the plan to createparams- 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
-
setFullPlanKey
Description copied from class:PlanCreationTemplateSet the full key for this plan- Specified by:
setFullPlanKeyin classPlanCreationTemplate- Parameters:
plan- - complete plan to be saved
-
saveAndUpdateParents
Description copied from class:PlanCreationTemplatePerform any necessary database operations required before saving the plan. E.g. creation of new projects.- Specified by:
saveAndUpdateParentsin classPlanCreationTemplate- Parameters:
planCreationBean- plan creation bean
-
postCreationSynchronisation
Description copied from class:PlanCreationTemplatePerform any state synchronisation required after creating plan. E.g. updating collections.- Specified by:
postCreationSynchronisationin classPlanCreationTemplate- Parameters:
planCreationBean-
-
performPostCreateAction
Description copied from class:PlanCreationTemplatePerform plan specific actions that need to be run immediately after plan creation.- Specified by:
performPostCreateActionin classPlanCreationTemplate- Parameters:
plan- created plan
-
triggerCreationCompleteEvents
Description copied from class:PlanCreationTemplateTrigger the appropriate events after the plan has been saved successfully Calling this method is responsibility of class using this template.- Specified by:
triggerCreationCompleteEventsin interfacePlanCreationService- Specified by:
triggerCreationCompleteEventsin classPlanCreationTemplate- Parameters:
planKey-
-