T - the entity type to be anonymized or deleted@ProviderType public interface UADAnonymizer<T> extends UADComponent<T>
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.| Modifier and Type | Method and 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 java.util.Map<java.lang.Class<?>,java.lang.String> |
getExceptionMessageMap(java.util.Locale locale)
Returns a map of error messages corresponding to exceptions.
|
getTypeClass, getTypeKeyvoid autoAnonymize(T t, long userId, com.liferay.portal.kernel.model.User anonymousUser) throws com.liferay.portal.kernel.exception.PortalException
t - the entity to be anonymizeduserId - the primary key of the user associated with type TanonymousUser - the company's anonymous usercom.liferay.portal.kernel.exception.PortalException - if the persistence threw an exceptionvoid autoAnonymizeAll(long userId,
com.liferay.portal.kernel.model.User anonymousUser)
throws com.liferay.portal.kernel.exception.PortalException
T related to the
user. This method is responsible for retrieving the relevant entities,
performing anonymization, and persisting the changes.userId - the primary key of the user whose data is being anonymizedanonymousUser - the company's anonymous usercom.liferay.portal.kernel.exception.PortalException - if the persistence threw an exceptionlong count(long userId)
throws com.liferay.portal.kernel.exception.PortalException
T entities associated with the user.userId - the primary key of the user whose data to countcom.liferay.portal.kernel.exception.PortalExceptionvoid delete(T t) throws com.liferay.portal.kernel.exception.PortalException
t - the entity to be deletedcom.liferay.portal.kernel.exception.PortalException - if a portal exception occurredvoid deleteAll(long userId)
throws com.liferay.portal.kernel.exception.PortalException
T entities related to the user from the
database.userId - the primary key of the user whose data to deletecom.liferay.portal.kernel.exception.PortalException - if a portal exception occurreddefault java.util.Map<java.lang.Class<?>,java.lang.String> getExceptionMessageMap(java.util.Locale locale)
locale - the locale of the language