Interface UADAnonymizer<T>

Type Parameters:
T - the entity type to be anonymized or deleted
All Superinterfaces:
UADComponent<T>
All Known Implementing Classes:
DynamicQueryUADAnonymizer

@ProviderType public interface UADAnonymizer<T> extends UADComponent<T>
Provides a way to retrieve, count, anonymize, and delete type T entities for a user. The anonymous user used in the autoAnonymize(T, long, com.liferay.portal.kernel.model.User) and autoAnonymizeAll(long, com.liferay.portal.kernel.model.User) methods is the anonymous user defined for a particular company by AnonymousUserConfiguration.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    autoAnonymize(T t, long userId, com.liferay.portal.kernel.model.User anonymousUser)
    Anonymizes the given entity and persists the changes to the database.
    void
    autoAnonymizeAll(long userId, com.liferay.portal.kernel.model.User anonymousUser)
    Performs anonymization on all entities of type T related to the user.
    long
    count(long userId)
    Returns the number of type T entities associated with the user.
    void
    delete(T t)
    Deletes the entity from the database.
    void
    deleteAll(long userId)
    Deletes all type T entities related to the user from the database.
    default Map<Class<?>,String>
    Returns a map of error messages corresponding to exceptions.

    Methods inherited from interface com.liferay.user.associated.data.component.UADComponent

    getTypeClass, getTypeKey
  • Method Details

    • autoAnonymize

      void autoAnonymize(T t, long userId, com.liferay.portal.kernel.model.User anonymousUser) throws com.liferay.portal.kernel.exception.PortalException
      Anonymizes the given entity and persists the changes to the database. The primary key of the user is used to match against different fields on the given entity. The anonymous user is given to provide replacement user-related data, if needed.
      Parameters:
      t - the entity to be anonymized
      userId - the primary key of the user associated with type T
      anonymousUser - the company's anonymous user
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if the persistence threw an exception
    • autoAnonymizeAll

      void autoAnonymizeAll(long userId, com.liferay.portal.kernel.model.User anonymousUser) throws com.liferay.portal.kernel.exception.PortalException
      Performs anonymization on all entities of type T related to the user. This method is responsible for retrieving the relevant entities, performing anonymization, and persisting the changes.
      Parameters:
      userId - the primary key of the user whose data is being anonymized
      anonymousUser - the company's anonymous user
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if the persistence threw an exception
    • count

      long count(long userId) throws com.liferay.portal.kernel.exception.PortalException
      Returns the number of type T entities associated with the user.
      Parameters:
      userId - the primary key of the user whose data to count
      Returns:
      the number of entities associated with the user
      Throws:
      com.liferay.portal.kernel.exception.PortalException
    • delete

      void delete(T t) throws com.liferay.portal.kernel.exception.PortalException
      Deletes the entity from the database.
      Parameters:
      t - the entity to be deleted
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • deleteAll

      void deleteAll(long userId) throws com.liferay.portal.kernel.exception.PortalException
      Deletes all type T entities related to the user from the database.
      Parameters:
      userId - the primary key of the user whose data to delete
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • getExceptionMessageMap

      default Map<Class<?>,String> getExceptionMessageMap(Locale locale)
      Returns a map of error messages corresponding to exceptions.
      Parameters:
      locale - the locale of the language