Package com.atlassian.bamboo.artifact
Interface ArtifactDao
- All Known Implementing Classes:
ArtifactHibernateDao
public interface ArtifactDao
-
Method Summary
Modifier and TypeMethodDescriptionfindAll()Find allMutableArtifactFind how much space artifacts use by link type, e.g. local storage, AWS, agent side etc@Nullable MutableArtifactfindById(long id) FindMutableArtifactby id.Find all artifacts that are no longer referenced by any result or version.findOrphanedArtifactsByIds(@NotNull List<Long> artifactIds) Find all artifacts which id is on the list and that are no longer referenced by any result or version.findPlanArtifactsReferencedByVersion(@NotNull PlanKey planKey) Find all artifacts that belong to a plan are part of a deployment version.findPlanResultArtifactsReferencedByVersion(@NotNull PlanResultKey planResultKey) Find all artifacts that belong to a build result are part of a deployment version.booleanisReferencedByVersion(long artifactId) voidremoveAll(@NotNull Collection<MutableArtifact> artifacts) Remove all artifacts in the collectionvoidremoveAllByIds(@NotNull Collection<Long> artifactIds) voidremoveById(long id) Remove artifact.voidremoveByPlanKey(@NotNull PlanKey planKey) Remove all artifacts that belong to a plan and are not part of a deployment version.voidremoveByPlanResultKey(@NotNull PlanResultKey planResultKey) Remove all artifacts that belong to a build result and are not part of a deployment version.voidsave(MutableArtifact artifact) Save artifact.voidupdatePlanKey(@NotNull PlanKey originalPlanKey, @NotNull PlanKey newPlanKey) Update planKey in Artifact entities when plan key has changed (ie after moving plan)
-
Method Details
-
save
Save artifact.- Parameters:
artifact-
-
findAll
List<MutableArtifact> findAll()Find allMutableArtifact- Returns:
-
findById
FindMutableArtifactby 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
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
Remove all artifacts that belong to a plan and are not part of a deployment version.- Parameters:
planKey-
-
removeByPlanResultKey
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
Find all artifacts which id is on the list and that are no longer referenced by any result or version.- Since:
- 6.9
-
removeAll
Remove all artifacts in the collection -
removeAllByIds
-
updatePlanKey
Update planKey in Artifact entities when plan key has changed (ie after moving plan)- Parameters:
originalPlanKey- original PlanKeynewPlanKey- new PlanKey
-
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
-