Package org.cyclos.impl.system
Class EntityLogServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.system.EntityLogServiceImpl
-
- All Implemented Interfaces:
EntityLogServiceLocal,Service,EntityLogService
@Component public class EntityLogServiceImpl extends BaseServiceImpl implements EntityLogServiceLocal
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, customFieldValueHandler, entityManagerHandler, groupsHandler, productsHandler, restBeanPropertyMapping, userLocatorHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
Fields inherited from interface org.cyclos.impl.system.EntityLogServiceLocal
COMPOUND_NAME_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description EntityLogServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EntityPropertyLogVOload(Long id)Loads anEntityPropertyLogVOby idEntityLoglog(String entityName, long entityId, Boolean isPrivateEntity, Long ownerEntityId, EntityLogType type, EntityLogEvent event, List<EntityPropertyLog> propertyLogs)Persists a newEntityLogalongside all its property logs generated from the changes.EntityLoglog(BaseEntity entity, String propertyLogName, String propertyName, String oldValue, String newValue)Creates a newEntityLogand a newEntityPropertyLogwith the given values.
IMPORTANT: This method is intended to be used only for specific cases, instead, theEntityLogServiceLocal.logEntity(BaseEntity, BaseEntity, Supplier)method should be used.EntityLoglogEntity(BaseEntity oldEntity, BaseEntity newEntity, Supplier<String> ownerEntityPropNameSupplier)Logs the changes from oldEntity to newEntity.protected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkvoidremoveAll(BasicUser user)Removes all entity logs for the given user.Page<EntityPropertyLogVO>search(EntityPropertyLogQuery params)Search for logs of an entity.
TheEntityPropertyLogQuery.ENTITY_IDandEntityPropertyLogQuery.TYPEare required.-
Methods inherited from class org.cyclos.impl.BaseServiceImpl
initializeNetworkMappings
-
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, setAlreadyValidated, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, dataTranslationProxy, delete, detach, doDataTranslationProxy, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
-
-
-
Method Detail
-
load
public EntityPropertyLogVO load(Long id)
Description copied from interface:EntityLogServiceLoads anEntityPropertyLogVOby id- Specified by:
loadin interfaceEntityLogService
-
log
public EntityLog log(BaseEntity entity, String propertyLogName, String propertyName, String oldValue, String newValue)
Description copied from interface:EntityLogServiceLocalCreates a newEntityLogand a newEntityPropertyLogwith the given values.
IMPORTANT: This method is intended to be used only for specific cases, instead, theEntityLogServiceLocal.logEntity(BaseEntity, BaseEntity, Supplier)method should be used.- Specified by:
login interfaceEntityLogServiceLocal
-
log
public EntityLog log(String entityName, long entityId, Boolean isPrivateEntity, Long ownerEntityId, EntityLogType type, EntityLogEvent event, List<EntityPropertyLog> propertyLogs)
Persists a newEntityLogalongside all its property logs generated from the changes.- Specified by:
login interfaceEntityLogServiceLocal
-
logEntity
public EntityLog logEntity(BaseEntity oldEntity, BaseEntity newEntity, Supplier<String> ownerEntityPropNameSupplier)
Description copied from interface:EntityLogServiceLocalLogs the changes from oldEntity to newEntity. Returns the createdEntityLogor null if no changes were found or the log is not enabled for the entity.- Specified by:
logEntityin interfaceEntityLogServiceLocal- Parameters:
oldEntity- the current persisted (and detached) entity or null if the entity is being created.newEntity- the new status after the DTO was applied or null if the entity is being removed.
-
removeAll
public void removeAll(BasicUser user)
Description copied from interface:EntityLogServiceLocalRemoves all entity logs for the given user. Logs of typeEntityLogType.USERthat the user is the entity and of typeEntityLogType.PHONEandEntityLogType.ADDRESSthat the given user is the owner entity are removed- Specified by:
removeAllin interfaceEntityLogServiceLocal
-
search
public Page<EntityPropertyLogVO> search(EntityPropertyLogQuery params)
Description copied from interface:EntityLogServiceSearch for logs of an entity.
TheEntityPropertyLogQuery.ENTITY_IDandEntityPropertyLogQuery.TYPEare required.- Specified by:
searchin interfaceEntityLogService
-
registerNetworkMappings
protected void registerNetworkMappings(NetworkPathRegistry networkPathRegistry)
Description copied from class:BaseServiceImplNeeds to be overridden by subclasses to register the path up to the network- Specified by:
registerNetworkMappingsin classBaseServiceImpl
-
-