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,
boolean accessForAllUsers)
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
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddDeploymentProjectpublic 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 DeploymentProjectServicepublic int getDeploymentProjectCount()
getDeploymentProjectCount in interface DeploymentProjectService@NotNull public List<DeploymentProjectWithEnvironmentStatuses> getDeploymentProjectsWithStatusesRelatedToPlan(@NotNull PlanKey planKey)
DeploymentProjectServicegetDeploymentProjectsWithStatusesRelatedToPlan in interface DeploymentProjectServiceplanKey - of the linked plan@NotNull public List<DeploymentProjectWithEnvironmentStatuses> getDeploymentProjectsWithStatusesRelatedToPlanOrBranches(@NotNull PlanKey masterOrBranchPlanKey)
DeploymentProjectServicegetDeploymentProjectsWithStatusesRelatedToPlanOrBranches in interface DeploymentProjectServicemasterOrBranchPlanKey - identifies master plan or branch@NotNull public List<DeploymentProjectStatusForResultSummary> getDeploymentProjectsWithStatusesRelatedToPlanResult(@NotNull ResultsSummary resultsSummary)
DeploymentProjectServicegetDeploymentProjectsWithStatusesRelatedToPlanResult in interface DeploymentProjectServiceresultsSummary - of the linked plan@NotNull public List<DeploymentProject> getDeploymentProjectsRelatedToPlan(@NotNull PlanKey planKey)
DeploymentProjectServicegetDeploymentProjectsRelatedToPlan in interface DeploymentProjectServiceplanKey - of the linked plan@NotNull public List<DeploymentProject> getDeploymentProjectsRelatedToPlanOrBranches(@NotNull PlanKey masterOrBranchPlanKey)
DeploymentProjectServicegetDeploymentProjectsRelatedToPlanOrBranches in interface DeploymentProjectServicemasterOrBranchPlanKey - identifies master plan or branch@NotNull public List<DeploymentProject> getDeploymentProjectsRelatedToArtifact(@NotNull ArtifactDefinition artifactDefinition)
DeploymentProjectServicegetDeploymentProjectsRelatedToArtifact in interface DeploymentProjectServiceartifactDefinition - related artifact definition@Nullable public DeploymentProject getDeploymentProject(long id)
getDeploymentProject in interface DeploymentProjectServiceid - of the deployment project to retrieve@Nullable public DeploymentProject getDeploymentProjectForEnvironment(long environmentID)
DeploymentProjectServicegetDeploymentProjectForEnvironment in interface DeploymentProjectServiceenvironmentID - of the environment@Deprecated public void deleteDeploymentProject(long deploymentProjectId)
DeploymentProjectServicedeleteDeploymentProject in interface DeploymentProjectServicedeploymentProjectId - of the project@Nullable public DeploymentProject getDeploymentProjectForVersion(long versionId)
DeploymentProjectServicegetDeploymentProjectForVersion in interface DeploymentProjectServiceversionId - of the version@NotNull public ErrorCollection validateAddDeploymentProject(String name, String description, String planKeyString)
DeploymentProjectServicevalidateAddDeploymentProject in interface DeploymentProjectServicename - 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)
DeploymentProjectServicevalidateAddDeploymentProject in interface DeploymentProjectServicename - 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)
DeploymentProjectServicevalidateCloneDeploymentProject in interface DeploymentProjectServicename - 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)
DeploymentProjectServicevalidateEditDeploymentProject in interface DeploymentProjectService@NotNull public ErrorCollection validateEditDeploymentProject(long id, String name, @Nullable String description, String masterPlanKeyString, String planKeyString)
DeploymentProjectServicevalidateEditDeploymentProject in interface DeploymentProjectService@NotNull public ErrorCollection validateArtifactTaskDefinitionOnPlanChange(long deploymentProjectId, String planKeyString, @NotNull Map<String,ArtifactValidationError> artifactValidationErrors)
DeploymentProjectServicevalidateArtifactTaskDefinitionOnPlanChange in interface DeploymentProjectService@NotNull public ErrorCollection validateTriggerConfigurationOnPlanChange(long deploymentProjectId, @NotNull PlanKey newPlanKey, @NotNull List<EnvironmentTriggerValidationError> triggerValidationErrors)
DeploymentProjectServicevalidateTriggerConfigurationOnPlanChange in interface DeploymentProjectServicedeploymentProjectId - identifies deployment projectnewPlanKey - new plan keytriggerValidationErrors - list to store trigger validation errors@NotNull public DeploymentProject addDeploymentProject(String name, String description, String planKeyString, boolean accessForAllUsers) throws WebValidationException
DeploymentProjectServiceaddDeploymentProject in interface DeploymentProjectServicename - shortish display name of the projectdescription - optional description of what the project is aboutplanKeyString - key of the linked plan or its branchaccessForAllUsers - whether all Bamboo users will be allowed to view the deployment projectWebValidationException@NotNull public DeploymentProject cloneDeploymentProject(long deploymentProjectId, String name, String description, String planKeyString) throws WebValidationException
DeploymentProjectServicecloneDeploymentProject in interface DeploymentProjectServicename - 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
DeploymentProjectServiceeditDeploymentProject in interface DeploymentProjectServicedeploymentProjectId - 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)
DeploymentProjectServicegetProjectItem in interface DeploymentProjectServiceprojectItemId - of the project item to retrieve.public void addArtifactProjectItem(long deploymentProjectId,
@NotNull
ArtifactDefinition artifactDefinition)
DeploymentProjectServiceaddArtifactProjectItem in interface DeploymentProjectServicedeploymentProjectId - id of the deployment projectartifactDefinition - ArtifactDefinitionpublic void removeArtifactProjectItem(long deploymentProjectId,
@NotNull
ArtifactDefinition artifactDefinition)
DeploymentProjectServiceremoveArtifactProjectItem in interface DeploymentProjectServicedeploymentProjectId - id of the deployment projectartifactDefinition - ArtifactDefinition@NotNull public List<DeploymentProjectItem> getDeploymentProjectItems(long deploymentProjectId)
DeploymentProjectServicegetDeploymentProjectItems in interface DeploymentProjectServicedeploymentProjectId - if of the deployment projectpublic void removeProjectItem(long deploymentProjectId,
long projectItemId)
DeploymentProjectServiceremoveProjectItem in interface DeploymentProjectServicedeploymentProjectId - DeploymentProject id@Nullable public VersionNamingScheme getVersionNamingScheme(long deploymentProjectId)
DeploymentProjectServicegetVersionNamingScheme in interface DeploymentProjectServicedeploymentProjectId - of the project@NotNull public String getIncrementedVersionName(@NotNull String versionName)
DeploymentProjectServicegetIncrementedVersionName in interface DeploymentProjectServiceversionName - to incrementpublic boolean userHasPermissionsToChangeAutoIncrementedVariables(long deploymentProjectId,
@NotNull
Set<String> variablesToAutoIncrement)
DeploymentProjectServiceuserHasPermissionsToChangeAutoIncrementedVariables in interface DeploymentProjectService@NotNull public ErrorCollection validateVersionNamingScheme(long deploymentProjectId, String nextVersionName, boolean autoIncrement, @NotNull Set<String> variablesToAutoIncrement)
DeploymentProjectServicevalidateVersionNamingScheme in interface DeploymentProjectServicedeploymentProjectId - 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
DeploymentProjectServiceupdateVersionNamingScheme in interface DeploymentProjectServicedeploymentProjectId - 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
DeploymentProjectServiceupdateVersionNamingScheme in interface DeploymentProjectServicedeploymentProjectId - 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)
DeploymentProjectServicePlan from all related deployment projects.unlinkDeploymentProjectsRelatedToPlan in interface DeploymentProjectServicepublic List<DeploymentProject> getDeploymentProjectsReferencingArtifact(@NotNull Artifact artifact)
DeploymentProjectServicegetDeploymentProjectsReferencingArtifact in interface DeploymentProjectServicepublic void updatePlanKey(@NotNull
PlanKey originalPlanKey,
@NotNull
PlanKey newPlanKey)
DeploymentProjectServiceupdatePlanKey in interface DeploymentProjectServiceoriginalPlanKey - original PlanKeynewPlanKey - new PlanKeypublic void resetTriggers(@NotNull
PlanKey planKey)
DeploymentProjectServiceresetTriggers in interface DeploymentProjectServicepublic Map<String,ArtifactDefinition> generateArtifactProjectItems(@NotNull MutableDeploymentProject mutableDeploymentProject)
DeploymentProjectServicegenerateArtifactProjectItems in interface DeploymentProjectService@NotNull public Collection<Long> findDeploymentProjectsInOtherStates(@NotNull VcsLocationBambooSpecsState specsState)
findDeploymentProjectsInOtherStates in interface DeploymentProjectServicepublic DeploymentProjectWithEnvironmentForDashboard getPaginatedDeploymentsWithEnvironments(int start, int limit, @Nullable String filter)
DeploymentProjectServiceInternalDeploymentProject.getName() and InternalEnvironment.getPosition().
Deployment projects are not operation aware, environments are.
In case of null or empty filter no filtering.getPaginatedDeploymentsWithEnvironments in interface DeploymentProjectServiceCopyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.