Class TombstoneDAOHibernate
java.lang.Object
com.atlassian.crowd.util.persistence.hibernate.StatelessDao
com.atlassian.crowd.util.persistence.hibernate.HibernateDao<AbstractTombstone>
com.atlassian.crowd.dao.tombstone.TombstoneDAOHibernate
- All Implemented Interfaces:
TombstoneDao
-
Field Summary
Fields inherited from class com.atlassian.crowd.util.persistence.hibernate.HibernateDao
batchFinder, batchProcessor, logger, statelessSessionBatchProcessor, timeSource
Fields inherited from class com.atlassian.crowd.util.persistence.hibernate.StatelessDao
sessionFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAll subclasses of HibernateDao must implement this method forHibernateDao.load(Serializable)
to work correctly.<T extends ApplicationTombstone>
List<T>getTombstonesAfter
(long after, Long applicationId, Class<T> type) Retrieves tombstone for the specified application, after the timestamp specified<T extends AbstractTombstone>
List<T>getTombstonesAfter
(long after, Collection<Long> directoryIds, Class<T> type) Retrieves tombstone of the specified type, after the timestamp specified, optionally constrained to a directory setint
removeAllUpTo
(long timestamp) Removes all tombstones with the timestamp less or equal than the specified one.void
storeAliasTombstone
(long applicationId, String username) Stores a tombstone for an aliasvoid
storeEventsTombstone
(String reason) Stores a tombstone denoting any events can't be reconstructedvoid
storeEventsTombstoneForApplication
(long applicationId) Stores a tombstone denoting events for the given application can't be reconstructedvoid
storeEventsTombstoneForDirectory
(String reason, long directoryId) Stores a tombstone denoting events for the given directory can't be reconstructedvoid
storeGroupMembershipTombstone
(long directoryId, String childGroupName, String parentGroupName) Stores a tombstone for group-group membershipsvoid
storeGroupTombstones
(long directoryId, Collection<String> names) Stores a tombstone for groups with the given names<T extends AbstractTombstone>
voidstoreTombstones
(Iterable<T> tombstones) void
storeUserMembershipTombstone
(long directoryId, String username, String parentGroupName) Stores a tombstone for user-group membershipsvoid
storeUserTombstones
(long directoryId, Collection<String> names) Stores a tombstone for users with the given namesMethods inherited from class com.atlassian.crowd.util.persistence.hibernate.HibernateDao
createDeleteQuery, createDeleteQuery, createQuery, createQuery, executeHQLQuery, findAllInternal, findByProperties, findByPropertiesOptional, findByProperty, findByProperty, findByPropertyOptional, findByPropertyOrThrow, getCountByProperties, load, load, loadOptional, loadReference, loadReference, remove, removeByIdIfPresent, save, saveOrUpdate, session, setBatchFinder, setBatchProcessor, setClock, setStatelessSessionBatchProcessor, toPredicates, update
Methods inherited from class com.atlassian.crowd.util.persistence.hibernate.StatelessDao
setSessionFactory, withStatelessSession
-
Constructor Details
-
TombstoneDAOHibernate
public TombstoneDAOHibernate()
-
-
Method Details
-
storeUserTombstones
Description copied from interface:TombstoneDao
Stores a tombstone for users with the given names- Specified by:
storeUserTombstones
in interfaceTombstoneDao
- Parameters:
directoryId
- the directory idnames
- the names of the users to store the tombstone for
-
storeGroupTombstones
Description copied from interface:TombstoneDao
Stores a tombstone for groups with the given names- Specified by:
storeGroupTombstones
in interfaceTombstoneDao
- Parameters:
directoryId
- the directory idnames
- the names of the groups to store the tombstone for
-
storeUserMembershipTombstone
Description copied from interface:TombstoneDao
Stores a tombstone for user-group memberships- Specified by:
storeUserMembershipTombstone
in interfaceTombstoneDao
- Parameters:
directoryId
- the directory idusername
- the name of the userparentGroupName
- the name of the group the user belonged to
-
storeGroupMembershipTombstone
public void storeGroupMembershipTombstone(long directoryId, String childGroupName, String parentGroupName) Description copied from interface:TombstoneDao
Stores a tombstone for group-group memberships- Specified by:
storeGroupMembershipTombstone
in interfaceTombstoneDao
- Parameters:
directoryId
- the directory idchildGroupName
- the name of the userparentGroupName
- the name of the group the user belonged to
-
storeEventsTombstoneForDirectory
Description copied from interface:TombstoneDao
Stores a tombstone denoting events for the given directory can't be reconstructed- Specified by:
storeEventsTombstoneForDirectory
in interfaceTombstoneDao
- Parameters:
reason
- describes why this tombstone was writtendirectoryId
- the directory id this affects- See Also:
-
storeEventsTombstoneForApplication
public void storeEventsTombstoneForApplication(long applicationId) Description copied from interface:TombstoneDao
Stores a tombstone denoting events for the given application can't be reconstructed- Specified by:
storeEventsTombstoneForApplication
in interfaceTombstoneDao
- Parameters:
applicationId
- the application id this affects- See Also:
-
storeEventsTombstone
Description copied from interface:TombstoneDao
Stores a tombstone denoting any events can't be reconstructed- Specified by:
storeEventsTombstone
in interfaceTombstoneDao
- Parameters:
reason
- describes why this tombstone was written- See Also:
-
storeAliasTombstone
Description copied from interface:TombstoneDao
Stores a tombstone for an alias- Specified by:
storeAliasTombstone
in interfaceTombstoneDao
- Parameters:
applicationId
- the application id this affectsusername
- the original user name for the alias
-
storeTombstones
-
getTombstonesAfter
public <T extends AbstractTombstone> List<T> getTombstonesAfter(long after, Collection<Long> directoryIds, Class<T> type) Description copied from interface:TombstoneDao
Retrieves tombstone of the specified type, after the timestamp specified, optionally constrained to a directory set- Specified by:
getTombstonesAfter
in interfaceTombstoneDao
- Parameters:
after
- only tombstones persisted after this timestamp will be returneddirectoryIds
- if empty all tombstones will be returned, otherwise only tombstones for the specified directories. Should be when retrieving tombstones that aren't directory specific.type
- only retrieve tombstone of the specified type. UseAbstractTombstone
to search for all types.- Returns:
- a list of tombstones matching the criteria
-
getTombstonesAfter
public <T extends ApplicationTombstone> List<T> getTombstonesAfter(long after, Long applicationId, Class<T> type) Description copied from interface:TombstoneDao
Retrieves tombstone for the specified application, after the timestamp specified- Specified by:
getTombstonesAfter
in interfaceTombstoneDao
- Parameters:
after
- only tombstones persisted after this timestamp will be returnedapplicationId
- if null all tombstones will be returned, otherwise only tombstones for the specified application. Should be when retrieving tombstones that aren't directory specific.- Returns:
- a list of tombstones matching the criteria
-
removeAllUpTo
public int removeAllUpTo(long timestamp) Description copied from interface:TombstoneDao
Removes all tombstones with the timestamp less or equal than the specified one.- Specified by:
removeAllUpTo
in interfaceTombstoneDao
- Returns:
- the number of tombstones removed
-
getPersistentClass
Description copied from class:HibernateDao
All subclasses of HibernateDao must implement this method forHibernateDao.load(Serializable)
to work correctly.- Specified by:
getPersistentClass
in classHibernateDao<AbstractTombstone>
- Returns:
- the entity class for this DAO
-