Search in sources :

Example 1 with IdmLoggingEvent

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);
}
Also used : IdmLoggingEventDto(eu.bcvsolutions.idm.core.api.audit.dto.IdmLoggingEventDto) IdmLoggingEvent(eu.bcvsolutions.idm.core.audit.entity.IdmLoggingEvent) IdmLoggingEventFilter(eu.bcvsolutions.idm.core.api.audit.dto.filter.IdmLoggingEventFilter)

Example 2 with IdmLoggingEvent

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;
}
Also used : IdmLoggingEvent(eu.bcvsolutions.idm.core.audit.entity.IdmLoggingEvent) IdmLoggingEventException(eu.bcvsolutions.idm.core.audit.entity.IdmLoggingEventException)

Example 3 with IdmLoggingEvent

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);
}
Also used : IdmLoggingEvent(eu.bcvsolutions.idm.core.audit.entity.IdmLoggingEvent) ResultCodeException(eu.bcvsolutions.idm.core.api.exception.ResultCodeException)

Aggregations

IdmLoggingEvent (eu.bcvsolutions.idm.core.audit.entity.IdmLoggingEvent)3 IdmLoggingEventDto (eu.bcvsolutions.idm.core.api.audit.dto.IdmLoggingEventDto)1 IdmLoggingEventFilter (eu.bcvsolutions.idm.core.api.audit.dto.filter.IdmLoggingEventFilter)1 ResultCodeException (eu.bcvsolutions.idm.core.api.exception.ResultCodeException)1 IdmLoggingEventException (eu.bcvsolutions.idm.core.audit.entity.IdmLoggingEventException)1