Search in sources :

Example 1 with PullDescriptor

use of org.folio.okapi.bean.PullDescriptor in project okapi by folio-org.

the class InternalModule method pullModules.

private void pullModules(String body, Handler<ExtendedAsyncResult<String>> fut) {
    try {
        final PullDescriptor pmd = Json.decodeValue(body, PullDescriptor.class);
        pullManager.pull(pmd, res -> {
            if (res.failed()) {
                fut.handle(new Failure<>(res.getType(), res.cause()));
                return;
            }
            fut.handle(new Success<>(Json.encodePrettily(res.result())));
        });
    } catch (DecodeException ex) {
        fut.handle(new Failure<>(USER, ex));
    }
}
Also used : PullDescriptor(org.folio.okapi.bean.PullDescriptor) DecodeException(io.vertx.core.json.DecodeException) Failure(org.folio.okapi.common.Failure)

Aggregations

DecodeException (io.vertx.core.json.DecodeException)1 PullDescriptor (org.folio.okapi.bean.PullDescriptor)1 Failure (org.folio.okapi.common.Failure)1