Interface TombstoneDao
- All Known Implementing Classes:
TombstoneDAOHibernate
public interface TombstoneDao
Allows storing tombstones - persistent objects that denote a deletion of an entity or state.
Note that tombstones are pruned after a time by a background job (see TombstoneReaper)
-
Method Summary
Modifier and TypeMethodDescription<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 namesvoid
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 names
-
Method Details
-
storeUserTombstones
Stores a tombstone for users with the given names- Parameters:
directoryId
- the directory idnames
- the names of the users to store the tombstone for
-
storeGroupTombstones
Stores a tombstone for groups with the given names- Parameters:
directoryId
- the directory idnames
- the names of the groups to store the tombstone for
-
storeUserMembershipTombstone
Stores a tombstone for user-group memberships- Parameters:
directoryId
- the directory idusername
- the name of the userparentGroupName
- the name of the group the user belonged to
-
storeGroupMembershipTombstone
Stores a tombstone for group-group memberships- Parameters:
directoryId
- the directory idchildGroupName
- the name of the userparentGroupName
- the name of the group the user belonged to
-
storeEventsTombstoneForDirectory
Stores a tombstone denoting events for the given directory can't be reconstructed- Parameters:
reason
- describes why this tombstone was writtendirectoryId
- the directory id this affects- See Also:
-
storeEventsTombstoneForApplication
void storeEventsTombstoneForApplication(long applicationId) Stores a tombstone denoting events for the given application can't be reconstructed- Parameters:
applicationId
- the application id this affects- See Also:
-
storeEventsTombstone
Stores a tombstone denoting any events can't be reconstructed- Parameters:
reason
- describes why this tombstone was written- See Also:
-
storeAliasTombstone
Stores a tombstone for an alias- Parameters:
applicationId
- the application id this affectsusername
- the original user name for the alias
-
getTombstonesAfter
<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 set- 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
<T extends ApplicationTombstone> List<T> getTombstonesAfter(long after, Long applicationId, Class<T> type) Retrieves tombstone for the specified application, after the timestamp specified- 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
int removeAllUpTo(long timestamp) Removes all tombstones with the timestamp less or equal than the specified one.- Returns:
- the number of tombstones removed
-