use of org.folio.rest.jaxrs.model.HridSettings in project mod-inventory-storage by folio-org.
the class HridSettingsStorageAPI method putHridSettingsStorageHridSettings.
@Validate
@Override
public void putHridSettingsStorageHridSettings(HridSettings hridSettings, Map<String, String> okapiHeaders, Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) {
try {
vertxContext.runOnContext(v -> {
try {
final PostgresClient postgresClient = PostgresClient.getInstance(vertxContext.owner(), TenantTool.tenantId(okapiHeaders));
final HridManager hridManager = new HridManager(vertxContext, postgresClient);
hridManager.updateHridSettings(hridSettings).map(success -> successPut(asyncResultHandler)).otherwise(error -> internalErrorPut(asyncResultHandler, error));
} catch (Exception e) {
internalErrorPut(asyncResultHandler, e);
}
});
} catch (Exception e) {
internalErrorPut(asyncResultHandler, e);
}
}
use of org.folio.rest.jaxrs.model.HridSettings in project mod-inventory-storage by folio-org.
the class HridSettingsStorageAPI method getHridSettingsStorageHridSettings.
@Validate
@Override
public void getHridSettingsStorageHridSettings(Map<String, String> okapiHeaders, Handler<AsyncResult<Response>> asyncResultHandler, Context vertxContext) {
try {
vertxContext.runOnContext(v -> {
try {
final PostgresClient postgresClient = PostgresClient.getInstance(vertxContext.owner(), TenantTool.tenantId(okapiHeaders));
final HridManager hridManager = new HridManager(vertxContext, postgresClient);
hridManager.getHridSettings().map(hridSettings -> successGet(asyncResultHandler, hridSettings)).otherwise(error -> internalErrorGet(asyncResultHandler, error));
} catch (Exception e) {
internalErrorGet(asyncResultHandler, e);
}
});
} catch (Exception e) {
internalErrorGet(asyncResultHandler, e);
}
}
Aggregations