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);
}
Aggregations