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

All Known Implementing Classes:
VersionNamingServiceImpl

@Internal
public interface VersionNamingService

Internal Service for managing version names. Manages concurrent operations around version names.


Method Summary
 String getIncrementedVersionName(String versionName)
          Calculates an increment of a version name.
 MutableVersionNamingScheme getVersionNamingSchemeForProject(long deploymentProjectId)
          Get the version naming configuration for a project
 MutableDeploymentVersion nameAndCreateVersion(InternalDeploymentProject deploymentProject, ImmutablePlan linkedPlan, MutableDeploymentVersion version, String versionName, String nextVersionName, Map<String,VariableDefinitionContext> variables)
          Takes a new deployment version, if new version name supplied, uses that, otherwise generates unique name based on version naming scheme.
 MutableDeploymentVersion renameVersion(long deploymentProjectId, DeploymentVersion deploymentVersion, String newVersionName)
          Rename a version.
 MutableVersionNamingScheme updateVersionNamingSchemeForProject(long deploymentProjectId, String nextVersionName, boolean autoIncrement, Set<String> variablesToAutoIncrement)
          update the version naming configuration for a project
 

Method Detail

getVersionNamingSchemeForProject

@Nullable
MutableVersionNamingScheme getVersionNamingSchemeForProject(long deploymentProjectId)
Get the version naming configuration for a project

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

updateVersionNamingSchemeForProject

@NotNull
MutableVersionNamingScheme updateVersionNamingSchemeForProject(long deploymentProjectId,
                                                                       String nextVersionName,
                                                                       boolean autoIncrement,
                                                                       @NotNull
                                                                       Set<String> variablesToAutoIncrement)
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
autoIncrementVariables - whether or not to increment bamboo variables
variablesToAutoIncrement - variables to increment
Returns:
the updated version naming scheme.

nameAndCreateVersion

@NotNull
MutableDeploymentVersion nameAndCreateVersion(@NotNull
                                                      InternalDeploymentProject deploymentProject,
                                                      @NotNull
                                                      ImmutablePlan linkedPlan,
                                                      @NotNull
                                                      MutableDeploymentVersion version,
                                                      @Nullable
                                                      String versionName,
                                                      @Nullable
                                                      String nextVersionName,
                                                      @NotNull
                                                      Map<String,VariableDefinitionContext> variables)
                                              throws WebValidationException
Takes a new deployment version, if new version name supplied, uses that, otherwise generates unique name based on version naming scheme. Version is then saved and the version naming scheme updated with the next version name.

Parameters:
deploymentProject - the version belongs to
version - the version to be named and saved.
versionName - (optional) name to be used for this version
nextVersionName - (optional) the value the next version name should be set to.
variables - map containing variables available for version name creation (doesn't have to contain GLOBAL and SYSTEM variables)
Returns:
the persisted version.
Throws:
WebValidationException - on any error

getIncrementedVersionName

@NotNull
String getIncrementedVersionName(@NotNull
                                         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.

renameVersion

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

Parameters:
deploymentProjectId -
deploymentVersion -
newVersionName -
Returns:
modified version object
Throws:
WebValidationException


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.