Package com.atlassian.bamboo.artifact
Interface ArtifactDao
- All Known Implementing Classes:
ArtifactHibernateDao
public interface ArtifactDao
-
Method Summary
Modifier and TypeMethodDescriptionfindAll()
Find allMutableArtifact
Find how much space artifacts use by link type, e.g.@Nullable MutableArtifact
findById
(long id) FindMutableArtifact
by 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.boolean
isReferencedByVersion
(long artifactId) void
removeAll
(@NotNull Collection<MutableArtifact> artifacts) Remove all artifacts in the collectionvoid
removeAllByIds
(@NotNull Collection<Long> artifactIds) void
removeById
(long id) Remove artifact.void
removeByPlanKey
(@NotNull PlanKey planKey) Remove all artifacts that belong to a plan and are not part of a deployment version.void
removeByPlanResultKey
(@NotNull PlanResultKey planResultKey) Remove all artifacts that belong to a build result and are not part of a deployment version.void
save
(MutableArtifact artifact) Save artifact.void
updatePlanKey
(@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
FindMutableArtifact
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
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
-