com.atlassian.bamboo.deployments.projects.service
Interface DeploymentProjectService

All Known Implementing Classes:
DeploymentProjectServiceImpl

public interface DeploymentProjectService

Service to provide access to all things Deployment Project, And Project Item.


Method Summary
 void addArtifactProjectItem(long deploymentProjectId, ArtifactDefinition artifactDefinition)
          Add artifact project item to deployment project.
 DeploymentProject addDeploymentProject(java.lang.String name, java.lang.String description, java.lang.String planKeyString)
          Create a new deployment project.
 void deleteDeploymentProject(long deploymentProjectId)
          Delete DeploymentProject and all dependent data
 DeploymentProject editDeploymentProject(long id, java.lang.String name, java.lang.String description, java.lang.String planKeyString)
          Edit the details of the deployment project
 java.util.List<DeploymentProject> getAllDeploymentProjects()
           
 DeploymentProject getDeploymentProject(long id)
           
 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.
 java.util.List<DeploymentProjectItem> getDeploymentProjectItems(long deploymentProjectId)
          Does not validate deployment project exists
 java.util.List<DeploymentProject> getDeploymentProjectsReferencingArtifact(Artifact artifact)
          Get all deployment projects that contain a version that uses specified artifact
 java.util.List<DeploymentProject> getDeploymentProjectsRelatedToArtifact(ArtifactDefinition artifactDefinition)
          Retrieve the deployment projects that refer to the artifactDefinition within their items
 java.util.List<DeploymentProject> getDeploymentProjectsRelatedToPlan(PlanKey planKey)
          Retrieve the deployment projects that are linked to a specific plan
 java.util.List<DeploymentProjectWithEnvironmentStatuses> getDeploymentProjectsWithStatusesRelatedToPlan(PlanKey planKey)
          Retrieve the deployment projects that are linked to a specific plan.
 java.util.List<DeploymentProjectStatusForResultSummary> getDeploymentProjectsWithStatusesRelatedToPlanResult(ResultsSummary resultsSummary)
          Retrieve the deployment projects that are linked to a specific result.
 java.lang.String getIncrementedVersionName(java.lang.String versionName)
          Calculates an incremented version name for a project.
 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 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, java.lang.String nextVersionName, boolean autoIncrement, java.util.Set<java.lang.String> variablesToAutoIncrement)
          update the version naming configuration for a project
 ErrorCollection validateAddDeploymentProject(java.lang.String name, java.lang.String description, java.lang.String planKeyString)
          Validates data to be used when adding a deployment project.
 ErrorCollection validateArtifactTaskDefinitionOnPlanChange(long id, java.lang.String planKeyString, java.util.Map<java.lang.String,ArtifactValidationError> artifactValidationErrors)
          Validates artifact definitions on plan change and warn if artifact differ, so deployment tasks using it may fail
 ErrorCollection validateEditDeploymentProject(long id, java.lang.String name, java.lang.String description, java.lang.String planKeyString)
          Validates data to be used when editing an existing deployment.
 ErrorCollection validateVersionNamingScheme(long deploymentProjectId, java.lang.String nextVersionName, boolean autoIncrement, java.util.Set<java.lang.String> variablesToAutoIncrement)
          Validate the version naming configuration for a project
 

Method Detail

getAllDeploymentProjects

@NotNull
java.util.List<DeploymentProject> getAllDeploymentProjects()
Returns:
a list of all deployment projects

getDeploymentProjectsRelatedToPlan

@NotNull
java.util.List<DeploymentProject> getDeploymentProjectsRelatedToPlan(@NotNull
                                                                             PlanKey planKey)
Retrieve the deployment projects that are linked to a specific plan

Parameters:
planKey - of the linked plan
Returns:
a list of all deployment projects linked to a specified plan

getDeploymentProjectsWithStatusesRelatedToPlan

@NotNull
java.util.List<DeploymentProjectWithEnvironmentStatuses> getDeploymentProjectsWithStatusesRelatedToPlan(@NotNull
                                                                                                                PlanKey planKey)
Retrieve the deployment projects that are linked to a specific plan. Includes projects their environments + latest status

Parameters:
planKey - of the linked plan
Returns:
a list of all deployment projects linked to a specified plan

getDeploymentProjectsWithStatusesRelatedToPlanResult

@NotNull
java.util.List<DeploymentProjectStatusForResultSummary> getDeploymentProjectsWithStatusesRelatedToPlanResult(@NotNull
                                                                                                                     ResultsSummary resultsSummary)
Retrieve the deployment projects that are linked to a specific result. Includes projects their environments + latest status

Parameters:
resultsSummary - of the linked plan
Returns:
a list of all deployment projects linked to a specified plan

getDeploymentProjectsRelatedToArtifact

@NotNull
java.util.List<DeploymentProject> getDeploymentProjectsRelatedToArtifact(@NotNull
                                                                                 ArtifactDefinition artifactDefinition)
Retrieve the deployment projects that refer to the artifactDefinition within their items

Parameters:
artifactDefinition - related artifact definition
Returns:
a list of all deployment projects referring specified artifactDefinition

getDeploymentProject

@Nullable
DeploymentProject getDeploymentProject(long id)
Parameters:
id - of the deployment project to retrieve
Returns:
deployment project with the given id or null if none found.

getDeploymentProjectForEnvironment

@Nullable
DeploymentProject getDeploymentProjectForEnvironment(long environmentID)
Retrieve the deployment project that a specific environment belongs to.

Parameters:
environmentID - of the environment
Returns:
DeploymentProject environment belongs to

getDeploymentProjectForVersion

@Nullable
DeploymentProject getDeploymentProjectForVersion(long versionId)
Retrieve the deployment project that a specific version belongs to.

Parameters:
versionId - of the version
Returns:
DeploymentProject version belongs to

deleteDeploymentProject

void deleteDeploymentProject(long deploymentProjectId)
Delete DeploymentProject and all dependent data

Parameters:
deploymentProjectId - of the project

validateAddDeploymentProject

@NotNull
ErrorCollection validateAddDeploymentProject(java.lang.String name,
                                                     java.lang.String description,
                                                     java.lang.String planKeyString)
Validates data to be used when adding a deployment project.

Parameters:
name -
description -
planKeyString -
Returns:
ErrorCollection containing any errors which may exist. If no errors found and empty ErrorCollection will be returned;

addDeploymentProject

@NotNull
DeploymentProject addDeploymentProject(java.lang.String name,
                                               java.lang.String description,
                                               java.lang.String planKeyString)
                                       throws WebValidationException
Create a new deployment project.

Parameters:
name - shortish display name of the project
description - optional description of what the project is about
planKeyString - key of the linked plan
Returns:
the created deployment project.
Throws:
WebValidationException

validateEditDeploymentProject

@NotNull
ErrorCollection validateEditDeploymentProject(long id,
                                                      java.lang.String name,
                                                      java.lang.String description,
                                                      java.lang.String planKeyString)
Validates data to be used when editing an existing deployment.

Parameters:
id -
name -
description -
planKeyString -
Returns:
ErrorCollection containing any errors which may exist. If no errors found and empty ErrorCollection will be returned;

validateArtifactTaskDefinitionOnPlanChange

@NotNull
ErrorCollection validateArtifactTaskDefinitionOnPlanChange(long id,
                                                                   java.lang.String planKeyString,
                                                                   java.util.Map<java.lang.String,ArtifactValidationError> artifactValidationErrors)
Validates artifact definitions on plan change and warn if artifact differ, so deployment tasks using it may fail

Parameters:
id -
planKeyString -
Returns:

editDeploymentProject

@NotNull
DeploymentProject editDeploymentProject(long id,
                                                java.lang.String name,
                                                java.lang.String description,
                                                java.lang.String planKeyString)
                                        throws WebValidationException
Edit the details of the deployment project

Parameters:
id - of the deployment project to edit
name - the new name for the project
description - the new description of the project
planKeyString - optional of the linked plan
Returns:
The updated deployment project
Throws:
WebValidationException

getDeploymentProjectItems

@NotNull
java.util.List<DeploymentProjectItem> getDeploymentProjectItems(long deploymentProjectId)
Does not validate deployment project exists

Parameters:
deploymentProjectId - if of the deployment project
Returns:
all project items for the specified deployment project. Empty list if deployment project not found.

getProjectItem

@Nullable
DeploymentProjectItem getProjectItem(long projectItemId)
Get a specific Project Item.

Parameters:
projectItemId - of the project item to retrieve.
Returns:
project item with the given idea. Null if none found.

addArtifactProjectItem

void addArtifactProjectItem(long deploymentProjectId,
                            @NotNull
                            ArtifactDefinition artifactDefinition)
Add artifact project item to deployment project. If artifact is already referenced by one of the project items this method will do nothing. There's no check if artifact is "shared".

Parameters:
deploymentProjectId - id of the deployment project
artifactDefinition - ArtifactDefinition
Throws:
java.lang.IllegalArgumentException - when DeploymentProject doesn't exist

removeArtifactProjectItem

void removeArtifactProjectItem(long deploymentProjectId,
                               @NotNull
                               ArtifactDefinition artifactDefinition)
Remove artifact project item from deployment project. If artifact is not referenced by any of the project items this method will do nothing.

Parameters:
deploymentProjectId - id of the deployment project
artifactDefinition - ArtifactDefinition

removeProjectItem

void removeProjectItem(long deploymentProjectId,
                       long projectItemId)
Remove item from deployment project

Parameters:
deploymentProjectId - DeploymentProject id
projectItemId -

getVersionNamingScheme

@Nullable
VersionNamingScheme getVersionNamingScheme(long deploymentProjectId)
Get the version naming configuration for a project

Parameters:
deploymentProjectId - of the project
Returns:
version naming scheme for a project

getIncrementedVersionName

@NotNull
java.lang.String getIncrementedVersionName(@NotNull
                                                   java.lang.String versionName)
Calculates an incremented version name for a project. See VersionNamingService.getIncrementedVersionName for details.

Parameters:
versionName - to increment
Returns:
incremented version name.

validateVersionNamingScheme

@NotNull
ErrorCollection validateVersionNamingScheme(long deploymentProjectId,
                                                    java.lang.String nextVersionName,
                                                    boolean autoIncrement,
                                                    @NotNull
                                                    java.util.Set<java.lang.String> variablesToAutoIncrement)
Validate the version naming configuration for a project

Parameters:
deploymentProjectId - of the project
nextVersionName - the value to be used for the next version name
autoIncrement - whether the version name should be auto-incremented
variablesToAutoIncrement - variables to increment
Returns:
error collection with any validation errors, if no errors, empty error collection is returned

updateVersionNamingScheme

@NotNull
VersionNamingScheme updateVersionNamingScheme(long deploymentProjectId,
                                                      java.lang.String nextVersionName,
                                                      boolean autoIncrement,
                                                      @NotNull
                                                      java.util.Set<java.lang.String> variablesToAutoIncrement)
                                              throws WebValidationException
update the version naming configuration for a project

Parameters:
deploymentProjectId - of the project
nextVersionName - the value to be used for the next version name
autoIncrement - whether the version name should be auto-incremented
variablesToAutoIncrement - variables to increment
Returns:
the updated version naming scheme.
Throws:
WebValidationException - if any validation errors occur

unlinkDeploymentProjectsRelatedToPlan

void unlinkDeploymentProjectsRelatedToPlan(@NotNull
                                           PlanKey planKey)
Remove all references to a Plan from all related deployment projects.

Parameters:
planKey -

getDeploymentProjectsReferencingArtifact

java.util.List<DeploymentProject> getDeploymentProjectsReferencingArtifact(@NotNull
                                                                           Artifact artifact)
Get all deployment projects that contain a version that uses specified artifact

Parameters:
artifact -
Returns:

updatePlanKey

void updatePlanKey(@NotNull
                   PlanKey originalPlanKey,
                   @NotNull
                   PlanKey newPlanKey)
Update planKey in DeploymentProject when plan key has changed (ie after moving plan)

Parameters:
originalPlanKey - original PlanKey
newPlanKey - new PlanKey


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.