Class TombstoneDAOHibernate

All Implemented Interfaces:
TombstoneDao

public class TombstoneDAOHibernate extends HibernateDao<AbstractTombstone> implements TombstoneDao
  • Constructor Details

    • TombstoneDAOHibernate

      public TombstoneDAOHibernate()
  • Method Details

    • storeUserTombstones

      public void storeUserTombstones(long directoryId, Collection<String> names)
      Description copied from interface: TombstoneDao
      Stores a tombstone for users with the given names
      Specified by:
      storeUserTombstones in interface TombstoneDao
      Parameters:
      directoryId - the directory id
      names - the names of the users to store the tombstone for
    • storeGroupTombstones

      public void storeGroupTombstones(long directoryId, Collection<String> names)
      Description copied from interface: TombstoneDao
      Stores a tombstone for groups with the given names
      Specified by:
      storeGroupTombstones in interface TombstoneDao
      Parameters:
      directoryId - the directory id
      names - the names of the groups to store the tombstone for
    • storeUserMembershipTombstone

      public void storeUserMembershipTombstone(long directoryId, String username, String parentGroupName)
      Description copied from interface: TombstoneDao
      Stores a tombstone for user-group memberships
      Specified by:
      storeUserMembershipTombstone in interface TombstoneDao
      Parameters:
      directoryId - the directory id
      username - the name of the user
      parentGroupName - 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 interface TombstoneDao
      Parameters:
      directoryId - the directory id
      childGroupName - the name of the user
      parentGroupName - the name of the group the user belonged to
    • storeEventsTombstoneForDirectory

      public void storeEventsTombstoneForDirectory(String reason, long directoryId)
      Description copied from interface: TombstoneDao
      Stores a tombstone denoting events for the given directory can't be reconstructed
      Specified by:
      storeEventsTombstoneForDirectory in interface TombstoneDao
      Parameters:
      reason - describes why this tombstone was written
      directoryId - 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 interface TombstoneDao
      Parameters:
      applicationId - the application id this affects
      See Also:
    • storeEventsTombstone

      public void storeEventsTombstone(String reason)
      Description copied from interface: TombstoneDao
      Stores a tombstone denoting any events can't be reconstructed
      Specified by:
      storeEventsTombstone in interface TombstoneDao
      Parameters:
      reason - describes why this tombstone was written
      See Also:
    • storeAliasTombstone

      public void storeAliasTombstone(long applicationId, String username)
      Description copied from interface: TombstoneDao
      Stores a tombstone for an alias
      Specified by:
      storeAliasTombstone in interface TombstoneDao
      Parameters:
      applicationId - the application id this affects
      username - the original user name for the alias
    • storeTombstones

      public <T extends AbstractTombstone> void storeTombstones(Iterable<T> tombstones)
    • 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 interface TombstoneDao
      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

      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 interface TombstoneDao
      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

      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 interface TombstoneDao
      Returns:
      the number of tombstones removed
    • getPersistentClass

      public Class<AbstractTombstone> getPersistentClass()
      Description copied from class: HibernateDao
      All subclasses of HibernateDao must implement this method for HibernateDao.load(Serializable) to work correctly.
      Specified by:
      getPersistentClass in class HibernateDao<AbstractTombstone>
      Returns:
      the entity class for this DAO