public class DeploymentProjectServiceImpl extends Object implements DeploymentProjectService
Constructor and Description |
---|
DeploymentProjectServiceImpl(ArtifactDefinitionManager artifactDefinitionManager,
BambooAclUpdateHelper aclUpdateHelper,
BambooAuthenticationContext authenticationContext,
CachedPlanManager cachedPlanManager,
DeploymentProjectDao deploymentProjectDao,
DeploymentResultService deploymentResultService,
EnvironmentDao environmentDao,
EnvironmentService environmentService,
EnvironmentTaskService environmentTaskService,
HibernateMutableAclService aclService,
com.opensymphony.xwork2.TextProvider textProvider,
ValidationService validationService,
VariableDefinitionManager variableDefinitionManager,
VersionNamingService versionNamingService,
DeploymentVersionService deploymentVersionService,
ResultsSummaryManager resultsSummaryManager,
com.atlassian.event.api.EventPublisher eventPublisher,
TriggerTypeManager triggerTypeManager,
PlanScheduler planScheduler,
BambooEntityOidService bambooEntityOidService) |
Modifier and Type | Method and Description |
---|---|
void |
addArtifactProjectItem(long deploymentProjectId,
ArtifactDefinition artifactDefinition)
Add artifact project item to deployment project.
|
DeploymentProject |
addDeploymentProject(String name,
String description,
String planKeyString)
Create a new deployment project.
|
DeploymentProject |
cloneDeploymentProject(long deploymentProjectId,
String name,
String description,
String planKeyString)
Create a new deployment project.
|
void |
deleteDeploymentProject(long deploymentProjectId)
Deprecated.
since 5.4
|
DeploymentProject |
editDeploymentProject(long deploymentProjectId,
String name,
String description,
String planKeyString)
Edit the details of the deployment project
|
Collection<Long> |
findDeploymentProjectsInOtherStates(VcsLocationBambooSpecsState specsState) |
Map<String,ArtifactDefinition> |
generateArtifactProjectItems(MutableDeploymentProject mutableDeploymentProject)
Create and save artifact project items for deployment projects.
|
List<DeploymentProject> |
getAllDeploymentProjects() |
DeploymentProject |
getDeploymentProject(long id) |
int |
getDeploymentProjectCount() |
DeploymentProject |
getDeploymentProjectForEnvironment(long environmentID)
Retrieve the deployment project that a specific environment belongs to.
|
DeploymentProject |
getDeploymentProjectForVersion(long versionId)
Retrieve the deployment project that a specific version belongs to.
|
List<DeploymentProjectItem> |
getDeploymentProjectItems(long deploymentProjectId)
Does not validate deployment project exists
|
List<DeploymentProject> |
getDeploymentProjectsReferencingArtifact(Artifact artifact)
Get all deployment projects that contain a version that uses specified artifact
|
List<DeploymentProject> |
getDeploymentProjectsRelatedToArtifact(ArtifactDefinition artifactDefinition)
Retrieve the deployment projects that refer to the artifactDefinition within their items
|
List<DeploymentProject> |
getDeploymentProjectsRelatedToPlan(PlanKey planKey)
Retrieve the deployment projects that are linked to a specific plan
|
List<DeploymentProject> |
getDeploymentProjectsRelatedToPlanOrBranches(PlanKey masterOrBranchPlanKey)
Retrieve the deployment projects that are linked to a specific plan or any of its branches
|
List<DeploymentProjectWithEnvironmentStatuses> |
getDeploymentProjectsWithStatusesRelatedToPlan(PlanKey planKey)
Retrieve the deployment projects that are linked to a specific plan.
|
List<DeploymentProjectWithEnvironmentStatuses> |
getDeploymentProjectsWithStatusesRelatedToPlanOrBranches(PlanKey masterOrBranchPlanKey)
Retrieve the deployment projects that are linked to a specific plan or any of its branches.
|
List<DeploymentProjectStatusForResultSummary> |
getDeploymentProjectsWithStatusesRelatedToPlanResult(ResultsSummary resultsSummary)
Retrieve the deployment projects that are linked to a specific result.
|
String |
getIncrementedVersionName(String versionName)
Calculates an incremented version name for a project.
|
DeploymentProjectWithEnvironmentForDashboard |
getPaginatedDeploymentsWithEnvironments(int start,
int limit,
String filter)
Retrieve paginated view of DeploymentProject and Environment and information if there are more entries ordered by
InternalDeploymentProject.getName() and InternalEnvironment.getPosition() . |
DeploymentProjectItem |
getProjectItem(long projectItemId)
Get a specific Project Item.
|
VersionNamingScheme |
getVersionNamingScheme(long deploymentProjectId)
Get the version naming configuration for a project
|
void |
removeArtifactProjectItem(long deploymentProjectId,
ArtifactDefinition artifactDefinition)
Remove artifact project item from deployment project.
|
void |
removeProjectItem(long deploymentProjectId,
long projectItemId)
Remove item from deployment project
|
void |
resetTriggers(PlanKey planKey)
Delete and recreate the triggers for every deployment that's related to this planKey.
|
void |
unlinkDeploymentProjectsRelatedToPlan(PlanKey planKey)
Remove all references to a
Plan from all related deployment projects. |
void |
updatePlanKey(PlanKey originalPlanKey,
PlanKey newPlanKey)
Update planKey in DeploymentProject when plan key has changed (ie after moving plan).
|
VersionNamingScheme |
updateVersionNamingScheme(long deploymentProjectId,
String nextVersionName,
boolean autoIncrement,
boolean applicableToBranches,
Set<String> variablesToAutoIncrement)
update the version naming configuration for a project
|
VersionNamingScheme |
updateVersionNamingScheme(long deploymentProjectId,
String nextVersionName,
boolean autoIncrement,
Set<String> variablesToAutoIncrement)
update the version naming configuration for a project
|
boolean |
userHasPermissionsToChangeAutoIncrementedVariables(long deploymentProjectId,
Set<String> variablesToAutoIncrement)
Check if current user has necessary permissions to modify auto incremented variables settings.
|
ErrorCollection |
validateAddDeploymentProject(String name,
String description,
String planKeyString)
Validates data to be used when adding a deployment project.
|
ErrorCollection |
validateAddDeploymentProject(String name,
String description,
String masterPlanKeyString,
String planKeyString)
Validates data to be used when adding a deployment project.
|
ErrorCollection |
validateArtifactTaskDefinitionOnPlanChange(long deploymentProjectId,
String planKeyString,
Map<String,ArtifactValidationError> artifactValidationErrors)
Validates artifact definitions on plan change and warn if artifact differ, so deployment tasks using it may fail
|
ErrorCollection |
validateCloneDeploymentProject(String name,
String description,
String planKeyString)
Validates data to be used when adding a deployment project.
|
ErrorCollection |
validateEditDeploymentProject(long id,
String name,
String description,
String planKeyString)
Validates data to be used when editing an existing deployment.
|
ErrorCollection |
validateEditDeploymentProject(long id,
String name,
String description,
String masterPlanKeyString,
String planKeyString)
Validates data to be used when editing an existing deployment.
|
ErrorCollection |
validateTriggerConfigurationOnPlanChange(long deploymentProjectId,
PlanKey newPlanKey,
List<EnvironmentTriggerValidationError> triggerValidationErrors)
Validate trigger configuration on deployment project's plan change
|
ErrorCollection |
validateVersionNamingScheme(long deploymentProjectId,
String nextVersionName,
boolean autoIncrement,
Set<String> variablesToAutoIncrement)
Validate the version naming configuration for a project
|
public DeploymentProjectServiceImpl(ArtifactDefinitionManager artifactDefinitionManager, BambooAclUpdateHelper aclUpdateHelper, BambooAuthenticationContext authenticationContext, CachedPlanManager cachedPlanManager, DeploymentProjectDao deploymentProjectDao, DeploymentResultService deploymentResultService, EnvironmentDao environmentDao, EnvironmentService environmentService, EnvironmentTaskService environmentTaskService, HibernateMutableAclService aclService, com.opensymphony.xwork2.TextProvider textProvider, ValidationService validationService, VariableDefinitionManager variableDefinitionManager, VersionNamingService versionNamingService, DeploymentVersionService deploymentVersionService, ResultsSummaryManager resultsSummaryManager, com.atlassian.event.api.EventPublisher eventPublisher, TriggerTypeManager triggerTypeManager, PlanScheduler planScheduler, BambooEntityOidService bambooEntityOidService)
@NotNull public List<DeploymentProject> getAllDeploymentProjects()
getAllDeploymentProjects
in interface DeploymentProjectService
public int getDeploymentProjectCount()
getDeploymentProjectCount
in interface DeploymentProjectService
@NotNull public List<DeploymentProjectWithEnvironmentStatuses> getDeploymentProjectsWithStatusesRelatedToPlan(@NotNull PlanKey planKey)
DeploymentProjectService
getDeploymentProjectsWithStatusesRelatedToPlan
in interface DeploymentProjectService
planKey
- of the linked plan@NotNull public List<DeploymentProjectWithEnvironmentStatuses> getDeploymentProjectsWithStatusesRelatedToPlanOrBranches(@NotNull PlanKey masterOrBranchPlanKey)
DeploymentProjectService
getDeploymentProjectsWithStatusesRelatedToPlanOrBranches
in interface DeploymentProjectService
masterOrBranchPlanKey
- identifies master plan or branch@NotNull public List<DeploymentProjectStatusForResultSummary> getDeploymentProjectsWithStatusesRelatedToPlanResult(@NotNull ResultsSummary resultsSummary)
DeploymentProjectService
getDeploymentProjectsWithStatusesRelatedToPlanResult
in interface DeploymentProjectService
resultsSummary
- of the linked plan@NotNull public List<DeploymentProject> getDeploymentProjectsRelatedToPlan(@NotNull PlanKey planKey)
DeploymentProjectService
getDeploymentProjectsRelatedToPlan
in interface DeploymentProjectService
planKey
- of the linked plan@NotNull public List<DeploymentProject> getDeploymentProjectsRelatedToPlanOrBranches(@NotNull PlanKey masterOrBranchPlanKey)
DeploymentProjectService
getDeploymentProjectsRelatedToPlanOrBranches
in interface DeploymentProjectService
masterOrBranchPlanKey
- identifies master plan or branch@NotNull public List<DeploymentProject> getDeploymentProjectsRelatedToArtifact(@NotNull ArtifactDefinition artifactDefinition)
DeploymentProjectService
getDeploymentProjectsRelatedToArtifact
in interface DeploymentProjectService
artifactDefinition
- related artifact definition@Nullable public DeploymentProject getDeploymentProject(long id)
getDeploymentProject
in interface DeploymentProjectService
id
- of the deployment project to retrieve@Nullable public DeploymentProject getDeploymentProjectForEnvironment(long environmentID)
DeploymentProjectService
getDeploymentProjectForEnvironment
in interface DeploymentProjectService
environmentID
- of the environment@Deprecated public void deleteDeploymentProject(long deploymentProjectId)
DeploymentProjectService
deleteDeploymentProject
in interface DeploymentProjectService
deploymentProjectId
- of the project@Nullable public DeploymentProject getDeploymentProjectForVersion(long versionId)
DeploymentProjectService
getDeploymentProjectForVersion
in interface DeploymentProjectService
versionId
- of the version@NotNull public ErrorCollection validateAddDeploymentProject(String name, String description, String planKeyString)
DeploymentProjectService
validateAddDeploymentProject
in interface DeploymentProjectService
name
- shortish display name of the projectdescription
- optional description of what the project is aboutplanKeyString
- key of the linked plan or its branch@NotNull public ErrorCollection validateAddDeploymentProject(String name, String description, String masterPlanKeyString, String planKeyString)
DeploymentProjectService
validateAddDeploymentProject
in interface DeploymentProjectService
name
- shortish display name of the projectdescription
- optional description of what the project is aboutmasterPlanKeyString
- key of the master of linked plan/branchplanKeyString
- key of the linked plan or its branch@NotNull public ErrorCollection validateCloneDeploymentProject(String name, String description, @Nullable String planKeyString)
DeploymentProjectService
validateCloneDeploymentProject
in interface DeploymentProjectService
name
- shortish display name of the projectdescription
- optional description of what the project is about@NotNull public ErrorCollection validateEditDeploymentProject(long id, String name, @Nullable String description, @Nullable String planKeyString)
DeploymentProjectService
validateEditDeploymentProject
in interface DeploymentProjectService
@NotNull public ErrorCollection validateEditDeploymentProject(long id, String name, @Nullable String description, String masterPlanKeyString, String planKeyString)
DeploymentProjectService
validateEditDeploymentProject
in interface DeploymentProjectService
@NotNull public ErrorCollection validateArtifactTaskDefinitionOnPlanChange(long deploymentProjectId, String planKeyString, @NotNull Map<String,ArtifactValidationError> artifactValidationErrors)
DeploymentProjectService
validateArtifactTaskDefinitionOnPlanChange
in interface DeploymentProjectService
@NotNull public ErrorCollection validateTriggerConfigurationOnPlanChange(long deploymentProjectId, @NotNull PlanKey newPlanKey, @NotNull List<EnvironmentTriggerValidationError> triggerValidationErrors)
DeploymentProjectService
validateTriggerConfigurationOnPlanChange
in interface DeploymentProjectService
deploymentProjectId
- identifies deployment projectnewPlanKey
- new plan keytriggerValidationErrors
- list to store trigger validation errors@NotNull public DeploymentProject addDeploymentProject(String name, String description, String planKeyString) throws WebValidationException
DeploymentProjectService
addDeploymentProject
in interface DeploymentProjectService
name
- shortish display name of the projectdescription
- optional description of what the project is aboutplanKeyString
- key of the linked plan or its branchWebValidationException
@NotNull public DeploymentProject cloneDeploymentProject(long deploymentProjectId, String name, String description, String planKeyString) throws WebValidationException
DeploymentProjectService
cloneDeploymentProject
in interface DeploymentProjectService
name
- shortish display name of the projectdescription
- optional description of what the project is aboutWebValidationException
@NotNull public DeploymentProject editDeploymentProject(long deploymentProjectId, String name, @Nullable String description, @Nullable String planKeyString) throws WebValidationException
DeploymentProjectService
editDeploymentProject
in interface DeploymentProjectService
deploymentProjectId
- of the deployment project to editname
- the new name for the projectdescription
- the new description of the projectplanKeyString
- optional of the linked planWebValidationException
@Nullable public DeploymentProjectItem getProjectItem(long projectItemId)
DeploymentProjectService
getProjectItem
in interface DeploymentProjectService
projectItemId
- of the project item to retrieve.public void addArtifactProjectItem(long deploymentProjectId, @NotNull ArtifactDefinition artifactDefinition)
DeploymentProjectService
addArtifactProjectItem
in interface DeploymentProjectService
deploymentProjectId
- id of the deployment projectartifactDefinition
- ArtifactDefinitionpublic void removeArtifactProjectItem(long deploymentProjectId, @NotNull ArtifactDefinition artifactDefinition)
DeploymentProjectService
removeArtifactProjectItem
in interface DeploymentProjectService
deploymentProjectId
- id of the deployment projectartifactDefinition
- ArtifactDefinition@NotNull public List<DeploymentProjectItem> getDeploymentProjectItems(long deploymentProjectId)
DeploymentProjectService
getDeploymentProjectItems
in interface DeploymentProjectService
deploymentProjectId
- if of the deployment projectpublic void removeProjectItem(long deploymentProjectId, long projectItemId)
DeploymentProjectService
removeProjectItem
in interface DeploymentProjectService
deploymentProjectId
- DeploymentProject id@Nullable public VersionNamingScheme getVersionNamingScheme(long deploymentProjectId)
DeploymentProjectService
getVersionNamingScheme
in interface DeploymentProjectService
deploymentProjectId
- of the project@NotNull public String getIncrementedVersionName(@NotNull String versionName)
DeploymentProjectService
getIncrementedVersionName
in interface DeploymentProjectService
versionName
- to incrementpublic boolean userHasPermissionsToChangeAutoIncrementedVariables(long deploymentProjectId, @NotNull Set<String> variablesToAutoIncrement)
DeploymentProjectService
userHasPermissionsToChangeAutoIncrementedVariables
in interface DeploymentProjectService
@NotNull public ErrorCollection validateVersionNamingScheme(long deploymentProjectId, String nextVersionName, boolean autoIncrement, @NotNull Set<String> variablesToAutoIncrement)
DeploymentProjectService
validateVersionNamingScheme
in interface DeploymentProjectService
deploymentProjectId
- of the projectnextVersionName
- the value to be used for the next version nameautoIncrement
- whether the version name should be auto-incrementedvariablesToAutoIncrement
- variables to increment@NotNull public VersionNamingScheme updateVersionNamingScheme(long deploymentProjectId, String nextVersionName, boolean autoIncrement, @NotNull Set<String> variablesToAutoIncrement) throws WebValidationException
DeploymentProjectService
updateVersionNamingScheme
in interface DeploymentProjectService
deploymentProjectId
- of the projectnextVersionName
- the value to be used for the next version nameautoIncrement
- whether the version name should be auto-incrementedvariablesToAutoIncrement
- variables to incrementWebValidationException
- if any validation errors occur@NotNull public VersionNamingScheme updateVersionNamingScheme(long deploymentProjectId, String nextVersionName, boolean autoIncrement, boolean applicableToBranches, @NotNull Set<String> variablesToAutoIncrement) throws WebValidationException
DeploymentProjectService
updateVersionNamingScheme
in interface DeploymentProjectService
deploymentProjectId
- of the projectnextVersionName
- the value to be used for the next version nameautoIncrement
- whether the version name should be auto-incrementedapplicableToBranches
- whether the same scheme should be used with branchesvariablesToAutoIncrement
- variables to incrementWebValidationException
- if any validation errors occurpublic void unlinkDeploymentProjectsRelatedToPlan(@NotNull PlanKey planKey)
DeploymentProjectService
Plan
from all related deployment projects.unlinkDeploymentProjectsRelatedToPlan
in interface DeploymentProjectService
public List<DeploymentProject> getDeploymentProjectsReferencingArtifact(@NotNull Artifact artifact)
DeploymentProjectService
getDeploymentProjectsReferencingArtifact
in interface DeploymentProjectService
public void updatePlanKey(@NotNull PlanKey originalPlanKey, @NotNull PlanKey newPlanKey)
DeploymentProjectService
updatePlanKey
in interface DeploymentProjectService
originalPlanKey
- original PlanKeynewPlanKey
- new PlanKeypublic void resetTriggers(@NotNull PlanKey planKey)
DeploymentProjectService
resetTriggers
in interface DeploymentProjectService
public Map<String,ArtifactDefinition> generateArtifactProjectItems(@NotNull MutableDeploymentProject mutableDeploymentProject)
DeploymentProjectService
generateArtifactProjectItems
in interface DeploymentProjectService
@NotNull public Collection<Long> findDeploymentProjectsInOtherStates(@NotNull VcsLocationBambooSpecsState specsState)
findDeploymentProjectsInOtherStates
in interface DeploymentProjectService
public DeploymentProjectWithEnvironmentForDashboard getPaginatedDeploymentsWithEnvironments(int start, int limit, @Nullable String filter)
DeploymentProjectService
InternalDeploymentProject.getName()
and InternalEnvironment.getPosition()
.
Deployment projects are not operation aware, environments are.
In case of null or empty filter no filtering.getPaginatedDeploymentsWithEnvironments
in interface DeploymentProjectService
Copyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.