Package com.atlassian.bamboo.artifact
Class ArtifactHibernateDao
java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate5.support.HibernateDaoSupport
com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
com.atlassian.bamboo.artifact.ArtifactHibernateDao
- All Implemented Interfaces:
ArtifactDao,org.springframework.beans.factory.InitializingBean
public class ArtifactHibernateDao
extends StatelessSessionHibernateDaoSupport
implements ArtifactDao
-
Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindAll()Find allMutableArtifactFind how much space artifacts use by link type, e.g.@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)Methods inherited from class com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
getCacheAwareHibernateTemplateMethods inherited from class org.springframework.orm.hibernate5.support.HibernateDaoSupport
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactoryMethods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
-
Constructor Details
-
ArtifactHibernateDao
-
-
Method Details
-
save
Description copied from interface:ArtifactDaoSave artifact.- Specified by:
savein interfaceArtifactDao
-
findAll
Description copied from interface:ArtifactDaoFind allMutableArtifact- Specified by:
findAllin interfaceArtifactDao- Returns:
-
findById
Description copied from interface:ArtifactDaoFindMutableArtifactby id.- Specified by:
findByIdin interfaceArtifactDao- Returns:
-
isReferencedByVersion
public boolean isReferencedByVersion(long artifactId) - Specified by:
isReferencedByVersionin interfaceArtifactDao- Returns:
- true iff artifact is a part of a deployment verison
-
findPlanResultArtifactsReferencedByVersion
public List<MutableArtifact> findPlanResultArtifactsReferencedByVersion(@NotNull @NotNull PlanResultKey planResultKey) Description copied from interface:ArtifactDaoFind all artifacts that belong to a build result are part of a deployment version.- Specified by:
findPlanResultArtifactsReferencedByVersionin interfaceArtifactDao- Returns:
-
findPlanArtifactsReferencedByVersion
public List<MutableArtifact> findPlanArtifactsReferencedByVersion(@NotNull @NotNull PlanKey planKey) Description copied from interface:ArtifactDaoFind all artifacts that belong to a plan are part of a deployment version.- Specified by:
findPlanArtifactsReferencedByVersionin interfaceArtifactDao- Returns:
-
removeById
public void removeById(long id) Description copied from interface:ArtifactDaoRemove artifact.- Specified by:
removeByIdin interfaceArtifactDao
-
removeByPlanKey
Description copied from interface:ArtifactDaoRemove all artifacts that belong to a plan and are not part of a deployment version.- Specified by:
removeByPlanKeyin interfaceArtifactDao
-
removeByPlanResultKey
Description copied from interface:ArtifactDaoRemove all artifacts that belong to a build result and are not part of a deployment version.- Specified by:
removeByPlanResultKeyin interfaceArtifactDao
-
findOrphanedArtifacts
Description copied from interface:ArtifactDaoFind all artifacts that are no longer referenced by any result or version.- Specified by:
findOrphanedArtifactsin interfaceArtifactDao- Returns:
-
findOrphanedArtifactsByIds
Description copied from interface:ArtifactDaoFind all artifacts which id is on the list and that are no longer referenced by any result or version.- Specified by:
findOrphanedArtifactsByIdsin interfaceArtifactDao
-
removeAll
Description copied from interface:ArtifactDaoRemove all artifacts in the collection- Specified by:
removeAllin interfaceArtifactDao
-
removeAllByIds
- Specified by:
removeAllByIdsin interfaceArtifactDao
-
updatePlanKey
public void updatePlanKey(@NotNull @NotNull PlanKey originalPlanKey, @NotNull @NotNull PlanKey newPlanKey) Description copied from interface:ArtifactDaoUpdate planKey in Artifact entities when plan key has changed (ie after moving plan)- Specified by:
updatePlanKeyin interfaceArtifactDao- Parameters:
originalPlanKey- original PlanKeynewPlanKey- new PlanKey
-
findArtifactUsedStorageByLinkType
Description copied from interface:ArtifactDaoFind how much space artifacts use by link type, e.g. local storage, AWS, agent side etc- Specified by:
findArtifactUsedStorageByLinkTypein interfaceArtifactDao- Returns:
- artifact link type -> artifacts size in bytes
-