Package org.vertx.java.core.json

Examples of org.vertx.java.core.json.JsonArray.addObject()


   */
  private JsonArray processRedisOps(long docVersion, List<String> ops) {
    long startVersion = docVersion - ops.size();
    JsonArray toRtn = new JsonArray();
    for (String op : ops) {
      toRtn.addObject(new JsonObject(op).putNumber(Key.VERSION, startVersion++));
    }
    return toRtn;
  }

  private void redisCacheVersion(final String docType, final String docId, final long docVersion,
View Full Code Here


    if (to == null) {
      to = Long.valueOf(opLog.size());
    }
    JsonArray ops = new JsonArray();
    for (int i = from.intValue(); i < to; i++) {
      ops.addObject(opLog.get(i));
    }
    JsonObject toRtn = new JsonObject().putArray(Key.OPS, ops);
    callback.handle(new DefaultFutureResult<JsonObject>(toRtn));
  }
View Full Code Here

        if (body.containsField(WebSocketBus.SESSION)) {
          sessions.add(body.getString(WebSocketBus.SESSION));
        }
        JsonArray collaborators = new JsonArray();
        for (String sessionId : sessions) {
          collaborators.addObject(getCollaborator(sessionId));
        }
        message.reply(collaborators);
      }
    }, new Handler<AsyncResult<Void>>() {
      @Override
View Full Code Here

      for (Module module : modules) {
        modulesArray.addObject(new JsonObject().putString(
            "module_name", module.getName()));
      }
      for (Deployment deployment : deployments) {
        deploymentsArray.addObject(new JsonObject()
            .putString("module_name",
                deployment.getDeployedModule().getName())
            .putString("deployment_id",
                deployment.getDeploymentID()));
      }
View Full Code Here

      JsonObject replyMessage = new JsonObject();
      JsonArray modulesArray = new JsonArray();

      Module[] modules = that.modules.getModules();
      for (Module module : modules) {
        modulesArray.addObject(new JsonObject().putString(
            "module_name", module.getName()));
      }

      replyMessage.putArray("modules", modulesArray);
View Full Code Here

      JsonObject replyMessage = new JsonObject();
      JsonArray deploymentsArray = new JsonArray();

      Deployment[] deployments = that.modules.getDeployments();
      for (Deployment deployment : deployments) {
        deploymentsArray.addObject(new JsonObject()
            .putString("module_name",
                deployment.getDeployedModule().getName())
            .putString("deployment_id",
                deployment.getDeploymentID()));
      }
View Full Code Here

    SockJSServer sockjsServer = vertx.createSockJSServer(server);

    JsonObject config = new JsonObject().putString("prefix", "/eventbus");
    JsonArray inbound = new JsonArray();
    inbound.addObject(new JsonObject().putString("address_re",
        "deployment-manager\\.server\\..+"));
    JsonArray outbound = new JsonArray();
    outbound.addObject(new JsonObject().putString("address_re",
        "deployment-manager\\.client\\..+"));
View Full Code Here

    JsonObject config = new JsonObject().putString("prefix", "/eventbus");
    JsonArray inbound = new JsonArray();
    inbound.addObject(new JsonObject().putString("address_re",
        "deployment-manager\\.server\\..+"));
    JsonArray outbound = new JsonArray();
    outbound.addObject(new JsonObject().putString("address_re",
        "deployment-manager\\.client\\..+"));

    sockjsServer.bridge(config, inbound, outbound);

    server.listen(8080, "localhost");
View Full Code Here

                for (String key : result.keySet()) {
                    doc.putValue(key, getJsonValue(result.getFieldValue(key)));
                }

                docs.addObject(doc);
            }

            JsonObject reply = new JsonObject()
                    .putNumber("max_score", results.getMaxScore())
                    .putNumber("number_found", results.getNumFound())
View Full Code Here

  }

  public static JsonArray listOfMapsToJsonArray( List<Map<String,Object>> result ) {
    JsonArray rows = new JsonArray() ;
    for( Map<String,Object> row : result ) {
      rows.addObject( new JsonObject( row ) ) ;
    }
    return rows ;
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.