Search in sources :

Example 1 with JobExecutionFilter

use of org.folio.dao.JobExecutionFilter in project mod-source-record-manager by folio-org.

the class MetadataProviderImpl method getMetadataProviderJobExecutions.

@Override
public void getMetadataProviderJobExecutions(List<String> statusAny, List<String> profileIdNotAny, String statusNot, List<String> uiStatusAny, String hrId, String fileName, List<String> profileIdAny, String userId, Date completedAfter, Date completedBefore, List<String> sortBy, int offset, int limit, Map<String, String> okapiHeaders, Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) {
    vertxContext.runOnContext(v -> {
        try {
            List<SortField> sortFields = mapSortQueryToSortFields(sortBy);
            JobExecutionFilter filter = buildJobExecutionFilter(statusAny, profileIdNotAny, statusNot, uiStatusAny, hrId, fileName, profileIdAny, userId, completedAfter, completedBefore);
            jobExecutionsCache.get(tenantId, filter, sortFields, offset, limit).map(GetMetadataProviderJobExecutionsResponse::respond200WithApplicationJson).map(Response.class::cast).otherwise(ExceptionHelper::mapExceptionToResponse).onComplete(asyncResultHandler);
        } catch (Exception e) {
            asyncResultHandler.handle(Future.succeededFuture(ExceptionHelper.mapExceptionToResponse(e)));
        }
    });
}
Also used : Response(javax.ws.rs.core.Response) JobExecutionFilter(org.folio.dao.JobExecutionFilter) SortField(org.folio.dao.util.SortField) BadRequestException(javax.ws.rs.BadRequestException) NotFoundException(javax.ws.rs.NotFoundException)

Aggregations

BadRequestException (javax.ws.rs.BadRequestException)1 NotFoundException (javax.ws.rs.NotFoundException)1 Response (javax.ws.rs.core.Response)1 JobExecutionFilter (org.folio.dao.JobExecutionFilter)1 SortField (org.folio.dao.util.SortField)1