public class ChainBranchCreationServiceImpl extends PlanCreationTemplate implements ChainBranchCreationService
PlanCreationService.EnablePlan
aclUpdateHelper, artifactDefinitionManager, artifactSubscriptionManager, auditLogService, authenticationContext, bambooLicenseManager, branchCommitInformationManager, buildDefinitionConverter, eventPublisher, notificationManager, planManager, planValidationService, projectManager, repositoryDefinitionManager, triggerConfigurationService, variableDefinitionManager, vcsBranchManager
EXPIRY_OFF
EXISTING_PROJECT_KEY, NEW_PROJECT_MARKER, PROJECT_KEY, PROJECT_NAME
Constructor and Description |
---|
ChainBranchCreationServiceImpl(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 exclusionService,
ChainBranchManager chainBranchManager,
BranchCommitInformationManager branchCommitInformationManager,
VcsBranchManager vcsBranchManager,
TriggerConfigurationService triggerConfigurationService,
BuildNumberGeneratorService buildNumberGeneratorService,
JiraBranchLinkingService jiraBranchLinkingService,
TestQuarantineManager testQuarantineManager,
TestsManager testsManager,
PlanVcsRevisionHistoryService planVcsRevisionHistoryService) |
Modifier and Type | Method and Description |
---|---|
void |
cleanBuildConfiguration(BuildConfiguration buildConfiguration,
Plan plan)
Clean build configuration for saving.
|
String |
createPlan(BuildConfiguration buildConfiguration,
ActionParametersMap actionParametersMap,
PlanCreationService.EnablePlan enabled)
Creates a plan from its components and saves it to the database
|
BuildConfiguration |
getBuildConfigurationWithDefaults() |
protected org.acegisecurity.acls.MutableAcl |
getDefaultPermissionsForPlan()
Generate the permissions to be stored against the plan on creation
|
ChainBranch |
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 boolean |
performCloneIfRequired(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 |
preparePlanDetails(Plan planBranch,
ActionParametersMap params)
Prepare the plan object for saving.
|
protected void |
saveAndUpdateParents(Plan plan)
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 |
validatePlan(com.atlassian.struts.ValidationAware validationAware,
BuildConfiguration buildConfiguration,
ActionParametersMap params)
Validates plan details and build configuration details for initial plan creation.
|
void |
validatePlan(com.opensymphony.xwork.ValidationAware validationAware,
BuildConfiguration buildConfiguration,
ActionParametersMap actionParametersMap) |
cleanBuildConfiguration, clonePlanPermissionsToSession, logBuildConfiguration, savePlan, validateThrowingPlanCreationException
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
savePlan
public ChainBranchCreationServiceImpl(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 exclusionService, ChainBranchManager chainBranchManager, BranchCommitInformationManager branchCommitInformationManager, VcsBranchManager vcsBranchManager, TriggerConfigurationService triggerConfigurationService, BuildNumberGeneratorService buildNumberGeneratorService, JiraBranchLinkingService jiraBranchLinkingService, TestQuarantineManager testQuarantineManager, TestsManager testsManager, PlanVcsRevisionHistoryService planVcsRevisionHistoryService)
public void validatePlan(com.atlassian.struts.ValidationAware validationAware, BuildConfiguration buildConfiguration, ActionParametersMap params)
PlanCreationService
validatePlan
in interface PlanCreationService
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.public ChainBranch getNewInstance()
getNewInstance
in interface PlanCreationService
protected org.acegisecurity.acls.MutableAcl getDefaultPermissionsForPlan()
PlanCreationTemplate
getDefaultPermissionsForPlan
in class PlanCreationTemplate
public BuildConfiguration getBuildConfigurationWithDefaults()
getBuildConfigurationWithDefaults
in interface PlanCreationService
protected void preparePlanDetails(@NotNull Plan planBranch, @NotNull ActionParametersMap params)
PlanCreationTemplate
preparePlanDetails
in class PlanCreationTemplate
planBranch
- to add properties toparams
- containing any properties provided from the UI.protected boolean performCloneIfRequired(@NotNull PlanCreationBean planCreationBean, @NotNull ActionParametersMap params) throws PlanCreationException, PlanCreationDeniedException
PlanCreationTemplate
performCloneIfRequired
in class PlanCreationTemplate
planCreationBean
- containing the plan and acls (currently does not contain buildConfiguration)params
- containing any properties provided from the UIPlanCreationException
- if cloning is required but fails.PlanCreationDeniedException
- if cloning required but can't be completed due to licensing restrictionsprotected boolean performCloneIfRequired(@NotNull BuildConfiguration buildConfiguration, @NotNull PlanCreationBean planCreationBean, @NotNull ActionParametersMap params) throws PlanCreationDeniedException
PlanCreationTemplate
performCloneIfRequired
in class PlanCreationTemplate
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 UIPlanCreationDeniedException
- if cloning required but can't be completed due to licensing restrictionsprotected void prepareBuildConfiguration(@NotNull BuildConfiguration buildConfiguration, @NotNull Plan plan, @NotNull PlanCreationBean planCreationBean)
PlanCreationTemplate
prepareBuildConfiguration
in class PlanCreationTemplate
buildConfiguration
- the current build configuration.plan
- the current plan (will already have details populated)public void cleanBuildConfiguration(@NotNull BuildConfiguration buildConfiguration, @NotNull Plan plan)
PlanCreationTemplate
cleanBuildConfiguration
in interface ChainBranchCreationService
cleanBuildConfiguration
in class PlanCreationTemplate
buildConfiguration
- the current build configuration.plan
- the current plan (will already have details populated)protected void setFullPlanKey(@NotNull Plan plan)
PlanCreationTemplate
setFullPlanKey
in class PlanCreationTemplate
plan
- - complete plan to be savedprotected void saveAndUpdateParents(@NotNull Plan plan)
PlanCreationTemplate
saveAndUpdateParents
in class PlanCreationTemplate
plan
- - complete plan (except for full key) to be savedprotected void performPostCreateAction(@NotNull Plan plan)
PlanCreationTemplate
performPostCreateAction
in class PlanCreationTemplate
plan
- created planpublic void triggerCreationCompleteEvents(PlanKey planKey)
PlanCreationTemplate
triggerCreationCompleteEvents
in interface PlanCreationService
triggerCreationCompleteEvents
in class PlanCreationTemplate
public String createPlan(@NotNull BuildConfiguration buildConfiguration, @NotNull ActionParametersMap actionParametersMap, @NotNull PlanCreationService.EnablePlan enabled) throws PlanCreationDeniedException, PlanCreationException
PlanCreationService
createPlan
in interface PlanCreationService
createPlan
in class PlanCreationTemplate
buildConfiguration
- of the plan to createactionParametersMap
- 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 reasonpublic void validatePlan(com.opensymphony.xwork.ValidationAware validationAware, BuildConfiguration buildConfiguration, ActionParametersMap actionParametersMap)
validatePlan
in interface PlanCreationService
Copyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.