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,
TransactionAndHibernateTemplate hibernateTemplate) |
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(@NotNull BuildConfiguration buildConfiguration,
@NotNull Plan plan)
Clean build configuration for saving.
|
protected void |
clonePlanPermissionsToSession(Plan buildToClone,
PlanCreationBean planCreationBean,
String planOwner) |
protected String |
createPlan(@NotNull BuildConfiguration buildConfiguration,
@NotNull ActionParametersMap actionParametersMap,
@NotNull PlanCreationService.EnablePlan enabled,
@NotNull BiConsumer<Plan,ActionParametersMap> preparePlanDetails)
Creates and saves a plan
|
protected abstract @Nullable 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(@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 abstract void |
performPostCreateAction(@NotNull Plan plan)
Perform plan specific actions that need to be run immediately after plan creation.
|
protected abstract void |
prepareBuildConfiguration(@NotNull BuildConfiguration buildConfiguration,
@NotNull Plan plan,
@NotNull PlanCreationBean planCreationBean)
Prepare build configuration for saving.
|
protected void |
saveAndUpdateParents(@NotNull Plan plan)
Deprecated.
since 6.9. Use
saveAndUpdateParents(PlanCreationBean) |
protected abstract void |
saveAndUpdateParents(@NotNull PlanCreationBean planCreationBean)
Perform any necessary database operations required before saving the plan.
|
String |
savePlan(@NotNull PlanCreationBean planCreationBean)
Saves a already created plan to the database
|
protected abstract void |
setFullPlanKey(@NotNull 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
createPlan, 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, TransactionAndHibernateTemplate hibernateTemplate)
protected abstract boolean performCloneIfRequired(@NotNull @NotNull BuildConfiguration buildConfiguration, @NotNull @NotNull PlanCreationBean planCreationBean, @NotNull @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 @Nullable 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 @NotNull BuildConfiguration buildConfiguration, @NotNull @NotNull Plan plan, @NotNull @NotNull PlanCreationBean planCreationBean)
buildConfiguration
- the current build configuration.plan
- the current plan (will already have details populated)protected abstract void cleanBuildConfiguration(@NotNull @NotNull BuildConfiguration buildConfiguration, @NotNull @NotNull Plan plan)
buildConfiguration
- the current build configuration.plan
- the current plan (will already have details populated)@Deprecated protected void saveAndUpdateParents(@NotNull @NotNull Plan plan)
saveAndUpdateParents(PlanCreationBean)
plan
- - complete plan (except for full key) to be savedprotected abstract void saveAndUpdateParents(@NotNull @NotNull PlanCreationBean planCreationBean)
planCreationBean
- plan creation beanprotected abstract void setFullPlanKey(@NotNull @NotNull Plan plan)
plan
- - complete plan to be savedprotected abstract void performPostCreateAction(@NotNull @NotNull Plan plan)
plan
- created planpublic abstract void triggerCreationCompleteEvents(PlanKey planKey)
triggerCreationCompleteEvents
in interface PlanCreationService
protected String createPlan(@NotNull @NotNull BuildConfiguration buildConfiguration, @NotNull @NotNull ActionParametersMap actionParametersMap, @NotNull @NotNull PlanCreationService.EnablePlan enabled, @NotNull @NotNull BiConsumer<Plan,ActionParametersMap> preparePlanDetails) throws PlanCreationDeniedException, PlanCreationException
buildConfiguration
- configuration of the planactionParametersMap
- any other params that are not in the buildConfiguration
enabled
- whether the plan should start enabled or disabledpreparePlanDetails
- prepares the plan object for saving.PlanCreationDeniedException
PlanCreationException
public String savePlan(@NotNull @NotNull 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 © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.