if (result.failed()) {
new DefaultFutureResult<Collection<Group>>(new ClusterException(result.cause())).setHandler(resultHandler);
} else if (result.result().body().getString("status").equals("error")) {
new DefaultFutureResult<Collection<Group>>(new ClusterException(result.result().body().getString("message"))).setHandler(resultHandler);
} else if (result.result().body().getString("status").equals("ok")) {
JsonArray jsonGroups = result.result().body().getArray("result");
List<Group> groups = new ArrayList<>();
for (Object jsonGroup : jsonGroups) {
groups.add(new DefaultGroup((String) jsonGroup, vertx, container));
}
new DefaultFutureResult<Collection<Group>>(groups).setHandler(resultHandler);