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 Details

    • storeUserTombstones

      void storeUserTombstones(long directoryId, Collection<String> names)
      Stores a tombstone for users with the given names
      Parameters:
      directoryId - the directory id
      names - the names of the users to store the tombstone for
    • storeGroupTombstones

      void storeGroupTombstones(long directoryId, Collection<String> names)
      Stores a tombstone for groups with the given names
      Parameters:
      directoryId - the directory id
      names - the names of the groups to store the tombstone for
    • storeUserMembershipTombstone

      void storeUserMembershipTombstone(long directoryId, String username, String parentGroupName)
      Stores a tombstone for user-group memberships
      Parameters:
      directoryId - the directory id
      username - the name of the user
      parentGroupName - the name of the group the user belonged to
    • storeGroupMembershipTombstone

      void storeGroupMembershipTombstone(long directoryId, String childGroupName, String parentGroupName)
      Stores a tombstone for group-group memberships
      Parameters:
      directoryId - the directory id
      childGroupName - the name of the user
      parentGroupName - the name of the group the user belonged to
    • storeEventsTombstoneForDirectory

      void storeEventsTombstoneForDirectory(String reason, long directoryId)
      Stores a tombstone denoting events for the given directory can't be reconstructed
      Parameters:
      reason - describes why this tombstone was written
      directoryId - 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

      void storeEventsTombstone(String reason)
      Stores a tombstone denoting any events can't be reconstructed
      Parameters:
      reason - describes why this tombstone was written
      See Also:
    • storeAliasTombstone

      void storeAliasTombstone(long applicationId, String username)
      Stores a tombstone for an alias
      Parameters:
      applicationId - the application id this affects
      username - 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 returned
      directoryIds - 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. Use AbstractTombstone 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 returned
      applicationId - 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