Package org.cyclos.impl.system
Class EntityLogRegistryImpl
- java.lang.Object
-
- org.cyclos.impl.system.EntityLogRegistryImpl
-
- All Implemented Interfaces:
EntityLogRegistry
@Component public class EntityLogRegistryImpl extends Object implements EntityLogRegistry
Implementation ofEntityLogRegistry
-
-
Constructor Summary
Constructors Constructor Description EntityLogRegistryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <E extends BaseEntity,DTO extends EntityDTO>
EntityLogHandler<E,DTO>getHandler(Class entityClass)<T extends BaseEntity,DTO extends EntityDTO>
EntityLogHandler<T,DTO>getHandler(EntityLogType type)Iterable<EntityLogHandler<? extends BaseEntity,? extends EntityDTO>>getHandlers()Returns all registered handlers.<E extends BaseEntity>
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 the {@link #getHandler(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
public <E extends BaseEntity,DTO extends EntityDTO> EntityLogHandler<E,DTO> getHandler(Class entityClass)
- Specified by:
getHandlerin interfaceEntityLogRegistry- Returns:
- the handler associated to the given entity class or null if the log is not enabled for that entity type.
-
getHandler
public <T extends BaseEntity,DTO extends EntityDTO> EntityLogHandler<T,DTO> getHandler(EntityLogType type)
- Specified by:
getHandlerin interfaceEntityLogRegistry- Returns:
- the handler associated to the given type or null if the log is not enable
-
getHandlers
public Iterable<EntityLogHandler<? extends BaseEntity,? extends EntityDTO>> getHandlers()
Description copied from interface:EntityLogRegistryReturns all registered handlers.- Specified by:
getHandlersin interfaceEntityLogRegistry
-
isLogEnabled
public <E extends BaseEntity> boolean isLogEnabled(E entity)
Description copied from interface:EntityLogRegistryReturns 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 the {@link #getHandler(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.- Specified by:
isLogEnabledin interfaceEntityLogRegistry
-
-