/** * Pretty simplistic health check. */ private void getHealth(Handler<ExtendedAsyncResult<String>> fut) { fut.handle(new Success<>("[ ]")); }
public void list(Handler<ExtendedAsyncResult<List<DeploymentDescriptor>>> fut) { List<DeploymentDescriptor> ml = new LinkedList<>(); for (Map.Entry<String, DeploymentDescriptor> entry : list.entrySet()) { ml.add(entry.getValue()); } fut.handle(new Success<>(ml)); }
@Override public void get(K k, Handler<AsyncResult<V>> resultHandler) { V v = map.get(k); // null if not found resultHandler.handle(new Success<>(v)); }
public void getKeys(Handler<ExtendedAsyncResult<Collection<String>>> fut) { list.keys(res -> { if (res.failed()) { fut.handle(new Failure<>(INTERNAL, res.cause())); } else { List<String> s2 = new ArrayList<>(res.result()); java.util.Collections.sort(s2); fut.handle(new Success<>(s2)); } }); }
public void getConnection(Handler<ExtendedAsyncResult<SQLConnection>> fut) { cli.getConnection(res -> { if (res.failed()) { fut.handle(new Failure<>(INTERNAL, res.cause())); } else { SQLConnection con = res.result(); fut.handle(new Success<>(con)); } }); }
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))); } } }
public void get(String srvcId, Handler<ExtendedAsyncResult<List<DeploymentDescriptor>>> fut) { getNonEmpty(srvcId, res -> { if (res.failed() && res.getType() == NOT_FOUND) { fut.handle(new Success<>(new LinkedList<>())); } else { fut.handle(res); } }); }
public void all(Handler<ExtendedAsyncResult<Void>> fut) { CompositeFuture.all(futures).setHandler(res2 -> { if (res2.failed()) { fut.handle(new Failure<>(errorType, res2.cause())); } else { fut.handle(new Success<>()); } }); }
public void all(T l, Handler<ExtendedAsyncResult<T>> fut) { CompositeFuture.all(futures).setHandler(res2 -> { if (res2.failed()) { fut.handle(new Failure<>(errorType, res2.cause())); } else { fut.handle(new Success<>(l)); } }); }
private void getVersion(ProxyContext pc, Handler<ExtendedAsyncResult<String>> fut) { String v = okapiVersion; if (v == null) { v = "0.0.0"; } pc.getCtx().response().putHeader("Content-Type", "text/plain"); // !! fut.handle(new Success<>(v)); }
private void setRootLogLevel(String body, Handler<ExtendedAsyncResult<String>> fut) { final LogHelper.LogLevelInfo inf = Json.decodeValue(body, LogHelper.LogLevelInfo.class); logHelper.setRootLogLevel(inf.getLevel()); fut.handle(new Success<>(body)); // Should at least return the actual log level, not whatever we post // We can post FOOBAR, and nothing changes... }
private void discoveryUndeploy(ProxyContext pc, Handler<ExtendedAsyncResult<String>> fut) { discoveryManager.removeAndUndeploy(pc, res -> { if (res.failed()) { fut.handle(new Failure<>(res.getType(), res.cause())); return; } fut.handle(new Success<>("")); }); }
private void deleteEnv(String id, Handler<ExtendedAsyncResult<String>> fut) { envManager.remove(id, res -> { if (res.failed()) { fut.handle(new Failure<>(res.getType(), res.cause())); return; } fut.handle(new Success<>("")); }); }
private void deleteDeployment(String id, Handler<ExtendedAsyncResult<String>> fut) { deploymentManager.undeploy(id, res -> { if (res.failed()) { fut.handle(new Failure<>(res.getType(), res.cause())); return; } fut.handle(new Success<>("")); }); }
private void deleteInternal(String id, Handler<ExtendedAsyncResult<Void>> fut) { modules.remove(id, rres -> { if (rres.failed()) { fut.handle(new Failure<>(rres.getType(), rres.cause())); } else { fut.handle(new Success<>()); } }); }
public void remove(String srvcId, String instId, Handler<ExtendedAsyncResult<Void>> fut) { deployments.remove(srvcId, instId, res -> { if (res.failed()) { fut.handle(new Failure<>(res.getType(), res.cause())); } else { 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())); } }); }