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)); }
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<>()); } }); }
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<>("")); }); }
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<>()); } }); }
private void disableModuleForTenant(ProxyContext pc, String id, String module, Handler<ExtendedAsyncResult<String>> fut) { pc.debug("disablemodule t=" + id + " m=" + module); tenantManager.enableAndDisableModule(id, module, null, pc, res -> { if (res.failed()) { fut.handle(new Failure<>(res.getType(), res.cause())); return; } fut.handle(new Success<>("")); }); }
private void deleteModule(ProxyContext pc, String id, Handler<ExtendedAsyncResult<String>> fut) { moduleManager.delete(id, res -> { if (res.failed()) { pc.error("delete module failed: " + res.getType() + ":" + res.cause().getMessage()); fut.handle(new Failure<>(res.getType(), res.cause())); return; } fut.handle(new Success<>("")); }); }
public void get(String k, Handler<ExtendedAsyncResult<T>> fut) { getString(k, null, res -> { if (res.failed()) { fut.handle(new Failure<>(res.getType(), res.cause())); } else { fut.handle(new Success<>(Json.decodeValue(res.result(), clazz))); } }); }
private void getDeployment(String id, Handler<ExtendedAsyncResult<String>> fut) { deploymentManager.get(id, res -> { if (res.failed()) { fut.handle(new Failure<>(res.getType(), res.cause())); return; } final String s = Json.encodePrettily(res.result()); fut.handle(new Success<>(s)); }); }
private void discoveryHealthAll(Handler<ExtendedAsyncResult<String>> fut) { discoveryManager.health(res -> { if (res.failed()) { fut.handle(new Failure<>(res.getType(), res.cause())); return; } final String s = Json.encodePrettily(res.result()); fut.handle(new Success<>(s)); }); }
private void listDiscoveryModules(Handler<ExtendedAsyncResult<String>> fut) { discoveryManager.get(res -> { if (res.failed()) { fut.handle(new Failure<>(res.getType(), res.cause())); return; } final String s = Json.encodePrettily(res.result()); fut.handle(new Success<>(s)); }); }
private void discoveryGetSrvcId(String srvcId, Handler<ExtendedAsyncResult<String>> fut) { discoveryManager.getNonEmpty(srvcId, res -> { if (res.failed()) { fut.handle(new Failure<>(res.getType(), res.cause())); return; } final String s = Json.encodePrettily(res.result()); fut.handle(new Success<>(s)); }); }
private void discoveryHealthSrvcId(String srvcId, Handler<ExtendedAsyncResult<String>> fut) { discoveryManager.health(srvcId, res -> { if (res.failed()) { fut.handle(new Failure<>(res.getType(), res.cause())); return; } final String s = Json.encodePrettily(res.result()); fut.handle(new Success<>(s)); }); }
private void getDiscoveryNode(String id, Handler<ExtendedAsyncResult<String>> fut) { logger.debug("Int: getDiscoveryNode: " + id); discoveryManager.getNode(id, res -> { if (res.failed()) { fut.handle(new Failure<>(res.getType(), res.cause())); return; } final String s = Json.encodePrettily(res.result()); fut.handle(new Success<>(s)); }); }
private void getTenant(String id, Handler<ExtendedAsyncResult<String>> fut) { tenantManager.get(id, res -> { if (res.failed()) { fut.handle(new Failure<>(res.getType(), res.cause())); return; } Tenant te = res.result(); TenantDescriptor td = te.getDescriptor(); String s = Json.encodePrettily(td); fut.handle(new Success<>(s)); }); }