Class DeploymentVersionServiceImpl
- All Implemented Interfaces:
DeploymentVersionDtoManager,DeploymentVersionService
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.bamboo.deployments.versions.service.DeploymentVersionService
DeploymentVersionService.DeploymentVersionNeededAttributes -
Constructor Summary
ConstructorsConstructorDescriptionDeploymentVersionServiceImpl(@NotNull DeploymentProjectDao deploymentProjectDao, @NotNull DeploymentVersionDao deploymentVersionDao, @NotNull InternalResultsSummaryAccessor internalResultsSummaryAccessor, @NotNull DeploymentVersionChainResultDataCollector deploymentVersionChainResultDataCollector, @NotNull com.opensymphony.xwork2.TextProvider textProvider, @NotNull BambooUserManager bambooUserService, @NotNull VariableDefinitionManager variableDefinitionManager, @NotNull VariableDefinitionFactory variableDefinitionFactory, @NotNull CustomVariableContext customVariableContext, @NotNull com.atlassian.event.api.EventPublisher eventPublisher, @NotNull CachedPlanManager cachedPlanManager, @NotNull ScopedExclusionService scopedExclusionService, @NotNull ResultsSummaryVariableAccessor resultsSummaryVariableAccessor, @NotNull RepositoryDefinitionManager repositoryDefinitionManager, @NotNull VcsRepositoryManager vcsRepositoryManager, @NotNull BambooCachingPermissionManagerFacadeFactory bambooCachingPermissionManagerFacadeFactory, @NotNull ArtifactLinkManager artifactLinkManager, @NotNull AuditLogService auditLogService) -
Method Summary
Modifier and TypeMethodDescription@NotNull DeploymentVersioncreateDeploymentVersion(long deploymentProjectId, @NotNull PlanResultKey planResultKey) Create a deployment version out of a deployment project and plan result.@NotNull DeploymentVersioncreateDeploymentVersion(long deploymentProjectId, @NotNull PlanResultKey planResultKey, @Nullable com.atlassian.user.User user, @Nullable String versionName, @Nullable String nextVersionName) Create a deployment version with a specific name.@NotNull Map<DeploymentVersion,Integer> findLatestKnownVersionsForEnvironmentsOfDeploymentProject(DeploymentProject deploymentProject) Find allDeploymentVersionthat are currently deployed on environments of aDeploymentProjectFor each version found give number of environments it is present on.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)@Nullable DeploymentVersionfindPreviousVersion(long deploymentProjectId, long versionId) static @NotNull Optional<DeploymentVersionState>findUserRelatedDeploymentVersionStatus(@NotNull List<? extends DeploymentVersionStatus> versionStatuses, @NotNull String userName) @NotNull Multimap<DeploymentProject,Pair<Long, PlanResultKey>> findVersionIdentifiersAssociatedWithJiraIssue(@NotNull String issueKey) Find all the version identifiers that are associated with a JIRA issue, grouped byDeploymentProjectNote: this API is in its intermittent form and is subject to change.@NotNull List<DeploymentVersion>findVersionsAssociatedWithJiraIssue(long deploymentProjectId, @NotNull String issueKey) Find all the versions of aDeploymentProjectthat are associated with a JIRA issue@NotNull Multimap<DeploymentProject,DeploymentVersion> findVersionsAssociatedWithJiraIssue(@NotNull String issueKey) Find all the version that are associated with a JIRA issue, grouped byDeploymentProject@NotNull List<DeploymentVersion>findVersionsBetween(long deploymentProjectId, @NotNull DeploymentVersion version1, @NotNull DeploymentVersion version2) Find versions created between version1 and version2.@NotNull List<DeploymentVersion>findVersionsBetweenNoVariables(long deploymentProjectId, @NotNull DeploymentVersion version1, @NotNull DeploymentVersion version2) Find versions created between version1 and version2.@NotNull List<DeploymentVersionStatus>getAllUsersLatestVersionStatusDtosOrderedByCreationDate(long deploymentVersionId) @NotNull Map<Long,List<DeploymentVersionStatus>> getAllUsersLatestVersionStatusesOrderedByCreationDate(@NotNull List<Long> deploymentVersionIds) Find all users' latest version statuses for each version id ordered by creation date.@NotNull 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)@NotNull List<DeploymentVersion>getDeploymentProjectVersionsNoVariables(@NotNull DeploymentProject deploymentProject) Retrieves the list of all the version for the deployment project, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)@NotNull List<DeploymentVersion>getDeploymentProjectVersionsNoVariables(@NotNull DeploymentProject deploymentProject, int offset, int maxResults) Retrieves the list of the version for the deployment project, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts).@NotNull List<DeploymentVersion>getDeploymentProjectVersionsNoVariables(@NotNull DeploymentProject deploymentProject, int offset, int maxResults, DeploymentVersionService.DeploymentVersionNeededAttributes deploymentVersionNeededAttributes) Retrieves the list of the version for the deployment project, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts).@Nullable DeploymentVersiongetDeploymentVersion(long deploymentVersionId) Get DeploymentVersion by id@Nullable DeploymentVersiongetDeploymentVersion(@Nullable DeploymentVersionDto dto, @Nullable DeploymentProject project, DeploymentVersionService.DeploymentVersionNeededAttributes deploymentVersionNeededAttributes) Convert a DeploymentVersionDto to aDeploymentVersion.@Nullable DeploymentVersiongetDeploymentVersionByName(@NotNull String existingVersionName, long deploymentProjectId) Get a specific version by name@NotNull StringgetEvaluatedVersionName(String nextVersionName, Map<String, VariableDefinitionContext> variables, Set<String> variablesToIncrement) @NotNull StringgetIncrementedVersionName(@NotNull String versionName) Calculates an increment of a version name.@Nullable DeploymentVersiongetLatestVersionForProject(long deploymentProjectId) Find the latest version for a deployment project regardless of branch used to create it.@Nullable DeploymentVersiongetLatestVersionForProject(long deploymentProjectId, @NotNull PlanKey branchKey) Find the latest version for a deployment project.@Nullable DeploymentVersionStatusgetLatestVersionStatus(long deploymentVersionId) @NotNull Map<Long,DeploymentVersionStatus> getLatestVersionStatuses(@NotNull List<Long> deploymentVersionIds) Find a latest version status for each version id.@NotNull DeploymentVersiongetOrCreateDeploymentVersion(long deploymentProjectId, @NotNull PlanResultKey planResultKey) Given a build result, find a deployment version that matches it, or create it if it doesn't exist.@NotNull Map<String,VariableDefinitionContext> getPossibleVersionVariables(@NotNull ImmutablePlan linkedPlan, boolean includeUndeterminable) Provides a map of variables which might show up on a version.@NotNull Map<String,VariableDefinitionContext> getPossibleVersionVariables(@NotNull ImmutablePlan linkedPlan, @Nullable PlanResultKey planResultKey, boolean includeUndeterminable) Provides a map of variables which might show up on a version.@NotNull Set<PlanResultKey>getRelatedPlanResultKeys(long deploymentVersionId) Retrieve the PlanResultKeys of ResultSummaries related to a particular DeploymentVersion@NotNull Map<Long,PlanResultKey> getRelatedPlanResultKeys(@NotNull Set<Long> deploymentVersionIds) Retrieve the PlanResultKeys of ResultSummaries related to a particular DeploymentVersions@Nullable DeploymentVersiongetRelatedVersion(long deploymentProjectId, @NotNull PlanResultKey planResultKey) Find latest version of a deployment project that is related to specific plan result.getResultPlanKeysHavingDeploymentProjectVersions(long deploymentProjectId) Returns keys of result plans (branch) that have at least one deployment project version (release)@NotNull List<VariableSubstitutionContext>getVariableContextForVersion(@org.jetbrains.annotations.NotNull long deploymentVersionId) Fetch variable context associated with a version.getVersionArtifacts(@NotNull DeploymentVersion deploymentVersion) Find allArtifactrelated to a version.getVersionNamePreview(ResultsSummary resultsSummary, String versionName) Given a version name and a result summary, what would the version name look like after substitution.intCount all versionsintgetVersionsCountForProject(long deploymentProjectId) Count versions related to deployment projectintgetVersionsCountForProjectAndBranch(@org.jetbrains.annotations.NotNull long deploymentProjectId, @NotNull PlanKey branchKey) Count versions related to deployment project and a specified plan branchbooleanhasVersionsUnrelatedToBranch(long deploymentProjectId, @NotNull PlanKey branchKey) Test if there areDeploymentVersions in aDeploymentProjectthat are unrelated to given branchbooleanisFromTheSameBranch(long firstVersionId, long secondVersionId) Checks if both deployment versions come from the same branchbooleanisFromTheSameBranch(String planKey, long versionId) Checks if the specified build result is on the same branch as the specified version IDbooleanisVersionNameConflicting(long deploymentProjectId, @NotNull String name) Check whether the version name is already being used by another version within this project@NotNull DeploymentVersionrenameVersion(long deploymentProjectId, @NotNull DeploymentVersion deploymentVersion, @NotNull String newVersionName) Rename a version.voidresetVersionsAge(@NotNull DeploymentVersion deploymentVersion) Resets version's age to 0.@NotNull List<DeploymentVersion>searchVersionsByBranch(long deploymentProjectId, @NotNull PlanKey branchKey) Search for deployment versions in a project associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)@NotNull List<DeploymentVersion>searchVersionsByBranchAndName(long deploymentProjectId, @NotNull PlanKey branchKey, @NotNull String searchTerm) Search for deployment versions in a project whose name contains the searchTerm, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)@NotNull List<DeploymentVersion>searchVersionsByBranchAndNameNoVariables(@NotNull DeploymentProject deploymentProject, @NotNull PlanKey branchKey, @NotNull String searchTerm) Search for deployment versions in a project whose name contains the searchTerm and associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)@NotNull List<DeploymentVersion>searchVersionsByBranchAndNameNoVariables(@NotNull DeploymentProject deploymentProject, @NotNull PlanKey branchKey, @NotNull String searchTerm, int offset, int maxResults, DeploymentVersionService.DeploymentVersionNeededAttributes deploymentVersionNeededAttributes) Search for deployment versions in a project whose name contains the searchTerm and associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)@NotNull List<DeploymentVersion>searchVersionsByBranchNoVariables(@NotNull DeploymentProject deploymentProject, @NotNull PlanKey branchKey) Search for deployment versions in a project associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)@NotNull List<DeploymentVersion>searchVersionsByBranchNoVariables(@NotNull DeploymentProject deploymentProject, @NotNull PlanKey branchKey, int startIndex, int maxResults) Search for deployment versions in a project associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)@NotNull List<DeploymentVersion>searchVersionsByBranchNoVariables(@NotNull DeploymentProject deploymentProject, @NotNull PlanKey branchKey, int startIndex, int maxResults, @NotNull DeploymentVersionService.DeploymentVersionNeededAttributes deploymentVersionNeededAttributes) Search for deployment versions in a project associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)@NotNull List<DeploymentVersion>searchVersionsByName(long deploymentProjectId, @NotNull String searchTerm) Search for deployment versions in a project whose name contains the searchTerm, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)@NotNull List<DeploymentVersion>searchVersionsByNameNoVariables(@NotNull DeploymentProject deploymentProject, @NotNull String searchTerm) Search for deployment versions in a project whose name contains the searchTerm, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)@NotNull List<DeploymentVersion>searchVersionsByNameNoVariables(@NotNull DeploymentProject deploymentProject, @NotNull String searchTerm, int offset, int maxResults, @NotNull DeploymentVersionService.DeploymentVersionNeededAttributes deploymentVersionNeededAttributes) Search for deployment versions in a project whose name contains the searchTerm, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)voidupdatePlanKey(@NotNull PlanKey originalPlanKey, @NotNull PlanKey newPlanKey) Update planKey in DeploymentVersion's related entities when plan key has changed (ie after moving plan)voidupdateVersionsForResult(@NotNull PlanResultKey planResultKey) Update related versions data (artifacts and variables) after a chain stage has been completed.@NotNull DeploymentVersionStatusupdateVersionStatus(long deploymentVersionId, @NotNull DeploymentVersionState status, @NotNull String userName) Updates the version status for given deployment version.@NotNull ErrorCollectionvalidateCreateDeploymentVersion(long deploymentProjectId, @NotNull PlanResultKey planResultKey, @Nullable String name, @Nullable String nextVersionName) Validates values to be used for creating a new version.@NotNull ErrorCollectionvalidateDeploymentVersionRename(long deploymentProjectId, @NotNull DeploymentVersion deploymentVersion, @Nullable String name) Validates values to be used for renaming version.
-
Constructor Details
-
DeploymentVersionServiceImpl
public DeploymentVersionServiceImpl(@NotNull @NotNull DeploymentProjectDao deploymentProjectDao, @NotNull @NotNull DeploymentVersionDao deploymentVersionDao, @NotNull @NotNull InternalResultsSummaryAccessor internalResultsSummaryAccessor, @NotNull @NotNull DeploymentVersionChainResultDataCollector deploymentVersionChainResultDataCollector, @NotNull @NotNull com.opensymphony.xwork2.TextProvider textProvider, @NotNull @NotNull BambooUserManager bambooUserService, @NotNull @NotNull VariableDefinitionManager variableDefinitionManager, @NotNull @NotNull VariableDefinitionFactory variableDefinitionFactory, @NotNull @NotNull CustomVariableContext customVariableContext, @NotNull @NotNull com.atlassian.event.api.EventPublisher eventPublisher, @NotNull @NotNull CachedPlanManager cachedPlanManager, @NotNull @NotNull ScopedExclusionService scopedExclusionService, @NotNull @NotNull ResultsSummaryVariableAccessor resultsSummaryVariableAccessor, @NotNull @NotNull RepositoryDefinitionManager repositoryDefinitionManager, @NotNull @NotNull VcsRepositoryManager vcsRepositoryManager, @NotNull @NotNull BambooCachingPermissionManagerFacadeFactory bambooCachingPermissionManagerFacadeFactory, @NotNull @NotNull ArtifactLinkManager artifactLinkManager, @NotNull @NotNull AuditLogService auditLogService)
-
-
Method Details
-
validateDeploymentVersionRename
@NotNull public @NotNull ErrorCollection validateDeploymentVersionRename(long deploymentProjectId, @NotNull @NotNull DeploymentVersion deploymentVersion, @Nullable @Nullable String name) Description copied from interface:DeploymentVersionServiceValidates values to be used for renaming version.- Specified by:
validateDeploymentVersionRenamein interfaceDeploymentVersionService- Returns:
- errorCollection containing any errors found. If no errors, an empty errorCollection will be returned.
-
renameVersion
@NotNull public @NotNull DeploymentVersion renameVersion(long deploymentProjectId, @NotNull @NotNull DeploymentVersion deploymentVersion, @NotNull @NotNull String newVersionName) throws WebValidationException Description copied from interface:DeploymentVersionServiceRename a version.- Specified by:
renameVersionin interfaceDeploymentVersionService- Returns:
- deploymentVersion with the name changed
- Throws:
WebValidationException
-
validateCreateDeploymentVersion
@NotNull public @NotNull ErrorCollection validateCreateDeploymentVersion(long deploymentProjectId, @NotNull @NotNull PlanResultKey planResultKey, @Nullable @Nullable String name, @Nullable @Nullable String nextVersionName) Description copied from interface:DeploymentVersionServiceValidates values to be used for creating a new version.- Specified by:
validateCreateDeploymentVersionin interfaceDeploymentVersionService- Parameters:
deploymentProjectId- id of the deployment projectplanResultKey- key of the build result on which this version is createdname- version namenextVersionName- name of the next version- Returns:
- errorCollection containing any errors found. If no errors, an empty errorCollection will be returned.
-
isVersionNameConflicting
Description copied from interface:DeploymentVersionServiceCheck whether the version name is already being used by another version within this project- Specified by:
isVersionNameConflictingin interfaceDeploymentVersionService- Parameters:
deploymentProjectId- project to filter byname- to check- Returns:
- true if name is already being used.
-
getOrCreateDeploymentVersion
@NotNull public @NotNull DeploymentVersion getOrCreateDeploymentVersion(long deploymentProjectId, @NotNull @NotNull PlanResultKey planResultKey) throws WebValidationException Description copied from interface:DeploymentVersionServiceGiven a build result, find a deployment version that matches it, or create it if it doesn't exist. Uses automatic naming.- Specified by:
getOrCreateDeploymentVersionin interfaceDeploymentVersionService- Parameters:
deploymentProjectId- of project to create version forplanResultKey- of the result to pull artifacts from- Returns:
- deployment version
- Throws:
WebValidationException
-
updateVersionsForResult
Description copied from interface:DeploymentVersionServiceUpdate related versions data (artifacts and variables) after a chain stage has been completed.- Specified by:
updateVersionsForResultin interfaceDeploymentVersionService
-
createDeploymentVersion
@NotNull public @NotNull DeploymentVersion createDeploymentVersion(long deploymentProjectId, @NotNull @NotNull PlanResultKey planResultKey) throws WebValidationException Description copied from interface:DeploymentVersionServiceCreate a deployment version out of a deployment project and plan result. Automatic naming- Specified by:
createDeploymentVersionin interfaceDeploymentVersionService- Parameters:
deploymentProjectId- of project to create version forplanResultKey- of the result to pull artifacts from- Returns:
- created Deployment Version
- Throws:
WebValidationException
-
createDeploymentVersion
@NotNull public @NotNull DeploymentVersion createDeploymentVersion(long deploymentProjectId, @NotNull @NotNull PlanResultKey planResultKey, @Nullable @Nullable com.atlassian.user.User user, @Nullable @Nullable String versionName, @Nullable @Nullable String nextVersionName) throws WebValidationException Description copied from interface:DeploymentVersionServiceCreate a deployment version with a specific name. From deployment project and plan result. Assumes validation of name has been done.- Specified by:
createDeploymentVersionin interfaceDeploymentVersionService- Parameters:
deploymentProjectId- project the version is getting created forplanResultKey- of the result to pull artifacts fromuser- the person who is creating this versionversionName- name for the version to createnextVersionName- the name for the next version (to be updated in version naming scheme)- Returns:
- created Deployment Version.
- Throws:
WebValidationException
-
getVariableContextForVersion
@NotNull public @NotNull List<VariableSubstitutionContext> getVariableContextForVersion(@NotNull @org.jetbrains.annotations.NotNull long deploymentVersionId) Description copied from interface:DeploymentVersionServiceFetch variable context associated with a version.- Specified by:
getVariableContextForVersionin interfaceDeploymentVersionService
-
getVersionNamePreview
Description copied from interface:DeploymentVersionServiceGiven a version name and a result summary, what would the version name look like after substitution. Does not check/mutate for uniqueness.- Specified by:
getVersionNamePreviewin interfaceDeploymentVersionService- Parameters:
resultsSummary- the version would get created fromversionName- the potential name of the version- Returns:
- substituted version name
-
resetVersionsAge
Description copied from interface:DeploymentVersionServiceResets version's age to 0.- Specified by:
resetVersionsAgein interfaceDeploymentVersionService
-
getPossibleVersionVariables
@NotNull public @NotNull Map<String,VariableDefinitionContext> getPossibleVersionVariables(@NotNull @NotNull ImmutablePlan linkedPlan, boolean includeUndeterminable) Description copied from interface:DeploymentVersionServiceProvides a map of variables which might show up on a version.- Specified by:
getPossibleVersionVariablesin interfaceDeploymentVersionService- Parameters:
linkedPlan- plan the deployment project is linked toincludeUndeterminable- 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.
-
getPossibleVersionVariables
@NotNull public @NotNull Map<String,VariableDefinitionContext> getPossibleVersionVariables(@NotNull @NotNull ImmutablePlan linkedPlan, @Nullable @Nullable PlanResultKey planResultKey, boolean includeUndeterminable) Description copied from interface:DeploymentVersionServiceProvides a map of variables which might show up on a version.- Specified by:
getPossibleVersionVariablesin interfaceDeploymentVersionService- Parameters:
linkedPlan- plan the deployment project is linked toplanResultKey- resultKey for result variables contextincludeUndeterminable- 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.
-
getDeploymentVersion
Description copied from interface:DeploymentVersionServiceGet DeploymentVersion by id- Specified by:
getDeploymentVersionin interfaceDeploymentVersionService
-
getDeploymentVersion
@Nullable @Internal public @Nullable DeploymentVersion getDeploymentVersion(@Nullable @Nullable DeploymentVersionDto dto, @Nullable @Nullable DeploymentProject project, @NotNull DeploymentVersionService.DeploymentVersionNeededAttributes deploymentVersionNeededAttributes) throws org.acegisecurity.AccessDeniedException Description copied from interface:DeploymentVersionDtoManagerConvert a DeploymentVersionDto to aDeploymentVersion.- Specified by:
getDeploymentVersionin interfaceDeploymentVersionDtoManager- Throws:
org.acegisecurity.AccessDeniedException- if theDeploymentVersionis inaccessible to the current user, but also marks the current transaction as rollback-only
-
getResultPlanKeysHavingDeploymentProjectVersions
@NotNull public @NotNull Set<String> getResultPlanKeysHavingDeploymentProjectVersions(long deploymentProjectId) Description copied from interface:DeploymentVersionServiceReturns keys of result plans (branch) that have at least one deployment project version (release)- Specified by:
getResultPlanKeysHavingDeploymentProjectVersionsin interfaceDeploymentVersionService- Parameters:
deploymentProjectId- id of the deployment project- Returns:
-
getDeploymentProjectVersions
@NotNull public @NotNull List<DeploymentVersion> getDeploymentProjectVersions(long deploymentProjectId) Description copied from interface:DeploymentVersionServiceRetrieves the list of all the version for the deployment project, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)This method fetches complete version data,
DeploymentVersionService.getDeploymentProjectVersionsNoVariables(DeploymentProject)should be preferred when variable data is not required, e.g. for displaying list of version in the UI.- Specified by:
getDeploymentProjectVersionsin interfaceDeploymentVersionService- Parameters:
deploymentProjectId- id 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.
-
getDeploymentProjectVersionsNoVariables
@NotNull public @NotNull List<DeploymentVersion> getDeploymentProjectVersionsNoVariables(@NotNull @NotNull DeploymentProject deploymentProject) Description copied from interface:DeploymentVersionServiceRetrieves the list of all the version for the deployment project, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)- Specified by:
getDeploymentProjectVersionsNoVariablesin interfaceDeploymentVersionService- Parameters:
deploymentProject- 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.
-
getDeploymentProjectVersionsNoVariables
@NotNull public @NotNull List<DeploymentVersion> getDeploymentProjectVersionsNoVariables(@NotNull @NotNull DeploymentProject deploymentProject, int offset, int maxResults) Description copied from interface:DeploymentVersionServiceRetrieves the list of the version for the deployment project, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts).- Specified by:
getDeploymentProjectVersionsNoVariablesin interfaceDeploymentVersionService- Parameters:
deploymentProject- deployment projectoffset- number of results to skipmaxResults- maximum length of the returned list- Returns:
- the versions for the specified deployment project. Empty list if deployment project not found or if there is no versions for it.
-
getDeploymentProjectVersionsNoVariables
@NotNull public @NotNull List<DeploymentVersion> getDeploymentProjectVersionsNoVariables(@NotNull @NotNull DeploymentProject deploymentProject, int offset, int maxResults, @NotNull DeploymentVersionService.DeploymentVersionNeededAttributes deploymentVersionNeededAttributes) Description copied from interface:DeploymentVersionServiceRetrieves the list of the version for the deployment project, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts).- Specified by:
getDeploymentProjectVersionsNoVariablesin interfaceDeploymentVersionService- Parameters:
deploymentProject- deployment projectoffset- number of results to skipmaxResults- maximum length of the returned listdeploymentVersionNeededAttributes- specify whether certain attributes will be loaded or not.- Returns:
- the versions for the specified deployment project. Empty list if deployment project not found or if there is no versions for it.
-
getLatestVersionForProject
Description copied from interface:DeploymentVersionServiceFind the latest version for a deployment project regardless of branch used to create it. Comparison based on creation date.- Specified by:
getLatestVersionForProjectin interfaceDeploymentVersionService- Parameters:
deploymentProjectId- of the deployment project- Returns:
- the latest version for a deployment project
-
getLatestVersionForProject
@Nullable public @Nullable DeploymentVersion getLatestVersionForProject(long deploymentProjectId, @NotNull @NotNull PlanKey branchKey) Description copied from interface:DeploymentVersionServiceFind the latest version for a deployment project. Comparison based on creation date.- Specified by:
getLatestVersionForProjectin interfaceDeploymentVersionService- Parameters:
deploymentProjectId- of the deployment projectbranchKey- key of the PlanBranch- Returns:
- the latest version created for a branch for a deployment project
-
getDeploymentVersionByName
@Nullable public @Nullable DeploymentVersion getDeploymentVersionByName(@NotNull @NotNull String existingVersionName, long deploymentProjectId) Description copied from interface:DeploymentVersionServiceGet a specific version by name- Specified by:
getDeploymentVersionByNamein interfaceDeploymentVersionService- Parameters:
existingVersionName- name of the version- Returns:
- the Deployment version with given name if found, otherwise null.
-
searchVersionsByName
@NotNull public @NotNull List<DeploymentVersion> searchVersionsByName(long deploymentProjectId, @NotNull @NotNull String searchTerm) Description copied from interface:DeploymentVersionServiceSearch for deployment versions in a project whose name contains the searchTerm, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)This method fetches complete version data,
DeploymentVersionService.searchVersionsByNameNoVariables(DeploymentProject, String)should be preferred when variable data is not required, e.g. for displaying list of version in the UI.- Specified by:
searchVersionsByNamein interfaceDeploymentVersionService- Parameters:
deploymentProjectId- deployment project to search withinsearchTerm- term to look for.- Returns:
- list of Deployment Versions matching the search criteria
-
searchVersionsByBranch
@NotNull public @NotNull List<DeploymentVersion> searchVersionsByBranch(long deploymentProjectId, @NotNull @NotNull PlanKey branchKey) Description copied from interface:DeploymentVersionServiceSearch for deployment versions in a project associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)This method fetches complete version data,
DeploymentVersionService.searchVersionsByBranchNoVariables(DeploymentProject, PlanKey)should be preferred when variable data is not required, e.g. for displaying list of version in the UI.- Specified by:
searchVersionsByBranchin interfaceDeploymentVersionService- Parameters:
deploymentProjectId- deployment project to search withinbranchKey- plan branch to narrow search result- Returns:
- list of Deployment Versions matching the search criteria
-
searchVersionsByBranchAndName
@NotNull public @NotNull List<DeploymentVersion> searchVersionsByBranchAndName(long deploymentProjectId, @NotNull @NotNull PlanKey branchKey, @NotNull @NotNull String searchTerm) Description copied from interface:DeploymentVersionServiceSearch for deployment versions in a project whose name contains the searchTerm, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)This method fetches complete version data,
DeploymentVersionService.searchVersionsByBranchAndNameNoVariables(DeploymentProject, PlanKey, String)should be preferred when variable data is not required, e.g. for displaying list of version in the UI.- Specified by:
searchVersionsByBranchAndNamein interfaceDeploymentVersionService- Parameters:
deploymentProjectId- deployment project to search withinbranchKey- plan branch to narrow search resultsearchTerm- term to look for.- Returns:
- list of Deployment Versions matching the search criteria
-
searchVersionsByNameNoVariables
@NotNull public @NotNull List<DeploymentVersion> searchVersionsByNameNoVariables(@NotNull @NotNull DeploymentProject deploymentProject, @NotNull @NotNull String searchTerm) Description copied from interface:DeploymentVersionServiceSearch for deployment versions in a project whose name contains the searchTerm, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)- Specified by:
searchVersionsByNameNoVariablesin interfaceDeploymentVersionService- Parameters:
deploymentProject- deployment project to search withinsearchTerm- term to look for.- Returns:
- list of Deployment Versions matching the search criteria
-
searchVersionsByNameNoVariables
@NotNull public @NotNull List<DeploymentVersion> searchVersionsByNameNoVariables(@NotNull @NotNull DeploymentProject deploymentProject, @NotNull @NotNull String searchTerm, int offset, int maxResults, @NotNull @NotNull DeploymentVersionService.DeploymentVersionNeededAttributes deploymentVersionNeededAttributes) Description copied from interface:DeploymentVersionServiceSearch for deployment versions in a project whose name contains the searchTerm, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)- Specified by:
searchVersionsByNameNoVariablesin interfaceDeploymentVersionService- Parameters:
deploymentProject- deployment project to search withinsearchTerm- term to look for.offset- number of results to skipmaxResults- maximum length of the returned listdeploymentVersionNeededAttributes- specify whether certain attributes will be loaded or not.- Returns:
- list of Deployment Versions matching the search criteria
-
searchVersionsByBranchNoVariables
@NotNull public @NotNull List<DeploymentVersion> searchVersionsByBranchNoVariables(@NotNull @NotNull DeploymentProject deploymentProject, @NotNull @NotNull PlanKey branchKey) Description copied from interface:DeploymentVersionServiceSearch for deployment versions in a project associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)- Specified by:
searchVersionsByBranchNoVariablesin interfaceDeploymentVersionService- Parameters:
deploymentProject- deployment project to search withinbranchKey- plan branch to narrow search result- Returns:
- list of Deployment Versions matching the search criteria
-
searchVersionsByBranchNoVariables
@NotNull public @NotNull List<DeploymentVersion> searchVersionsByBranchNoVariables(@NotNull @NotNull DeploymentProject deploymentProject, @NotNull @NotNull PlanKey branchKey, int startIndex, int maxResults) Description copied from interface:DeploymentVersionServiceSearch for deployment versions in a project associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)- Specified by:
searchVersionsByBranchNoVariablesin interfaceDeploymentVersionService- Parameters:
deploymentProject- deployment project to search withinbranchKey- plan branch to narrow search result- Returns:
- list of Deployment Versions matching the search criteria
-
searchVersionsByBranchNoVariables
@NotNull public @NotNull List<DeploymentVersion> searchVersionsByBranchNoVariables(@NotNull @NotNull DeploymentProject deploymentProject, @NotNull @NotNull PlanKey branchKey, int startIndex, int maxResults, @NotNull @NotNull DeploymentVersionService.DeploymentVersionNeededAttributes deploymentVersionNeededAttributes) Description copied from interface:DeploymentVersionServiceSearch for deployment versions in a project associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)- Specified by:
searchVersionsByBranchNoVariablesin interfaceDeploymentVersionService- Parameters:
deploymentProject- deployment project to search withinbranchKey- plan branch to narrow search resultstartIndex- number of results to skipmaxResults- maximum length of the returned listdeploymentVersionNeededAttributes- specify whether certain attributes will be loaded or not.- Returns:
- list of Deployment Versions matching the search criteria
-
searchVersionsByBranchAndNameNoVariables
@NotNull public @NotNull List<DeploymentVersion> searchVersionsByBranchAndNameNoVariables(@NotNull @NotNull DeploymentProject deploymentProject, @NotNull @NotNull PlanKey branchKey, @NotNull @NotNull String searchTerm) Description copied from interface:DeploymentVersionServiceSearch for deployment versions in a project whose name contains the searchTerm and associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)- Specified by:
searchVersionsByBranchAndNameNoVariablesin interfaceDeploymentVersionService- Parameters:
deploymentProject- deployment project to search withinbranchKey- plan branch to narrow search resultsearchTerm- term to look for.- Returns:
- list of Deployment Versions matching the search criteria
-
searchVersionsByBranchAndNameNoVariables
@NotNull public @NotNull List<DeploymentVersion> searchVersionsByBranchAndNameNoVariables(@NotNull @NotNull DeploymentProject deploymentProject, @NotNull @NotNull PlanKey branchKey, @NotNull @NotNull String searchTerm, int offset, int maxResults, @NotNull DeploymentVersionService.DeploymentVersionNeededAttributes deploymentVersionNeededAttributes) Description copied from interface:DeploymentVersionServiceSearch for deployment versions in a project whose name contains the searchTerm and associated with a specific branch, sorted by CreationDate (the most recent Deployment Versions will be returned as firsts)- Specified by:
searchVersionsByBranchAndNameNoVariablesin interfaceDeploymentVersionService- Parameters:
deploymentProject- deployment project to search withinbranchKey- plan branch to narrow search resultsearchTerm- term to look for.offset- number of results to skipmaxResults- maximum length of the returned listdeploymentVersionNeededAttributes- specify whether certain attributes will be loaded or not.- Returns:
- list of Deployment Versions matching the search criteria
-
getVersionsCount
public int getVersionsCount()Description copied from interface:DeploymentVersionServiceCount all versions- Specified by:
getVersionsCountin interfaceDeploymentVersionService- Returns:
- number of versions created in all deployment projects
-
getVersionsCountForProject
public int getVersionsCountForProject(long deploymentProjectId) Description copied from interface:DeploymentVersionServiceCount versions related to deployment project- Specified by:
getVersionsCountForProjectin interfaceDeploymentVersionService- Parameters:
deploymentProjectId- id of deployment project- Returns:
- number of versions created in deployment project
-
getVersionsCountForProjectAndBranch
public int getVersionsCountForProjectAndBranch(@NotNull @org.jetbrains.annotations.NotNull long deploymentProjectId, @NotNull @NotNull PlanKey branchKey) Description copied from interface:DeploymentVersionServiceCount versions related to deployment project and a specified plan branch- Specified by:
getVersionsCountForProjectAndBranchin interfaceDeploymentVersionService- Parameters:
deploymentProjectId- id of deployment projectbranchKey- plan branch key- Returns:
- number of versions created in deployment project
-
getRelatedPlanResultKeys
Description copied from interface:DeploymentVersionServiceRetrieve the PlanResultKeys of ResultSummaries related to a particular DeploymentVersion- Specified by:
getRelatedPlanResultKeysin interfaceDeploymentVersionService
-
getRelatedPlanResultKeys
@NotNull public @NotNull Map<Long,PlanResultKey> getRelatedPlanResultKeys(@NotNull @NotNull Set<Long> deploymentVersionIds) Description copied from interface:DeploymentVersionServiceRetrieve the PlanResultKeys of ResultSummaries related to a particular DeploymentVersions- Specified by:
getRelatedPlanResultKeysin interfaceDeploymentVersionService
-
isFromTheSameBranch
public boolean isFromTheSameBranch(long firstVersionId, long secondVersionId) Description copied from interface:DeploymentVersionServiceChecks if both deployment versions come from the same branch- Specified by:
isFromTheSameBranchin interfaceDeploymentVersionService- Parameters:
firstVersionId- first deployment versionsecondVersionId- second deployment version- Returns:
-
isFromTheSameBranch
Description copied from interface:DeploymentVersionServiceChecks if the specified build result is on the same branch as the specified version ID- Specified by:
isFromTheSameBranchin interfaceDeploymentVersionService- Parameters:
planKey- the planKey of the build result you want to compareversionId- the version ID of the version you want to compare- Returns:
-
getLatestVersionStatus
- Specified by:
getLatestVersionStatusin interfaceDeploymentVersionService
-
getAllUsersLatestVersionStatusDtosOrderedByCreationDate
@NotNull public @NotNull List<DeploymentVersionStatus> getAllUsersLatestVersionStatusDtosOrderedByCreationDate(long deploymentVersionId) - Specified by:
getAllUsersLatestVersionStatusDtosOrderedByCreationDatein interfaceDeploymentVersionService- Returns:
- all users' version statuses for the requested deploymentVersionId.
-
getLatestVersionStatuses
@NotNull public @NotNull Map<Long,DeploymentVersionStatus> getLatestVersionStatuses(@NotNull @NotNull List<Long> deploymentVersionIds) Description copied from interface:DeploymentVersionServiceFind a latest version status for each version id. If no version status is available, the resulting map will not contain corresponding entry.- Specified by:
getLatestVersionStatusesin interfaceDeploymentVersionService
-
getAllUsersLatestVersionStatusesOrderedByCreationDate
@NotNull public @NotNull Map<Long,List<DeploymentVersionStatus>> getAllUsersLatestVersionStatusesOrderedByCreationDate(@NotNull @NotNull List<Long> deploymentVersionIds) Description copied from interface:DeploymentVersionServiceFind all users' latest version statuses for each version id ordered by creation date. If no version status is available, the resulting map will contain empty list.- Specified by:
getAllUsersLatestVersionStatusesOrderedByCreationDatein interfaceDeploymentVersionService
-
updateVersionStatus
@NotNull public @NotNull DeploymentVersionStatus updateVersionStatus(long deploymentVersionId, @NotNull @NotNull DeploymentVersionState status, @NotNull @NotNull String userName) Description copied from interface:DeploymentVersionServiceUpdates the version status for given deployment version.- Specified by:
updateVersionStatusin interfaceDeploymentVersionService
-
findVersionsBetween
@NotNull public @NotNull List<DeploymentVersion> findVersionsBetween(long deploymentProjectId, @NotNull @NotNull DeploymentVersion version1, @NotNull @NotNull DeploymentVersion version2) Description copied from interface:DeploymentVersionServiceFind versions created between version1 and version2. The versions must be different but belong to the sameDeploymentProjectThe 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)- Specified by:
findVersionsBetweenin interfaceDeploymentVersionService
-
findVersionsBetweenNoVariables
@NotNull public @NotNull List<DeploymentVersion> findVersionsBetweenNoVariables(long deploymentProjectId, @NotNull @NotNull DeploymentVersion version1, @NotNull @NotNull DeploymentVersion version2) Description copied from interface:DeploymentVersionServiceFind versions created between version1 and version2. The versions must be different but belong to the sameDeploymentProjectThe 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)- Specified by:
findVersionsBetweenNoVariablesin interfaceDeploymentVersionService
-
findPreviousVersion
@Nullable public @Nullable DeploymentVersion findPreviousVersion(long deploymentProjectId, long versionId) - Specified by:
findPreviousVersionin interfaceDeploymentVersionService
-
getVersionArtifacts
@NotNull public @NotNull Multimap<String,Artifact> getVersionArtifacts(@NotNull @NotNull DeploymentVersion deploymentVersion) Description copied from interface:DeploymentVersionServiceFind allArtifactrelated to a version.- Specified by:
getVersionArtifactsin interfaceDeploymentVersionService- Returns:
-
getRelatedVersion
@Nullable public @Nullable DeploymentVersion getRelatedVersion(long deploymentProjectId, @NotNull @NotNull PlanResultKey planResultKey) Description copied from interface:DeploymentVersionServiceFind latest version of a deployment project that is related to specific plan result.- Specified by:
getRelatedVersionin interfaceDeploymentVersionService- Returns:
-
findNextVersionContainingResult
public DeploymentVersion findNextVersionContainingResult(long deploymentProjectId, @NotNull @NotNull PlanResultKey planResultKey) Description copied from interface:DeploymentVersionServiceFind the first version that is created from a result which is later than current result (not taking custom revision into account)- Specified by:
findNextVersionContainingResultin interfaceDeploymentVersionService- Returns:
-
getIncrementedVersionName
Description copied from interface:DeploymentVersionServiceCalculates an increment of a version name. Increments last number in the name. If nothing found to increment will return passed in value.- Specified by:
getIncrementedVersionNamein interfaceDeploymentVersionService- Parameters:
versionName- to increment- Returns:
- incremented version name.
-
getEvaluatedVersionName
@NotNull public @NotNull String getEvaluatedVersionName(String nextVersionName, Map<String, VariableDefinitionContext> variables, Set<String> variablesToIncrement) - Specified by:
getEvaluatedVersionNamein interfaceDeploymentVersionService- Returns:
-
updatePlanKey
public void updatePlanKey(@NotNull @NotNull PlanKey originalPlanKey, @NotNull @NotNull PlanKey newPlanKey) Description copied from interface:DeploymentVersionServiceUpdate planKey in DeploymentVersion's related entities when plan key has changed (ie after moving plan)- Specified by:
updatePlanKeyin interfaceDeploymentVersionService- Parameters:
originalPlanKey- original PlanKeynewPlanKey- new PlanKey
-
findVersionsAssociatedWithJiraIssue
@NotNull public @NotNull List<DeploymentVersion> findVersionsAssociatedWithJiraIssue(long deploymentProjectId, @NotNull @NotNull String issueKey) Description copied from interface:DeploymentVersionServiceFind all the versions of aDeploymentProjectthat are associated with a JIRA issue- Specified by:
findVersionsAssociatedWithJiraIssuein interfaceDeploymentVersionService
-
findVersionsAssociatedWithJiraIssue
@NotNull public @NotNull Multimap<DeploymentProject,DeploymentVersion> findVersionsAssociatedWithJiraIssue(@NotNull @NotNull String issueKey) Description copied from interface:DeploymentVersionServiceFind all the version that are associated with a JIRA issue, grouped byDeploymentProject- Specified by:
findVersionsAssociatedWithJiraIssuein interfaceDeploymentVersionService
-
findVersionIdentifiersAssociatedWithJiraIssue
@NotNull public @NotNull Multimap<DeploymentProject,Pair<Long, findVersionIdentifiersAssociatedWithJiraIssuePlanResultKey>> (@NotNull @NotNull String issueKey) Description copied from interface:DeploymentVersionServiceFind all the version identifiers that are associated with a JIRA issue, grouped byDeploymentProjectNote: this API is in its intermittent form and is subject to change.- Specified by:
findVersionIdentifiersAssociatedWithJiraIssuein interfaceDeploymentVersionService
-
findLatestKnownVersionsForEnvironmentsOfDeploymentProject
@NotNull public @NotNull Map<DeploymentVersion,Integer> findLatestKnownVersionsForEnvironmentsOfDeploymentProject(DeploymentProject deploymentProject) Description copied from interface:DeploymentVersionServiceFind allDeploymentVersionthat are currently deployed on environments of aDeploymentProjectFor each version found give number of environments it is present on.- Specified by:
findLatestKnownVersionsForEnvironmentsOfDeploymentProjectin interfaceDeploymentVersionService- Returns:
-
findUserRelatedDeploymentVersionStatus
@NotNull public static @NotNull Optional<DeploymentVersionState> findUserRelatedDeploymentVersionStatus(@NotNull @NotNull List<? extends DeploymentVersionStatus> versionStatuses, @NotNull @NotNull String userName)
-