use of org.folio.inventory.resources.ItemsByHoldingsRecordId in project mod-inventory by folio-org.
the class InventoryVerticle method start.
@Override
public void start(Promise<Void> started) {
Logging.initialiseFormat();
final Logger log = LogManager.getLogger(MethodHandles.lookup().lookupClass());
Router router = Router.router(vertx);
server = vertx.createHttpServer();
JsonObject config = vertx.getOrCreateContext().config();
log.info("Received Config");
config.fieldNames().forEach(key -> log.info(String.format("%s:%s", key, config.getValue(key).toString())));
HttpClient client = vertx.createHttpClient();
Storage storage = Storage.basedUpon(vertx, config, client);
new IngestMessageProcessor(storage).register(vertx.eventBus());
router.route().handler(WebRequestDiagnostics::outputDiagnostics);
new ModsIngestion(storage, client).register(router);
new Items(storage, client).register(router);
new MoveApi(storage, client).register(router);
new Instances(storage, client).register(router);
new Holdings(storage).register(router);
new InstancesBatch(storage, client).register(router);
new IsbnUtilsApi().register(router);
new ItemsByHoldingsRecordId(storage, client).register(router);
new InventoryConfigApi().register(router);
new TenantApi().register(router);
Handler<AsyncResult<HttpServer>> onHttpServerStart = result -> {
if (result.succeeded()) {
log.info(String.format("Listening on %s", server.actualPort()));
started.complete();
} else {
started.fail(result.cause());
}
};
server.requestHandler(router).listen(config.getInteger("port"), onHttpServerStart);
}
Aggregations