Interface ArtifactDao

All Known Implementing Classes:
ArtifactHibernateDao

public interface ArtifactDao
  • Method Details

    • save

      void save(MutableArtifact artifact)
      Save artifact.
      Parameters:
      artifact -
    • findAll

      List<MutableArtifact> findAll()
      Returns:
    • findById

      @Nullable @Nullable MutableArtifact findById(long id)
      Find MutableArtifact by id.
      Parameters:
      id -
      Returns:
    • isReferencedByVersion

      boolean isReferencedByVersion(long artifactId)
      Parameters:
      artifactId -
      Returns:
      true iff artifact is a part of a deployment verison
    • findPlanResultArtifactsReferencedByVersion

      List<MutableArtifact> findPlanResultArtifactsReferencedByVersion(@NotNull @NotNull PlanResultKey planResultKey)
      Find all artifacts that belong to a build result are part of a deployment version.
      Parameters:
      planResultKey -
      Returns:
    • findPlanArtifactsReferencedByVersion

      List<MutableArtifact> findPlanArtifactsReferencedByVersion(@NotNull @NotNull PlanKey planKey)
      Find all artifacts that belong to a plan are part of a deployment version.
      Parameters:
      planKey -
      Returns:
    • removeById

      void removeById(long id)
      Remove artifact.
      Parameters:
      id -
    • removeByPlanKey

      void removeByPlanKey(@NotNull @NotNull PlanKey planKey)
      Remove all artifacts that belong to a plan and are not part of a deployment version.
      Parameters:
      planKey -
    • removeByPlanResultKey

      void removeByPlanResultKey(@NotNull @NotNull PlanResultKey planResultKey)
      Remove all artifacts that belong to a build result and are not part of a deployment version.
      Parameters:
      planResultKey -
    • findOrphanedArtifacts

      List<MutableArtifact> findOrphanedArtifacts()
      Find all artifacts that are no longer referenced by any result or version.
      Returns:
    • findOrphanedArtifactsByIds

      List<MutableArtifact> findOrphanedArtifactsByIds(@NotNull @NotNull List<Long> artifactIds)
      Find all artifacts which id is on the list and that are no longer referenced by any result or version.
      Since:
      6.9
    • removeAll

      void removeAll(@NotNull @NotNull Collection<MutableArtifact> artifacts)
      Remove all artifacts in the collection
    • removeAllByIds

      void removeAllByIds(@NotNull @NotNull Collection<Long> artifactIds)
    • updatePlanKey

      void updatePlanKey(@NotNull @NotNull PlanKey originalPlanKey, @NotNull @NotNull PlanKey newPlanKey)
      Update planKey in Artifact entities when plan key has changed (ie after moving plan)
      Parameters:
      originalPlanKey - original PlanKey
      newPlanKey - new PlanKey
    • findArtifactUsedStorageByLinkType

      @NotNull @NotNull Map<String,Long> findArtifactUsedStorageByLinkType()
      Find how much space artifacts use by link type, e.g. local storage, AWS, agent side etc
      Returns:
      artifact link type -> artifacts size in bytes