use of eu.bcvsolutions.idm.core.audit.entity.IdmLoggingEvent in project CzechIdMng by bcvsolutions.
the class DefaultIdmLoggingEventService method getEntity.
@Override
protected IdmLoggingEvent getEntity(Serializable id, BasePermission... permission) {
Assert.notNull(id, "Identifier is requiered for load an log event.");
IdmLoggingEventFilter filter = new IdmLoggingEventFilter();
filter.setId(Long.valueOf(id.toString()));
List<IdmLoggingEventDto> entities = this.find(filter, null, permission).getContent();
if (entities.isEmpty()) {
return null;
}
// for given id must found only one entity
IdmLoggingEvent entity = this.toEntity(entities.get(0));
return checkAccess(entity, permission);
}
use of eu.bcvsolutions.idm.core.audit.entity.IdmLoggingEvent in project CzechIdMng by bcvsolutions.
the class DefaultIdmLoggingEventExceptionService method toEntity.
@Override
protected IdmLoggingEventException toEntity(IdmLoggingEventExceptionDto dto, IdmLoggingEventException entity) {
final IdmLoggingEventException idmLoggingEventException = super.toEntity(dto, entity);
if (idmLoggingEventException.getEvent() == null && dto.getEvent() != null) {
// Try to find event
final IdmLoggingEvent event = loggingEventRepository.findOneById(dto.getEvent());
idmLoggingEventException.setEvent(event);
}
idmLoggingEventException.setId(dto.getId());
return idmLoggingEventException;
}
use of eu.bcvsolutions.idm.core.audit.entity.IdmLoggingEvent in project CzechIdMng by bcvsolutions.
the class DefaultIdmLoggingEventService method get.
@Override
public IdmLoggingEventDto get(Serializable id, BasePermission... permission) {
Assert.notNull(id, "Id is required");
//
IdmLoggingEvent entity = this.repository.findOneById(Long.valueOf(id.toString()));
//
if (entity == null) {
throw new ResultCodeException(CoreResultCode.NOT_FOUND, ImmutableMap.of("entity", id));
}
//
return this.toDto(entity);
}
Aggregations