Interface DeploymentVersionDao

All Known Implementing Classes:
DeploymentVersionDaoImpl

public interface DeploymentVersionDao
  • Method Details

    • getDeploymentVersion

      @Nullable @Nullable MutableDeploymentVersion getDeploymentVersion(long deploymentVersionId)
      Get MutableDeploymentVersion by id
    • getResultPlanKeysHavingDeploymentProjectVersions

      List<String> getResultPlanKeysHavingDeploymentProjectVersions(long deploymentProjectId)
      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

      void save(@NotNull @NotNull MutableDeploymentVersion deploymentVersion)
      Save MutableDeploymentVersion
    • delete

      void delete(MutableDeploymentVersion deploymentVersion)
      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 see DeploymentVersionDeletionService.
      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 see DeploymentVersionDeletionService.
      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

      boolean hasVersions(@NotNull @NotNull DeploymentVersionSearchCriteria searchCriteria)
      Test if versions that match criteria do exist
      Parameters:
      searchCriteria - search criteria
      Returns:
      true if there are versions that match criteria
    • isVersionNameConflicting

      boolean isVersionNameConflicting(@NotNull @NotNull String name, long deploymentProjectId)
      Check whether the version name is already being used by another version within this project
      Parameters:
      name - to check
      deploymentProjectId - 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 find
      deploymentProjectId - 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

      @Nullable @Nullable MutableDeploymentVersion findLatestVersionForProject(long deploymentProjectId)
      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 project
      branchKey - key of the PlanBranch
      Returns:
      the latest version created for a branch for a deployment project
    • getRelatedPlanResultKeys

      @NotNull @NotNull Set<PlanResultKey> getRelatedPlanResultKeys(long deploymentVersionId)
      Returns:
      Retrieve the PlanResultKeys of ResultSummaries related to a particular DeploymentVersion
    • getLatestVersionStatus

      @Nullable @Nullable MutableDeploymentVersionStatus getLatestVersionStatus(long deploymentVersionId)
      Retrieves deployment version status. For better performance, consider using getLatestVersionStatusDto(long) instead.
      Returns:
      Latest deployment version status.
    • getLatestVersionStatusDto

      @Deprecated DeploymentVersionStatusDto getLatestVersionStatusDto(long deploymentVersionId)
      Retrieves 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

      @NotNull @NotNull List<MutableDeploymentVersionStatus> getVersionStatuses(long deploymentVersionId)
      Get MutableDeploymentVersionStatuses 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

      int deleteVersionStatuses(@NotNull @NotNull DeploymentVersionDeletionAdapter deletionAdapter)
      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 project
      branchKey - 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

      void updatePlanKey(@NotNull @NotNull PlanKey originalPlanKey, @NotNull @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
    • findVersionsAssociatedWithJiraIssue

      @NotNull @NotNull List<MutableDeploymentVersion> findVersionsAssociatedWithJiraIssue(long deploymentProjectId, @NotNull @NotNull String issueKey)
      Find all the versions of a DeploymentProject 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

      @NotNull @NotNull List<ArtifactDeploymentVersionItemDto> getVersionItemDtos(long versionId)
      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)
      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,PlanResultKey>> findVersionIdentifiersAssociatedWithJiraIssue(@NotNull @NotNull String issueKey)
      Find all the version identifiers that are associated with a JIRA issue, grouped by DeploymentProject Note: this API is in its intermittent form and is subject to change.
      Parameters:
      issueKey -
      Since:
      9.3
    • getRelatedPlanResultKeys

      @NotNull @NotNull Map<Long,PlanResultKey> getRelatedPlanResultKeys(Set<Long> deploymentVersionIds)
      Retrieve the PlanResultKeys of ResultSummaries related to a particular DeploymentVersions
      Since:
      9.3