com.atlassian.bamboo.deployments.versions.service
Interface DeploymentVersionService

All Known Implementing Classes:
DeploymentVersionServiceImpl

public interface DeploymentVersionService


Method Summary
 DeploymentVersion createDeploymentVersion(long deploymentProjectId, PlanResultKey planResultKey)
          Create a deployment version out of a deployment project and plan result.
 DeploymentVersion createDeploymentVersion(long deploymentProjectId, PlanResultKey planResultKey, com.atlassian.user.User user, java.lang.String versionName, java.lang.String nextVersionName)
          Create a deployment version with a specific name.
 DeploymentVersion findNextVersionContainingResult(long deploymentProjectId, PlanResultKey planResultKey)
          Find the first version that is created from a result which is later than current result (not taking custom revision into account)
 DeploymentVersion findPreviousVersion(long deploymentProjectId, long versionId)
           
 java.util.List<DeploymentVersion> findVersionsBetween(long deploymentProjectId, DeploymentVersion version1, DeploymentVersion version2)
          Find versions created between version1 and version2.
 java.util.List<DeploymentVersion> getDeploymentProjectVersions(long deploymentProjectId)
          Retrieves the list of all the version for the deployment project, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)
 DeploymentVersion getDeploymentVersion(long deploymentVersionId)
          Get DeploymentVersion by id
 DeploymentVersion getDeploymentVersionByName(java.lang.String existingVersion, long deploymentProjectId)
          Get a specific version by name
 java.lang.String getIncrementedVersionName(java.lang.String versionName)
          Calculates an increment of a version name.
 DeploymentVersion getLatestVersionForProject(long deploymentProjectId)
          Find the latest version for a deployment project.
 DeploymentVersionStatus getLatestVersionStatus(long deploymentVersionId)
           
 java.util.Map<java.lang.String,VariableDefinitionContext> getPossibleVersionVariables(ImmutablePlan linkedPlan, boolean includeUndeterminable)
          Provides a map of variables which might show up on a version.
 java.util.Set<PlanResultKey> getRelatedPlanResultKeys(long deploymentVersionId)
           
 DeploymentVersion getRelatedVersion(long deploymentProjectId, PlanResultKey planResultKey)
          Find latest version of a deployment project that is related to specific plan result.
 java.util.Map<java.lang.String,Artifact> getVersionArtifacts(DeploymentVersion deploymentVersion)
          Find all Artifact related to a version.
 int getVersionsCountForProject(long deploymentProjectId)
           
 DeploymentVersion renameVersion(long deploymentProjectId, DeploymentVersion deploymentVersion, java.lang.String newVersionName)
          Rename a version.
 java.util.List<DeploymentVersion> searchVersionsByName(long deploymentProjectId, java.lang.String searchTerm)
          Search for deployment versions in a project whose name contains the searchTerm
 void updatePlanKey(PlanKey originalPlanKey, PlanKey newPlanKey)
          Update planKey in DeploymentVersion's related entities when plan key has changed (ie after moving plan)
 DeploymentVersionStatus updateVersionStatus(long deploymentVersionId, DeploymentVersionState status, java.lang.String userName)
           
 ErrorCollection validateCreateDeploymentVersion(long deploymentProjectId, PlanResultKey planResultKey, java.lang.String name, java.lang.String nextVersionName)
          Validates values to be used for creating a new version.
 ErrorCollection validateDeploymentVersionRename(long deploymentProjectId, DeploymentVersion deploymentVersion, java.lang.String name)
          Validates values to be used for renaming version.
 

Method Detail

validateCreateDeploymentVersion

@NotNull
ErrorCollection validateCreateDeploymentVersion(long deploymentProjectId,
                                                        @NotNull
                                                        PlanResultKey planResultKey,
                                                        @Nullable
                                                        java.lang.String name,
                                                        @Nullable
                                                        java.lang.String nextVersionName)
Validates values to be used for creating a new version.

Parameters:
deploymentProjectId -
name -
planResultKey -
Returns:
errorCollection containing any errors found. If no errors, an empty errorCollection will be returned.

validateDeploymentVersionRename

@NotNull
ErrorCollection validateDeploymentVersionRename(long deploymentProjectId,
                                                        @NotNull
                                                        DeploymentVersion deploymentVersion,
                                                        @Nullable
                                                        java.lang.String name)
Validates values to be used for renaming version.

Parameters:
deploymentProjectId -
deploymentVersion -
name -
Returns:
errorCollection containing any errors found. If no errors, an empty errorCollection will be returned.

createDeploymentVersion

@NotNull
DeploymentVersion createDeploymentVersion(long deploymentProjectId,
                                                  @NotNull
                                                  PlanResultKey planResultKey)
                                          throws WebValidationException
Create a deployment version out of a deployment project and plan result. Automatic naming

Parameters:
deploymentProjectId - of project to create version for
planResultKey - of the result to pull artifacts from
Returns:
created Deployment Version
Throws:
WebValidationException

createDeploymentVersion

@NotNull
DeploymentVersion createDeploymentVersion(long deploymentProjectId,
                                                  @NotNull
                                                  PlanResultKey planResultKey,
                                                  @Nullable
                                                  com.atlassian.user.User user,
                                                  @Nullable
                                                  java.lang.String versionName,
                                                  @Nullable
                                                  java.lang.String nextVersionName)
                                          throws WebValidationException
Create a deployment version with a specific name. From deployment project and plan result. Assumes validation of name has been done.

Parameters:
deploymentProjectId - project the version is getting created for
planResultKey - of the result to pull artifacts from
versionName - name for the version to create
nextVersionName - the name for the next version (to be udpated in version naming scheme)
user - the person who is creating this version
Returns:
created Deployment Version.
Throws:
WebValidationException

getDeploymentVersion

@Nullable
DeploymentVersion getDeploymentVersion(long deploymentVersionId)
Get DeploymentVersion by id


getDeploymentProjectVersions

@NotNull
java.util.List<DeploymentVersion> getDeploymentProjectVersions(long deploymentProjectId)
Retrieves the list of all the version for the deployment project, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)

Parameters:
deploymentProjectId - if of the deployment project
Returns:
all the versions for the specified deployment project. Empty list if deployment project not found or if there is no versions for it.

searchVersionsByName

@NotNull
java.util.List<DeploymentVersion> searchVersionsByName(long deploymentProjectId,
                                                               @NotNull
                                                               java.lang.String searchTerm)
Search for deployment versions in a project whose name contains the searchTerm

Parameters:
deploymentProjectId - deployment project to search within
searchTerm - term to look for.
Returns:
list of Deployment Versions matching the search criteria

getDeploymentVersionByName

@Nullable
DeploymentVersion getDeploymentVersionByName(@NotNull
                                                      java.lang.String existingVersion,
                                                      long deploymentProjectId)
Get a specific version by name

Parameters:
existingVersion - name of the version
Returns:
the Deployment version with given name if found, otherwise null.

getRelatedPlanResultKeys

java.util.Set<PlanResultKey> getRelatedPlanResultKeys(long deploymentVersionId)
Returns:
Retrieve the PlanResultKeys of ResultSummaries related to a particular DeploymentVersion

updateVersionStatus

@Nullable
DeploymentVersionStatus updateVersionStatus(long deploymentVersionId,
                                                     @NotNull
                                                     DeploymentVersionState status,
                                                     @NotNull
                                                     java.lang.String userName)

getLatestVersionStatus

@Nullable
DeploymentVersionStatus getLatestVersionStatus(long deploymentVersionId)

findVersionsBetween

@NotNull
java.util.List<DeploymentVersion> findVersionsBetween(long deploymentProjectId,
                                                              @NotNull
                                                              DeploymentVersion version1,
                                                              @NotNull
                                                              DeploymentVersion version2)
Find versions created between version1 and version2. The versions must be different but belong to the same DeploymentProject The order of the argument is irrelevant: the method will determine which of the versions is the lower bound. Lower bound is not included in result but upper bound is. The result is sorted by creation date (newest first)

Parameters:
deploymentProjectId -
version1 -
version2 -
Returns:
Throws:
java.lang.IllegalArgumentException - if any of the version doesn't exist

findPreviousVersion

@Nullable
DeploymentVersion findPreviousVersion(long deploymentProjectId,
                                               @NotNull
                                               long versionId)

getVersionsCountForProject

int getVersionsCountForProject(long deploymentProjectId)

getLatestVersionForProject

DeploymentVersion getLatestVersionForProject(long deploymentProjectId)
Find the latest version for a deployment project. Comparison based on creation date.

Parameters:
deploymentProjectId - of the deployment project
Returns:
the latest version for a deployment project

getVersionArtifacts

@NotNull
java.util.Map<java.lang.String,Artifact> getVersionArtifacts(@NotNull
                                                                     DeploymentVersion deploymentVersion)
Find all Artifact related to a version.

Parameters:
deploymentVersion -
Returns:

getRelatedVersion

@Nullable
DeploymentVersion getRelatedVersion(long deploymentProjectId,
                                             @NotNull
                                             PlanResultKey planResultKey)
Find latest version of a deployment project that is related to specific plan result.

Parameters:
deploymentProjectId -
planResultKey -
Returns:

findNextVersionContainingResult

DeploymentVersion findNextVersionContainingResult(long deploymentProjectId,
                                                  @NotNull
                                                  PlanResultKey planResultKey)
Find the first version that is created from a result which is later than current result (not taking custom revision into account)

Parameters:
deploymentProjectId -
planResultKey -
Returns:

getPossibleVersionVariables

@NotNull
java.util.Map<java.lang.String,VariableDefinitionContext> getPossibleVersionVariables(@NotNull
                                                                                              ImmutablePlan linkedPlan,
                                                                                              boolean includeUndeterminable)
Provides a map of variables which might show up on a version.

Parameters:
linkedPlan - plan the deployment project is linked to
includeUndeterminable - if true include variables that we don't currently know the value, with a nice example (used for display purposes)
Returns:
a map of variables which might show up on a version.

getIncrementedVersionName

@NotNull
java.lang.String getIncrementedVersionName(@NotNull
                                                   java.lang.String versionName)
Calculates an increment of a version name. Increments last number in the name. If nothing found to increment will return passed in value.

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

updatePlanKey

void updatePlanKey(@NotNull
                   PlanKey originalPlanKey,
                   @NotNull
                   PlanKey newPlanKey)
Update planKey in DeploymentVersion's related entities when plan key has changed (ie after moving plan)

Parameters:
originalPlanKey - original PlanKey
newPlanKey - new PlanKey

renameVersion

@NotNull
DeploymentVersion renameVersion(long deploymentProjectId,
                                        @NotNull
                                        DeploymentVersion deploymentVersion,
                                        @Nullable
                                        java.lang.String newVersionName)
                                throws WebValidationException
Rename a version.

Parameters:
deploymentProjectId -
deploymentVersion -
newVersionName -
Returns:
deploymentVersion with the name changed
Throws:
WebValidationException


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