Package org.cyclos.impl.users
Class UserEntityLogHandlerImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseNetworkedHandlerImpl
-
- org.cyclos.impl.system.BaseEntityLogHandlerImpl<User,UserDTO>
-
- org.cyclos.impl.users.UserEntityLogHandlerImpl
-
- All Implemented Interfaces:
EntityLogHandler<User,UserDTO>
@Component public class UserEntityLogHandlerImpl extends BaseEntityLogHandlerImpl<User,UserDTO>
Handler for Users entity logs.
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.system.BaseEntityLogHandlerImpl
$, el, MASKED_VALUE
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, entityManagerHandler, groupsHandler, productsHandler, restBeanPropertyMapping, userLocatorHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
-
Constructor Summary
Constructors Constructor Description UserEntityLogHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<EntityLogType>doApplyLogFilters(DBQuery<?> query, long userId)Subclasses can implement this method to add specific filters to the query when searching for logs of an entity.Class<User>getEntityClass()The entity class related to this handlerStringgetEntityLogName(User oldEntity, User newEntity, EntityLogEvent event)Return the name of the entity log being generated.protected UsergetEntityToViewLog(long entityId)Returns the entity with the given id ONLY if the logged user can view its logs.protected BasicUsergetRelatedUser(User entity)Subclasses can implement this method to return the related user of the entity Returns the associated user to the given entity.EntityLogTypegetType()The log type this handler manages.EntityLogDescriptor<? extends UserDTO>resolveLogDescriptor(User user)Return the descriptor with the mappings for each DTO property.-
Methods inherited from class org.cyclos.impl.system.BaseEntityLogHandlerImpl
applyLogFilters, areEquals, canViewEntityLog, createEntityPropertyLog, customLogForCreation, doOnBeforeLog, getValues, isLogEnabled, onBeforeLog
-
Methods inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
canManage, checkManagesUser, checkPermission, checkRelatesToUser, checkValue, clearAlreadyValidated, getBaseEntityManagerHandler, getConfiguration, getLoggedBasicUser, getLoggedUser, getProducts, getTranslatedName, getTranslatedValue, hasPermission, hasValue, inSameNetwork, inSameNetworkOrGlobal, isAdmin, isAlreadyValidated, isBroker, isGlobalAdmin, isGlobalAdminInNetwork, isGuest, isLoggedIn, isMember, isMemberOnly, isNetworkAdmin, isOperator, isRelatedToUser, isSystem, isUserManager, isUserManagerOf, message, message, permission, permission, permissionOptionalValue, permissionOptionalValue, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, delete, detach, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
-
-
-
Method Detail
-
doApplyLogFilters
public Set<EntityLogType> doApplyLogFilters(DBQuery<?> query, long userId)
Description copied from class:BaseEntityLogHandlerImplSubclasses can implement this method to add specific filters to the query when searching for logs of an entity. Also, if other log types must be included in the query result then they must be returned.- Overrides:
doApplyLogFiltersin classBaseEntityLogHandlerImpl<User,UserDTO>- Parameters:
query- the query to add the filtersuserId- the id of the entity for which we're searching its logs- Returns:
- the list of other types that must be included in the result (e.g for users we include the addresses and phones logs). Null/empty means no other types are included.
-
getEntityClass
public Class<User> getEntityClass()
Description copied from interface:EntityLogHandlerThe entity class related to this handler
-
getEntityLogName
public String getEntityLogName(User oldEntity, User newEntity, EntityLogEvent event)
Description copied from interface:EntityLogHandlerReturn the name of the entity log being generated.- Specified by:
getEntityLogNamein interfaceEntityLogHandler<User,UserDTO>- Overrides:
getEntityLogNamein classBaseEntityLogHandlerImpl<User,UserDTO>
-
getType
public EntityLogType getType()
Description copied from interface:EntityLogHandlerThe log type this handler manages.
-
resolveLogDescriptor
public EntityLogDescriptor<? extends UserDTO> resolveLogDescriptor(User user)
Description copied from interface:EntityLogHandlerReturn the descriptor with the mappings for each DTO property.
-
getEntityToViewLog
protected User getEntityToViewLog(long entityId)
Description copied from class:BaseEntityLogHandlerImplReturns the entity with the given id ONLY if the logged user can view its logs. Otherwise it MUST return null.- Specified by:
getEntityToViewLogin classBaseEntityLogHandlerImpl<User,UserDTO>
-
getRelatedUser
protected BasicUser getRelatedUser(User entity)
Description copied from class:BaseEntityLogHandlerImplSubclasses can implement this method to return the related user of the entity Returns the associated user to the given entity.- Overrides:
getRelatedUserin classBaseEntityLogHandlerImpl<User,UserDTO>
-
-