private static boolean tmEnable(String id, Map<String, ModuleDescriptor> modsAvailable, Map<String, ModuleDescriptor> modsEnabled, List<TenantModuleDescriptor> tml, Handler<ExtendedAsyncResult<Boolean>> fut) { if (addModuleDependencies(modsAvailable.get(id), modsAvailable, modsEnabled, tml) == -1) { fut.handle(new Failure<>(USER, "install: can not enable " + id + " due to missing dependencies or conflict")); return true; } return false; }
private static boolean tmDisable(String id, Map<String, ModuleDescriptor> modsAvailable, Map<String, ModuleDescriptor> modsEnabled, List<TenantModuleDescriptor> tml, Handler<ExtendedAsyncResult<Boolean>> fut) { if (removeModuleDependencies(modsAvailable.get(id), modsEnabled, tml) == -1) { fut.handle(new Failure<>(USER, "install: can not disable " + id + " due to missing dependencies or conflict")); return true; } return false; }
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 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 getNode1(String nodeId, Handler<ExtendedAsyncResult<NodeDescriptor>> fut) { if (clusterManager != null) { List<String> n = clusterManager.getNodes(); if (!n.contains(nodeId)) { fut.handle(new Failure<>(NOT_FOUND, messages.getMessage("10806", nodeId))); return; } } nodes.get(nodeId, fut); }
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 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<>("")); }); }
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<>("")); }); }
public void init(Vertx vertx, Handler<ExtendedAsyncResult<Void>> fut) { modules.init(vertx, mapName, ires -> { if (ires.failed()) { fut.handle(new Failure<>(ires.getType(), ires.cause())); } else { loadModules(fut); } }); }
public void remove(String name, Handler<ExtendedAsyncResult<Void>> fut) { envMap.remove(name, res -> { if (res.failed()) { fut.handle(new Failure<>(res.getType(), res.cause())); } else { envStore.delete(name, fut); } }); } }
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<>("")); }); }
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)); }); }
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 listEnv(Handler<ExtendedAsyncResult<String>> fut) { envManager.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 getEnv(String id, Handler<ExtendedAsyncResult<String>> fut) { envManager.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)); }); }
public void getNode(String nodeId, Handler<ExtendedAsyncResult<NodeDescriptor>> fut) { nodeUrl(nodeId, res -> { if (res.failed()) { fut.handle(new Failure<>(res.getType(), res.cause())); } else { getNode1(res.result(), fut); } }); }
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)); }); }
public void removeAndUndeploy(ProxyContext pc, String srvcId, Handler<ExtendedAsyncResult<Void>> fut) { logger.info("removeAndUndeploy: srvcId " + srvcId); deployments.get(srvcId, res -> { if (res.failed()) { logger.warn("deployment.get failed"); fut.handle(new Failure<>(res.getType(), res.cause())); } else { removeAndUndeploy(pc, res.result(), fut); } }); }