public static void responseError(RoutingContext ctx, ErrorType t, Throwable cause) { responseError(ctx, ErrorType.httpCode(t), cause); }
@Override public boolean equals(Object that) { if (this == that) { return true; } if (!(that instanceof SemVer)) { return false; } return compareTo((SemVer) that) == 0; }
private void discoveryUndeploy(ProxyContext pc, String srvcId, String instId, Handler<ExtendedAsyncResult<String>> fut) { discoveryManager.removeAndUndeploy(pc, srvcId, instId, res -> { if (res.failed()) { fut.handle(new Failure<>(res.getType(), res.cause())); return; } fut.handle(new Success<>("")); }); }
public void init(Vertx vertx, String mapName, Handler<ExtendedAsyncResult<Void>> fut) { this.vertx = vertx; AsyncMapFactory.<String, String>create(vertx, mapName, res -> { if (res.succeeded()) { this.list = res.result(); fut.handle(new Success<>()); } else { fut.handle(new Failure<>(INTERNAL, res.cause())); } }); }
public void get(String id, Handler<ExtendedAsyncResult<DeploymentDescriptor>> fut) { if (!list.containsKey(id)) { fut.handle(new Failure<>(NOT_FOUND, messages.getMessage("10705", id))); } else { fut.handle(new Success<>(list.get(id))); } } }
/** * Explicit constructor. * * @param okapiUrl * @param vertx * @param headers may be null */ public OkapiClient(String okapiUrl, Vertx vertx, Map<String, String> headers) { init(vertx); setOkapiUrl(okapiUrl); setHeaders(headers); respHeaders = null; }
public void get(String path, Handler<ExtendedAsyncResult<String>> fut) { request(HttpMethod.GET, path, "", fut); }
@Override public boolean equals(Object that) { if (this == that) { return true; } if (!(that instanceof ModuleId)) { return false; } return compareTo((ModuleId) that) == 0; }
@Override public int hashCode() { return id.hashCode(); }
public void delete(String path, Handler<ExtendedAsyncResult<String>> fut) { request(HttpMethod.DELETE, path, "", fut); }
public void post(String path, String data, Handler<ExtendedAsyncResult<String>> fut) { request(HttpMethod.POST, path, data, fut); }