public class ChainCreationServiceImpl extends PlanCreationTemplate implements ChainCreationService
PlanCreationService.EnablePlanaclUpdateHelper, artifactDefinitionManager, artifactSubscriptionManager, auditLogService, authenticationContext, bambooLicenseManager, branchCommitInformationManager, buildDefinitionConverter, eventPublisher, notificationManager, planManager, planValidationService, projectManager, repositoryDefinitionManager, triggerConfigurationService, variableDefinitionManager, vcsBranchManagerBRANCH_DEPENDENCY_TRIGGER_CFG_KEY, CHAIN_DESCRIPTION, CHAIN_KEY, CHAIN_NAME, DEPENDENCIES_CONFIGURATION_PREFIX, PUBLIC_PLAN_ACCESS, TRIGGER_DEPENDENCIES_ONLY_AFTER_ALL_STAGESEXISTING_PROJECT_KEY, NEW_PROJECT_MARKER, PROJECT_DESCRIPTION, PROJECT_KEY, PROJECT_NAME| Constructor and Description |
|---|
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,
BranchDetectionService branchDetectionService,
TriggerConfigurationService triggerConfigurationService,
PlanVcsRevisionHistoryService planVcsRevisionHistoryService,
BuildNumberGeneratorService buildNumberGeneratorService,
LabelManager labelManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanBuildConfiguration(BuildConfiguration buildConfiguration,
Plan plan)
Clean build configuration for saving.
|
String |
createPlan(BuildConfiguration buildConfiguration,
ActionParametersMap params,
PlanCreationService.EnablePlan enabled)
Creates a plan from its components and saves it to the database
|
BuildConfiguration |
getBuildConfigurationWithDefaults() |
protected org.acegisecurity.acls.MutableAcl |
getDefaultPermissionsForPlan(boolean accessForAllUsers)
Generate the permissions to be stored against the plan on creation.
|
Chain |
getNewInstance() |
protected boolean |
performCloneIfRequired(BuildConfiguration buildConfiguration,
PlanCreationBean planCreationBean,
ActionParametersMap params)
Using the action parameters determine if cloning is required and if so, perform the clone.
|
protected void |
performPostCreateAction(Plan plan)
Perform plan specific actions that need to be run immediately after plan creation.
|
protected void |
prepareBuildConfiguration(BuildConfiguration buildConfiguration,
Plan plan,
PlanCreationBean planCreationBean)
Prepare build configuration for saving.
|
protected void |
saveAndUpdateParents(PlanCreationBean planCreationBean)
Perform any necessary database operations required before saving the plan.
|
protected void |
setFullPlanKey(Plan plan)
Set the full key for this plan
|
void |
triggerCreationCompleteEvents(PlanKey planKey)
Trigger the appropriate events after the plan has been saved successfully
Calling this method is responsibility of class using this template.
|
void |
validateChainDetails(com.atlassian.struts.ValidationAware validationAware,
ActionParametersMap params) |
void |
validateChainDetails(com.opensymphony.xwork.ValidationAware validationAware,
ActionParametersMap params) |
void |
validateCloneDetails(com.atlassian.struts.ValidationAware validationAware,
ActionParametersMap params) |
void |
validateCloneDetails(com.opensymphony.xwork.ValidationAware validationAware,
ActionParametersMap params) |
void |
validatePlan(com.atlassian.struts.ValidationAware validationAware,
BuildConfiguration buildConfiguration,
ActionParametersMap params)
Validates plan details and build configuration details for initial plan creation.
|
cleanBuildConfiguration, clonePlanPermissionsToSession, createPlan, logBuildConfiguration, saveAndUpdateParents, savePlan, validateThrowingPlanCreationExceptionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsavePlanpublic 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, BranchDetectionService branchDetectionService, TriggerConfigurationService triggerConfigurationService, PlanVcsRevisionHistoryService planVcsRevisionHistoryService, BuildNumberGeneratorService buildNumberGeneratorService, LabelManager labelManager)
public void validatePlan(com.atlassian.struts.ValidationAware validationAware,
BuildConfiguration buildConfiguration,
ActionParametersMap params)
PlanCreationServicevalidatePlan in interface PlanCreationServicevalidationAware - - 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.public void validateChainDetails(com.atlassian.struts.ValidationAware validationAware,
ActionParametersMap params)
validateChainDetails in interface ChainCreationServicepublic void validateCloneDetails(com.atlassian.struts.ValidationAware validationAware,
ActionParametersMap params)
validateCloneDetails in interface ChainCreationServicepublic Chain getNewInstance()
getNewInstance in interface PlanCreationServiceprotected org.acegisecurity.acls.MutableAcl getDefaultPermissionsForPlan(boolean accessForAllUsers)
PlanCreationTemplategetDefaultPermissionsForPlan in class PlanCreationTemplateaccessForAllUsers - anyone that can access Bamboo instance
(logged-in users and depending on configuration anonymous)
will be able to view this plan.public BuildConfiguration getBuildConfigurationWithDefaults()
getBuildConfigurationWithDefaults in interface PlanCreationServiceprotected boolean performCloneIfRequired(@NotNull
BuildConfiguration buildConfiguration,
@NotNull
PlanCreationBean planCreationBean,
@NotNull
ActionParametersMap params)
throws PlanCreationDeniedException
PlanCreationTemplateperformCloneIfRequired in class PlanCreationTemplatebuildConfiguration - 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 UIPlanCreationDeniedException - if cloning required but can't be completed due to licensing restrictionsprotected void prepareBuildConfiguration(@NotNull
BuildConfiguration buildConfiguration,
@NotNull
Plan plan,
@NotNull
PlanCreationBean planCreationBean)
PlanCreationTemplateprepareBuildConfiguration in class PlanCreationTemplatebuildConfiguration - the current build configuration.plan - the current plan (will already have details populated)public void cleanBuildConfiguration(@NotNull
BuildConfiguration buildConfiguration,
@NotNull
Plan plan)
PlanCreationTemplatecleanBuildConfiguration in interface ChainCreationServicecleanBuildConfiguration in class PlanCreationTemplatebuildConfiguration - the current build configuration.plan - the current plan (will already have details populated)public String createPlan(@NotNull BuildConfiguration buildConfiguration, @NotNull ActionParametersMap params, @NotNull PlanCreationService.EnablePlan enabled) throws PlanCreationDeniedException, PlanCreationException
PlanCreationServicecreatePlan in interface PlanCreationServicebuildConfiguration - of the plan to createparams - containing any other required params NOT in the buildConfigurationenabled - whether the plan should start enabled or disabledPlanCreationDeniedException - if plan creation fails because you already have too many plans.PlanCreationException - if plan creation fails for any other reasonprotected void setFullPlanKey(@NotNull
Plan plan)
PlanCreationTemplatesetFullPlanKey in class PlanCreationTemplateplan - - complete plan to be savedprotected void saveAndUpdateParents(@NotNull
PlanCreationBean planCreationBean)
PlanCreationTemplatesaveAndUpdateParents in class PlanCreationTemplateplanCreationBean - plan creation beanprotected void performPostCreateAction(@NotNull
Plan plan)
PlanCreationTemplateperformPostCreateAction in class PlanCreationTemplateplan - created planpublic void triggerCreationCompleteEvents(PlanKey planKey)
PlanCreationTemplatetriggerCreationCompleteEvents in interface PlanCreationServicetriggerCreationCompleteEvents in class PlanCreationTemplatepublic void validateChainDetails(com.opensymphony.xwork.ValidationAware validationAware,
ActionParametersMap params)
validateChainDetails in interface ChainCreationServicepublic void validateCloneDetails(com.opensymphony.xwork.ValidationAware validationAware,
ActionParametersMap params)
validateCloneDetails in interface ChainCreationServiceCopyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.