Interface DeploymentVersionDao
- All Known Implementing Classes:
DeploymentVersionDaoImpl
public interface DeploymentVersionDao
-
Method Summary
Modifier and TypeMethodDescription@NotNull MutableDeploymentVersionStatus
createNewVersionStatus
(long deploymentVersionId, DeploymentVersionState state, @NotNull String userName) Creates a new vesion status for the given deployment version.void
delete
(MutableDeploymentVersion deploymentVersion) Delete MutableDeploymentVersionvoid
deleteById
(long deploymentVersionId) Delete MutableDeploymentVersionint
deleteForDeploymentProject
(long deploymentProjectId) Delete DeploymentVersion records related to given DeploymentProject.int
deleteVersionItems
(long deploymentVersionId) Delete DeploymentVersionItem records related to given DeploymentVersion.int
deleteVersionStatus
(long deploymentVersionId) Delete DeploymentVersionStatus records related to a given versionint
deleteVersionStatuses
(@NotNull DeploymentVersionDeletionAdapter deletionAdapter) Delete DeploymentVersionStatus records related to a given versionsfindLatestKnownVersionsForEnvironmentsOfDeploymentProject
(long deploymentProjectId) Find all the versions that are currently deployed on environments of a deployment projects.@Nullable MutableDeploymentVersion
findLatestVersionForProject
(long deploymentProjectId) Find the latest version for a deployment project.@Nullable MutableDeploymentVersion
findLatestVersionForProject
(long deploymentProjectId, @NotNull PlanKey branchKey) Find the latest version for a deployment project.@Nullable MutableDeploymentVersion
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 MutableDeploymentVersion
findPreviousVersion
(long deploymentProjectId, @NotNull MutableDeploymentVersion deploymentVersion) Find the last version created before this one.@NotNull List<DeploymentVersionDto>
findVersionDtos
(DeploymentVersionSearchCriteria searchCriteria) @NotNull Iterable<DeploymentVersionDto>
findVersionDtosBetween
(long deploymentProjectId, long version1Id, long version2Id) findVersionIdentifiersAssociatedWithJiraIssue
(@NotNull String issueKey) Find all the version identifiers that are associated with a JIRA issue, grouped byDeploymentProject
Note: this API is in its intermittent form and is subject to change.@NotNull List<MutableDeploymentVersion>
findVersions
(@NotNull DeploymentVersionSearchCriteria searchCriteria) Search for versions using search criteria@NotNull List<MutableDeploymentVersion>
findVersionsAssociatedWithJiraIssue
(long deploymentProjectId, @NotNull String issueKey) Find all the versions of aDeploymentProject
that are associated with a JIRA issue@NotNull List<MutableDeploymentVersion>
findVersionsAssociatedWithJiraIssue
(@NotNull String issueKey) Find all the versions that are associated with a JIRA issuefindVersionsBetween
(long deploymentVersionId, long version1Id, long version2Id) Find versions created between version1 and version2.@NotNull List<DeploymentVersionStatusDto>
getAllUsersLatestVersionStatusDtosOrderedByCreationDate
(long deploymentVersionId) Retrieves all users' latest deployment version statuses for a requested deploymentVersionId ordered by creation date.@NotNull Map<Long,
List<DeploymentVersionStatusDto>> getAllUsersLatestVersionStatusDtosOrderedByCreationDate
(@NotNull List<Long> deploymentVersionIds) @Nullable MutableDeploymentVersion
getDeploymentVersion
(long deploymentVersionId) Get MutableDeploymentVersion by id@Nullable MutableDeploymentVersion
getDeploymentVersionByName
(@NotNull String existingVersionName, long deploymentProjectId) Retrieve a specific version by name for a project@NotNull List<DeploymentVersionDto>
getDeploymentVersionDtosForDeploymentProject
(long deploymentProjectId, int offset, int maxResults) @NotNull List<MutableDeploymentVersion>
getDeploymentVersionsForDeploymentProject
(long deploymentProjectId) Get MutableDeploymentVersion by DeploymentProject id@Nullable MutableDeploymentVersionStatus
getLatestVersionStatus
(long deploymentVersionId) Retrieves deployment version status.getLatestVersionStatusDto
(long deploymentVersionId) Deprecated.@NotNull Map<Long,
DeploymentVersionStatusDto> getLatestVersionStatusDtos
(@NotNull List<Long> deploymentVersionIds) Deprecated.since 9.4 usegetAllUsersLatestVersionStatusDtosOrderedByCreationDate(List<Long>)
instead@NotNull Set<PlanResultKey>
getRelatedPlanResultKeys
(long deploymentVersionId) @NotNull Map<Long,
PlanResultKey> getRelatedPlanResultKeys
(Set<Long> deploymentVersionIds) Retrieve the PlanResultKeys of ResultSummaries related to a particular DeploymentVersions@Nullable MutableDeploymentVersion
getRelatedVersion
(long deploymentProjectId, @NotNull PlanResultKey planResultKey) Find latest version of a deployment project that is related to specific plan result.@NotNull List<MutableDeploymentVersion>
getRelatedVersions
(@NotNull PlanResultKey planResultKey) All versions project that are 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<ArtifactDeploymentVersionItemDto>
getVersionItemDtos
(long versionId) Find version items associated with a version.int
Count all versionsint
getVersionsCountForProject
(long deploymentProjectId) Count versions related to deployment projectint
getVersionsCountForProjectAndBranch
(long deploymentProjectId, @NotNull PlanKey branchKey) Count versions related to deployment project and a specific plan branch@NotNull List<MutableDeploymentVersionStatus>
getVersionStatuses
(long deploymentVersionId) GetMutableDeploymentVersionStatus
es by DeploymentVersion idboolean
hasVersions
(@NotNull DeploymentVersionSearchCriteria searchCriteria) Test if versions that match criteria do existboolean
isVersionNameConflicting
(@NotNull String name, long deploymentProjectId) Check whether the version name is already being used by another version within this projectvoid
save
(@NotNull MutableDeploymentVersion deploymentVersion) Save MutableDeploymentVersionvoid
updatePlanKey
(@NotNull PlanKey originalPlanKey, @NotNull PlanKey newPlanKey) Update planKey in DeploymentVersion's related entities when plan key has changed (ie after moving plan)
-
Method Details
-
getDeploymentVersion
Get MutableDeploymentVersion by id -
getResultPlanKeysHavingDeploymentProjectVersions
Returns keys of result plans (branch) that have at least one deployment project version (release)- Parameters:
deploymentProjectId
- id of the deployment project
-
getDeploymentVersionsForDeploymentProject
@NotNull @NotNull List<MutableDeploymentVersion> getDeploymentVersionsForDeploymentProject(long deploymentProjectId) Get MutableDeploymentVersion by DeploymentProject id -
save
Save MutableDeploymentVersion -
deleteById
void deleteById(long deploymentVersionId) Delete MutableDeploymentVersion -
delete
Delete MutableDeploymentVersion -
deleteForDeploymentProject
int deleteForDeploymentProject(long deploymentProjectId) Delete DeploymentVersion records related to given DeploymentProject. This will only attempt to remove DeploymentVersion and data that is normally cascaded by Hibernate. For complete DeploymentVersion deletion please seeDeploymentVersionDeletionService
.- Parameters:
deploymentProjectId
- id of DeploymentProject- Returns:
- number of deleted DeploymentVersion records
-
deleteVersionItems
int deleteVersionItems(long deploymentVersionId) Delete DeploymentVersionItem records related to given DeploymentVersion. This will only attempt to remove DeploymentVersion and data that is normally cascaded by Hibernate. For complete DeploymentVersion deletion please seeDeploymentVersionDeletionService
.- Parameters:
deploymentVersionId
- id of DeploymentVersion- Returns:
- number of deleted DeploymentVersionItem records
-
findVersions
@NotNull @NotNull List<MutableDeploymentVersion> findVersions(@NotNull @NotNull DeploymentVersionSearchCriteria searchCriteria) Search for versions using search criteria- Parameters:
searchCriteria
- search criteria- Returns:
- list of versions that match the criteria
-
hasVersions
Test if versions that match criteria do exist- Parameters:
searchCriteria
- search criteria- Returns:
- true if there are versions that match criteria
-
isVersionNameConflicting
Check whether the version name is already being used by another version within this project- Parameters:
name
- to checkdeploymentProjectId
- project to filter by- Returns:
- true if name is already being used.
-
getDeploymentVersionByName
@Nullable @Nullable MutableDeploymentVersion getDeploymentVersionByName(@NotNull @NotNull String existingVersionName, long deploymentProjectId) Retrieve a specific version by name for a project- Parameters:
existingVersionName
- name of version to finddeploymentProjectId
- of project to look in- Returns:
- version with specified name in the given project. Null if could not be found.
-
findPreviousVersion
@Nullable @Nullable MutableDeploymentVersion findPreviousVersion(long deploymentProjectId, @NotNull @NotNull MutableDeploymentVersion deploymentVersion) Find the last version created before this one. If version is related to any DeploymentVersionPlanResultKey then previous version would also be related to the same plan key (so we can find previous version created off the same branch). -
findLatestVersionForProject
Find the latest version for a deployment project. Comparison based on creation date.- Parameters:
deploymentProjectId
- id of the deployment project- Returns:
- the latest version for a deployment project
-
findLatestVersionForProject
@Nullable @Nullable MutableDeploymentVersion findLatestVersionForProject(long deploymentProjectId, @NotNull @NotNull PlanKey branchKey) Find the latest version for a deployment project. Comparison based on creation date.- Parameters:
deploymentProjectId
- id of the deployment projectbranchKey
- key of the PlanBranch- Returns:
- the latest version created for a branch for a deployment project
-
getRelatedPlanResultKeys
- Returns:
- Retrieve the PlanResultKeys of ResultSummaries related to a particular DeploymentVersion
-
getLatestVersionStatus
Retrieves deployment version status. For better performance, consider usinggetLatestVersionStatusDto(long)
instead.- Returns:
- Latest deployment version status.
-
getLatestVersionStatusDto
Deprecated.since 9.4 usegetAllUsersLatestVersionStatusDtosOrderedByCreationDate(long)
insteadRetrieves deployment version status.- Returns:
- Latest deployment version status.
-
getAllUsersLatestVersionStatusDtosOrderedByCreationDate
@NotNull @NotNull List<DeploymentVersionStatusDto> getAllUsersLatestVersionStatusDtosOrderedByCreationDate(long deploymentVersionId) Retrieves all users' latest deployment version statuses for a requested deploymentVersionId ordered by creation date.- Returns:
- deployment version status dtos.
- Since:
- 9.4
-
createNewVersionStatus
@NotNull @NotNull MutableDeploymentVersionStatus createNewVersionStatus(long deploymentVersionId, DeploymentVersionState state, @NotNull @NotNull String userName) Creates a new vesion status for the given deployment version. -
getVersionStatuses
GetMutableDeploymentVersionStatus
es by DeploymentVersion id -
findVersionsBetween
Iterable<MutableDeploymentVersion> findVersionsBetween(long deploymentVersionId, long version1Id, long version2Id) Find versions created between version1 and version2. The order of the argument is irrelevant. Lower bound is not included in result but upper bound is. The result is sorted by creation date (newest first)- Parameters:
deploymentVersionId
-version1Id
-version2Id
-- Returns:
- Throws:
IllegalArgumentException
- if any of the version doesn't exist
-
deleteVersionStatus
int deleteVersionStatus(long deploymentVersionId) Delete DeploymentVersionStatus records related to a given version- Parameters:
deploymentVersionId
- id of the DeploymentVersion- Returns:
- number of deleted DeploymentVersionStatus records
-
deleteVersionStatuses
Delete DeploymentVersionStatus records related to a given versions- Parameters:
deletionAdapter
-DeletionSQLAdapter.getInClause()
should provide range of DeploymentVersions to remove- Returns:
- number of deleted DeploymentVersionStatus records
-
getVersionsCount
int getVersionsCount()Count all versions- Returns:
- number of versions created in all deployment projects
-
getVersionsCountForProject
int getVersionsCountForProject(long deploymentProjectId) Count versions related to deployment project- Parameters:
deploymentProjectId
- id of deployment project- Returns:
- number of versions existing for a deployment project
-
getVersionsCountForProjectAndBranch
int getVersionsCountForProjectAndBranch(long deploymentProjectId, @NotNull @NotNull PlanKey branchKey) Count versions related to deployment project and a specific plan branch- Parameters:
deploymentProjectId
- id of deployment projectbranchKey
- plan branch key- Returns:
- number of versions existing for a deployment project and a plan branch
-
getRelatedVersion
@Nullable @Nullable MutableDeploymentVersion getRelatedVersion(long deploymentProjectId, @NotNull @NotNull PlanResultKey planResultKey) Find latest version of a deployment project that is related to specific plan result.- Parameters:
deploymentProjectId
-planResultKey
-- Returns:
-
getRelatedVersions
@NotNull @NotNull List<MutableDeploymentVersion> getRelatedVersions(@NotNull @NotNull PlanResultKey planResultKey) All versions project that are related to specific plan result. -
findNextVersionContainingResult
@Nullable @Nullable MutableDeploymentVersion findNextVersionContainingResult(long deploymentProjectId, @NotNull @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:
-
updatePlanKey
Update planKey in DeploymentVersion's related entities when plan key has changed (ie after moving plan)- Parameters:
originalPlanKey
- original PlanKeynewPlanKey
- new PlanKey
-
findVersionsAssociatedWithJiraIssue
@NotNull @NotNull List<MutableDeploymentVersion> findVersionsAssociatedWithJiraIssue(long deploymentProjectId, @NotNull @NotNull String issueKey) Find all the versions of aDeploymentProject
that are associated with a JIRA issue- Parameters:
deploymentProjectId
-issueKey
-- Since:
- 5.1
-
findVersionsAssociatedWithJiraIssue
@NotNull @NotNull List<MutableDeploymentVersion> findVersionsAssociatedWithJiraIssue(@NotNull @NotNull String issueKey) Find all the versions that are associated with a JIRA issue- Parameters:
issueKey
-- Since:
- 5.1
-
findLatestKnownVersionsForEnvironmentsOfDeploymentProject
List<MutableDeploymentVersion> findLatestKnownVersionsForEnvironmentsOfDeploymentProject(long deploymentProjectId) Find all the versions that are currently deployed on environments of a deployment projects. Return duplicates if deployed on more than one environments.- Parameters:
deploymentProjectId
-- Returns:
-
getDeploymentVersionDtosForDeploymentProject
@NotNull @NotNull List<DeploymentVersionDto> getDeploymentVersionDtosForDeploymentProject(long deploymentProjectId, int offset, int maxResults) - Since:
- 6.6
-
getVersionItemDtos
Find version items associated with a version. -
findVersionDtos
@NotNull @NotNull List<DeploymentVersionDto> findVersionDtos(DeploymentVersionSearchCriteria searchCriteria) - Since:
- 6.6
-
getLatestVersionStatusDtos
@Deprecated @NotNull @NotNull Map<Long,DeploymentVersionStatusDto> getLatestVersionStatusDtos(@NotNull @NotNull List<Long> deploymentVersionIds) Deprecated.since 9.4 usegetAllUsersLatestVersionStatusDtosOrderedByCreationDate(List<Long>)
instead- Since:
- 6.8
-
getAllUsersLatestVersionStatusDtosOrderedByCreationDate
@NotNull @NotNull Map<Long,List<DeploymentVersionStatusDto>> getAllUsersLatestVersionStatusDtosOrderedByCreationDate(@NotNull @NotNull List<Long> deploymentVersionIds) - Returns:
- all users' version statuses for the requested deploymentVersionIds.
- Since:
- 9.4
-
findVersionDtosBetween
@NotNull @NotNull Iterable<DeploymentVersionDto> findVersionDtosBetween(long deploymentProjectId, long version1Id, long version2Id) - Since:
- 6.8
-
findVersionIdentifiersAssociatedWithJiraIssue
@Internal Multimap<MutableDeploymentProject,Pair<Long, findVersionIdentifiersAssociatedWithJiraIssuePlanResultKey>> (@NotNull @NotNull String issueKey) Find all the version identifiers that are associated with a JIRA issue, grouped byDeploymentProject
Note: this API is in its intermittent form and is subject to change.- Parameters:
issueKey
-- Since:
- 9.3
-
getRelatedPlanResultKeys
Retrieve the PlanResultKeys of ResultSummaries related to a particular DeploymentVersions- Since:
- 9.3
-
getAllUsersLatestVersionStatusDtosOrderedByCreationDate(long)
instead