public interface EntityLogHandler<E extends BaseEntity,DTO extends EntityDTO>
BaseEntityLogHandlerImpl,
EntityLogRegistry| Modifier and Type | Method and Description |
|---|---|
void |
applyLogFilters(org.cyclos.impl.utils.persistence.DBQuery<?> query,
EntityPropertyLogQuery params)
Apply filters to the given query to ensure only the entity log the logged user can view are returned
|
boolean |
areEquals(E oldEntity,
E newEntity,
org.cyclos.impl.utils.validation.PropertyAccess access,
java.lang.Object oldValue,
java.lang.Object newValue)
Returns true if the old and new values extracted from its corresponding entities must be considered equals.
|
boolean |
canViewEntityLog(long entityId)
Returns whether the logged user can view the log of the given entity.
|
java.lang.Class<E> |
getEntityClass()
The entity class related to this handler
|
java.lang.String |
getEntityLogName(E oldEntity,
E newEntity,
EntityLogEvent event)
Return the name of the entity log being generated.
|
EntityLogType |
getType()
The log type this handler manages.
|
Pair<java.lang.Object,java.lang.Object> |
getValues(E oldEntity,
E newEntity,
org.cyclos.impl.PropertyLogDescriptor<DTO> propertyDescriptor)
Allows custom logic for a specific property to be logged bypassing the default log generation for it.
|
boolean |
isLogEnabled(E entity)
Returns true if the log is enabled for this specific entity instance.
|
java.util.List<EntityPropertyLog> |
onBeforeLog(E oldEntity,
E newEntity,
java.util.List<EntityPropertyLog> propertyLogs,
EntityLogEvent event)
Allows perform custom logic before logging (i.e saving) the given property logs.
|
org.cyclos.impl.EntityLogDescriptor<? extends DTO> |
resolveLogDescriptor(E entity)
Return the descriptor with the mappings for each DTO property.
|
void applyLogFilters(org.cyclos.impl.utils.persistence.DBQuery<?> query,
EntityPropertyLogQuery params)
boolean areEquals(E oldEntity, E newEntity, org.cyclos.impl.utils.validation.PropertyAccess access, java.lang.Object oldValue, java.lang.Object newValue)
boolean canViewEntityLog(long entityId)
java.lang.Class<E> getEntityClass()
java.lang.String getEntityLogName(E oldEntity, E newEntity, EntityLogEvent event)
EntityLogType getType()
Pair<java.lang.Object,java.lang.Object> getValues(E oldEntity, E newEntity, org.cyclos.impl.PropertyLogDescriptor<DTO> propertyDescriptor)
areEquals(BaseEntity, BaseEntity, PropertyAccess, Object, Object)
return false.boolean isLogEnabled(E entity)
java.util.List<EntityPropertyLog> onBeforeLog(E oldEntity, E newEntity, java.util.List<EntityPropertyLog> propertyLogs, EntityLogEvent event)
EntityLogEvent.CREATE event the result list will contain only one element, this is for that
case we only log one line just to indicate when and who created the entity.