Search in sources :

Example 11 with EntityEventProcessorDto

use of eu.bcvsolutions.idm.core.api.dto.EntityEventProcessorDto in project CzechIdMng by bcvsolutions.

the class EntityEventProcessorController method find.

@ResponseBody
@RequestMapping(method = RequestMethod.GET)
@PreAuthorize("hasAuthority('" + CoreGroupPermission.MODULE_READ + "')")
@ApiOperation(value = "Find all processors", nickname = "findAllEntityEventProcessors", tags = { EntityEventProcessorController.TAG }, authorizations = { @Authorization(value = SwaggerConfig.AUTHENTICATION_BASIC, scopes = { @AuthorizationScope(scope = CoreGroupPermission.MODULE_READ, description = "") }), @Authorization(value = SwaggerConfig.AUTHENTICATION_CIDMST, scopes = { @AuthorizationScope(scope = CoreGroupPermission.MODULE_READ, description = "") }) }, notes = "Returns all registered entity event processors with state properties (disabled, order)")
@SuppressWarnings({ "unchecked", "rawtypes" })
public Resources<?> find(@RequestParam(required = false) MultiValueMap<String, Object> parameters) {
    List<EntityEventProcessorDto> records = entityEventManager.find(toFilter(parameters));
    PageImpl page = new PageImpl(records, new PageRequest(0, records.size() == 0 ? 10 : records.size()), records.size());
    if (page.getContent().isEmpty()) {
        return pagedResourcesAssembler.toEmptyResource(page, EntityEventProcessorDto.class, null);
    }
    return pagedResourcesAssembler.toResource(page);
}
Also used : PageImpl(org.springframework.data.domain.PageImpl) PageRequest(org.springframework.data.domain.PageRequest) EntityEventProcessorDto(eu.bcvsolutions.idm.core.api.dto.EntityEventProcessorDto) ApiOperation(io.swagger.annotations.ApiOperation) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

EntityEventProcessorDto (eu.bcvsolutions.idm.core.api.dto.EntityEventProcessorDto)11 EntityEventProcessorFilter (eu.bcvsolutions.idm.core.api.dto.filter.EntityEventProcessorFilter)8 Test (org.junit.Test)8 Lists (com.google.common.collect.Lists)7 CoreModuleDescriptor (eu.bcvsolutions.idm.core.CoreModuleDescriptor)7 AbstractDto (eu.bcvsolutions.idm.core.api.dto.AbstractDto)7 IdmIdentityContractDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto)7 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)7 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)7 AbstractEntityEventProcessor (eu.bcvsolutions.idm.core.api.event.AbstractEntityEventProcessor)7 CoreEventType (eu.bcvsolutions.idm.core.api.event.CoreEvent.CoreEventType)7 EntityEvent (eu.bcvsolutions.idm.core.api.event.EntityEvent)7 EventResult (eu.bcvsolutions.idm.core.api.event.EventResult)7 EventType (eu.bcvsolutions.idm.core.api.event.EventType)7 LookupService (eu.bcvsolutions.idm.core.api.service.LookupService)7 IdentityDeleteProcessor (eu.bcvsolutions.idm.core.model.event.processor.identity.IdentityDeleteProcessor)7 IdentitySaveProcessor (eu.bcvsolutions.idm.core.model.event.processor.identity.IdentitySaveProcessor)7 DefaultEntityEventManager (eu.bcvsolutions.idm.core.model.service.impl.DefaultEntityEventManager)7 EnabledEvaluator (eu.bcvsolutions.idm.core.security.api.service.EnabledEvaluator)7 AbstractUnitTest (eu.bcvsolutions.idm.test.api.AbstractUnitTest)7