Search in sources :

Example 1 with GobiPurchaseOrderParser

use of org.folio.gobi.GobiPurchaseOrderParser in project mod-gobi by folio-org.

the class PostGobiOrdersHelper method parse.

public CompletableFuture<Document> parse(String entity) {
    VertxCompletableFuture<Document> future = new VertxCompletableFuture<>(ctx);
    final GobiPurchaseOrderParser parser = GobiPurchaseOrderParser.getParser();
    try {
        future.complete(parser.parse(entity));
    } catch (GobiPurchaseOrderParserException e) {
        logger.error("Failed to parse GobiPurchaseOrder", e);
        future.completeExceptionally(e);
    }
    return future;
}
Also used : GobiPurchaseOrderParserException(org.folio.gobi.exceptions.GobiPurchaseOrderParserException) VertxCompletableFuture(me.escoffier.vertx.completablefuture.VertxCompletableFuture) Document(org.w3c.dom.Document) GobiPurchaseOrderParser(org.folio.gobi.GobiPurchaseOrderParser)

Aggregations

VertxCompletableFuture (me.escoffier.vertx.completablefuture.VertxCompletableFuture)1 GobiPurchaseOrderParser (org.folio.gobi.GobiPurchaseOrderParser)1 GobiPurchaseOrderParserException (org.folio.gobi.exceptions.GobiPurchaseOrderParserException)1 Document (org.w3c.dom.Document)1