Interface DeploymentVersionDao
- All Known Implementing Classes:
DeploymentVersionDaoImpl
public interface DeploymentVersionDao
-
Method Summary
Modifier and TypeMethodDescription@NotNull MutableDeploymentVersionStatuscreateNewVersionStatus(long deploymentVersionId, DeploymentVersionState state, @NotNull String userName) Creates a new vesion status for the given deployment version.voiddelete(MutableDeploymentVersion deploymentVersion) Delete MutableDeploymentVersionvoiddeleteById(long deploymentVersionId) Delete MutableDeploymentVersionintdeleteForDeploymentProject(long deploymentProjectId) Delete DeploymentVersion records related to given DeploymentProject.intdeleteVersionItems(long deploymentVersionId) Delete DeploymentVersionItem records related to given DeploymentVersion.intdeleteVersionStatus(long deploymentVersionId) Delete DeploymentVersionStatus records related to a given versionintdeleteVersionStatuses(@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 MutableDeploymentVersionfindLatestVersionForProject(long deploymentProjectId) Find the latest version for a deployment project.@Nullable MutableDeploymentVersionfindLatestVersionForProject(long deploymentProjectId, @NotNull PlanKey branchKey) Find the latest version for a deployment project.@Nullable MutableDeploymentVersionfindNextVersionContainingResult(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 MutableDeploymentVersionfindPreviousVersion(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 byDeploymentProjectNote: 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 aDeploymentProjectthat 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 MutableDeploymentVersiongetDeploymentVersion(long deploymentVersionId) Get MutableDeploymentVersion by id@Nullable MutableDeploymentVersiongetDeploymentVersionByName(@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 MutableDeploymentVersionStatusgetLatestVersionStatus(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 MutableDeploymentVersiongetRelatedVersion(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.intCount all versionsintgetVersionsCountForProject(long deploymentProjectId) Count versions related to deployment projectintgetVersionsCountForProjectAndBranch(long deploymentProjectId, @NotNull PlanKey branchKey) Count versions related to deployment project and a specific plan branch@NotNull List<MutableDeploymentVersionStatus>getVersionStatuses(long deploymentVersionId) GetMutableDeploymentVersionStatuses by DeploymentVersion idbooleanhasVersions(@NotNull DeploymentVersionSearchCriteria searchCriteria) Test if versions that match criteria do existbooleanisVersionNameConflicting(@NotNull String name, long deploymentProjectId) Check whether the version name is already being used by another version within this projectvoidsave(@NotNull MutableDeploymentVersion deploymentVersion) Save MutableDeploymentVersionvoidupdatePlanKey(@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
GetMutableDeploymentVersionStatuses 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 aDeploymentProjectthat 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 byDeploymentProjectNote: 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