Package org.cyclos.impl.system
Interface EntityLogRegistry
-
public interface EntityLogRegistryRegistry forEntityLogHandler
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <E extends SimpleEntity,DTO extends EntityDTO>
EntityLogHandler<E,DTO>getHandler(Class entityClass)<T extends SimpleEntity,DTO extends EntityDTO>
EntityLogHandler<T,DTO>getHandler(EntityLogType type)Iterable<EntityLogHandler<? extends SimpleEntity,? extends EntityDTO>>getHandlers()Returns all registered handlers.<E extends SimpleEntity>
booleanisLogEnabled(E entity)Returns true if log should be generated for this specific entity instance.
IMPORTANT: This method must be used to know if log is generated for an entity instead of thegetHandler(Class)method.
This allow manage cases like generate log for all users (i.e a handler forUserentities was registered) but not for the imported ones (i.e those withBasicUser.getRegistrationType()equals toUserRegistration.IMPORT.
-
-
-
Method Detail
-
getHandler
<E extends SimpleEntity,DTO extends EntityDTO> EntityLogHandler<E,DTO> getHandler(Class entityClass)
- Returns:
- the handler associated to the given entity class or null if the log is not enabled for that entity type.
-
getHandler
<T extends SimpleEntity,DTO extends EntityDTO> EntityLogHandler<T,DTO> getHandler(EntityLogType type)
- Returns:
- the handler associated to the given type or null if the log is not enable
-
getHandlers
Iterable<EntityLogHandler<? extends SimpleEntity,? extends EntityDTO>> getHandlers()
Returns all registered handlers.
-
isLogEnabled
<E extends SimpleEntity> boolean isLogEnabled(E entity)
Returns true if log should be generated for this specific entity instance.
IMPORTANT: This method must be used to know if log is generated for an entity instead of thegetHandler(Class)method.
This allow manage cases like generate log for all users (i.e a handler forUserentities was registered) but not for the imported ones (i.e those withBasicUser.getRegistrationType()equals toUserRegistration.IMPORT.
-
-