class SoMonitoringController {

    @POST
    @Path("/v1/search")
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
    public Response getInfraActiveRequests(final Map<String, String[]> filters,
            @QueryParam("from") final long startTime, @QueryParam("to") final long endTime,
            @QueryParam("maxResult") final Integer maxResult) {

        if (filters == null) {
            return Response.status(Status.BAD_REQUEST).entity("Invalid filters: " + filters).build();
        }
        try {
            final List<SoInfraRequest> requests =
                    databaseServiceProvider.getSoInfraRequest(filters, startTime, endTime, maxResult);
            LOGGER.info("result size: {}", requests.size());
            return Response.status(Status.OK).entity(requests).build();

        } catch (final InvalidRestRequestException | HttpResouceNotFoundException extensions) {
            final String message = "Unable to search request for filters: " + filters + ", from: " + startTime
                    + ", to: " + endTime + ", maxResult: " + maxResult;
            LOGGER.error(message);
            return Response.status(Status.BAD_REQUEST).entity(message).build();
        } catch (final RestProcessingException restProcessingException) {
            final String message = "Unable to search request for filters: " + filters + ", from: " + startTime
                    + ", to: " + endTime + ", maxResult: " + maxResult;
            LOGGER.error(message);
            return Response.status(Status.INTERNAL_SERVER_ERROR).entity(message).build();
        }
    }

    @Autowired public  SoMonitoringController(final DatabaseServiceProvider databaseServiceProvider,
            final CamundaProcessDataServiceProvider camundaProcessDataServiceProvider);

}