public abstract class PlanCreationTemplate extends Object implements PlanCreationService
PlanCreationService.EnablePlan
Modifier and Type | Field and Description |
---|---|
protected BambooAclUpdateHelper |
aclUpdateHelper |
protected ArtifactDefinitionManager |
artifactDefinitionManager |
protected ArtifactSubscriptionManager |
artifactSubscriptionManager |
protected AuditLogService |
auditLogService |
protected BambooAuthenticationContext |
authenticationContext |
protected BambooLicenseManager |
bambooLicenseManager |
protected BranchCommitInformationManager |
branchCommitInformationManager |
protected BuildDefinitionConverter |
buildDefinitionConverter |
protected com.atlassian.event.api.EventPublisher |
eventPublisher |
protected NotificationManager |
notificationManager |
protected PlanManager |
planManager |
protected PlanValidationService |
planValidationService |
protected ProjectManager |
projectManager |
protected RepositoryDefinitionManager |
repositoryDefinitionManager |
protected TriggerConfigurationService |
triggerConfigurationService |
protected VariableDefinitionManager |
variableDefinitionManager |
protected VcsBranchManager |
vcsBranchManager |
EXISTING_PROJECT_KEY, NEW_PROJECT_MARKER, PROJECT_DESCRIPTION, PROJECT_KEY, PROJECT_NAME
Modifier | Constructor and Description |
---|---|
protected |
PlanCreationTemplate(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,
ArtifactDefinitionManager artifactDefinitionManager,
ArtifactSubscriptionManager artifactSubscriptionManager,
VariableDefinitionManager variableDefinitionManager,
RepositoryDefinitionManager repositoryDefinitionManager,
TaskConfigurationService taskConfigurationService,
NotificationManager notificationManager,
BranchCommitInformationManager branchCommitInformationManager,
VcsBranchManager vcsBranchManager,
TriggerConfigurationService triggerConfigurationService,
BuildNumberGeneratorService buildNumberGeneratorService) |
Modifier and Type | Method and Description |
---|---|
static void |
cleanBuildConfiguration(BuildConfiguration buildConfiguration)
Performs general cleanup of the buildConfiguration, cleaning up properties we don't want to save
mostly these are properties that get used for UI display.
|
protected abstract void |
cleanBuildConfiguration(BuildConfiguration buildConfiguration,
Plan plan)
Clean build configuration for saving.
|
protected void |
clonePlanPermissionsToSession(Plan buildToClone,
PlanCreationBean planCreationBean,
String planOwner) |
String |
createPlan(BuildConfiguration buildConfiguration,
ActionParametersMap actionParametersMap,
PlanCreationService.EnablePlan enabled)
Creates a plan from its components and saves it to the database
|
protected abstract org.acegisecurity.acls.MutableAcl |
getDefaultPermissionsForPlan(boolean accessForAllUsers)
Generate the permissions to be stored against the plan on creation.
|
protected void |
logBuildConfiguration(BuildConfiguration buildConfiguration) |
protected abstract boolean |
performCloneIfRequired(BuildConfiguration buildConfiguration,
PlanCreationBean planCreationBean,
ActionParametersMap params)
Using the action parameters determine if cloning is required and if so, perform the clone.
|
protected abstract void |
performPostCreateAction(Plan plan)
Perform plan specific actions that need to be run immediately after plan creation.
|
protected abstract void |
prepareBuildConfiguration(BuildConfiguration buildConfiguration,
Plan plan,
PlanCreationBean planCreationBean)
Prepare build configuration for saving.
|
protected abstract void |
preparePlanDetails(Plan plan,
ActionParametersMap params)
Prepare the plan object for saving.
|
protected abstract void |
saveAndUpdateParents(Plan plan)
Perform any necessary database operations required before saving the plan.
|
String |
savePlan(PlanCreationBean planCreationBean)
Saves a already created plan to the database
|
protected abstract void |
setFullPlanKey(Plan plan)
Set the full key for this plan
|
abstract 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.
|
protected void |
validateThrowingPlanCreationException(boolean condition,
String message) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBuildConfigurationWithDefaults, getNewInstance, validatePlan
protected final PlanManager planManager
protected final BambooAuthenticationContext authenticationContext
protected final ProjectManager projectManager
protected final com.atlassian.event.api.EventPublisher eventPublisher
protected final PlanValidationService planValidationService
protected final AuditLogService auditLogService
protected final BuildDefinitionConverter buildDefinitionConverter
protected final BambooAclUpdateHelper aclUpdateHelper
protected final BambooLicenseManager bambooLicenseManager
protected final ArtifactDefinitionManager artifactDefinitionManager
protected final ArtifactSubscriptionManager artifactSubscriptionManager
protected final VariableDefinitionManager variableDefinitionManager
protected final RepositoryDefinitionManager repositoryDefinitionManager
protected final NotificationManager notificationManager
protected final BranchCommitInformationManager branchCommitInformationManager
protected final VcsBranchManager vcsBranchManager
protected final TriggerConfigurationService triggerConfigurationService
protected PlanCreationTemplate(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, ArtifactDefinitionManager artifactDefinitionManager, ArtifactSubscriptionManager artifactSubscriptionManager, VariableDefinitionManager variableDefinitionManager, RepositoryDefinitionManager repositoryDefinitionManager, TaskConfigurationService taskConfigurationService, NotificationManager notificationManager, BranchCommitInformationManager branchCommitInformationManager, VcsBranchManager vcsBranchManager, TriggerConfigurationService triggerConfigurationService, BuildNumberGeneratorService buildNumberGeneratorService)
protected abstract void preparePlanDetails(@NotNull Plan plan, @NotNull ActionParametersMap params)
plan
- to add properties toparams
- containing any properties provided from the UI.protected abstract boolean performCloneIfRequired(@NotNull BuildConfiguration buildConfiguration, @NotNull PlanCreationBean planCreationBean, @NotNull ActionParametersMap params) throws PlanCreationException, PlanCreationDeniedException
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 UIPlanCreationException
- if cloning is required but fails.PlanCreationDeniedException
- if cloning required but can't be completed due to licensing restrictions@Nullable protected abstract org.acegisecurity.acls.MutableAcl getDefaultPermissionsForPlan(boolean accessForAllUsers)
accessForAllUsers
- anyone that can access Bamboo instance
(logged-in users and depending on configuration anonymous)
will be able to view this plan.protected abstract void prepareBuildConfiguration(@NotNull BuildConfiguration buildConfiguration, @NotNull Plan plan, @NotNull PlanCreationBean planCreationBean)
buildConfiguration
- the current build configuration.plan
- the current plan (will already have details populated)protected abstract void cleanBuildConfiguration(@NotNull BuildConfiguration buildConfiguration, @NotNull Plan plan)
buildConfiguration
- the current build configuration.plan
- the current plan (will already have details populated)protected abstract void saveAndUpdateParents(@NotNull Plan plan)
plan
- - complete plan (except for full key) to be savedprotected abstract void setFullPlanKey(@NotNull Plan plan)
plan
- - complete plan to be savedprotected abstract void performPostCreateAction(@NotNull Plan plan)
plan
- created planpublic abstract void triggerCreationCompleteEvents(PlanKey planKey)
triggerCreationCompleteEvents
in interface PlanCreationService
public String createPlan(@NotNull BuildConfiguration buildConfiguration, @NotNull ActionParametersMap actionParametersMap, @NotNull PlanCreationService.EnablePlan enabled) throws PlanCreationDeniedException, PlanCreationException
PlanCreationService
createPlan
in interface PlanCreationService
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 String savePlan(PlanCreationBean planCreationBean) throws PlanCreationDeniedException, PlanCreationException
PlanCreationService
savePlan
in interface PlanCreationService
planCreationBean
- containing the required components for savingPlanCreationDeniedException
- if plan creation fails because you already have too many plans.PlanCreationException
- if plan creation fails for any other reasonpublic static void cleanBuildConfiguration(BuildConfiguration buildConfiguration)
buildConfiguration
- to cleanprotected void clonePlanPermissionsToSession(Plan buildToClone, PlanCreationBean planCreationBean, String planOwner)
protected void logBuildConfiguration(BuildConfiguration buildConfiguration)
@Contract(value="false,_ -> fail") protected void validateThrowingPlanCreationException(boolean condition, String message)
Copyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.