use of org.folio.rest.jaxrs.model.JobsConfs in project raml-module-builder by folio-org.
the class JobAPI method getJobsJobconfs.
@Validate
@Override
public void getJobsJobconfs(String query, String orderBy, Order order, int offset, int limit, String lang, Map<String, String> okapiHeaders, Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) throws Exception {
try {
Criterion criterion = Criterion.json2Criterion(query);
criterion.setLimit(new Limit(limit)).setOffset(new Offset(offset));
org.folio.rest.persist.Criteria.Order or = getOrder(order, orderBy);
if (or != null) {
criterion.setOrder(or);
}
System.out.println("sending... getJobsJobconfs");
vertxContext.runOnContext(v -> {
try {
PostgresClient.getInstance(vertxContext.owner()).get(RTFConsts.JOB_CONF_COLLECTION, JobConf.class, criterion, true, reply -> {
JobsConfs ps = new JobsConfs();
@SuppressWarnings("unchecked") List<JobConf> jobConfs = (List<JobConf>) reply.result().getResults();
ps.setJobConfs(jobConfs);
ps.setTotalRecords(jobConfs.size());
asyncResultHandler.handle(io.vertx.core.Future.succeededFuture(GetJobsJobconfsResponse.withJsonOK(ps)));
});
} catch (Exception e) {
log.error(e);
asyncResultHandler.handle(io.vertx.core.Future.succeededFuture(GetJobsJobconfsResponse.withPlainInternalServerError(messages.getMessage(lang, MessageConsts.InternalServerError))));
}
});
} catch (Exception e) {
log.error(e);
asyncResultHandler.handle(io.vertx.core.Future.succeededFuture(GetJobsJobconfsResponse.withPlainInternalServerError(messages.getMessage(lang, MessageConsts.InternalServerError))));
}
}
Aggregations