Examples of beginObject()


Examples of com.orientechnologies.orient.core.serialization.serializer.OJSONWriter.beginObject()

        json.writeAttribute(4, false, "value", entry.value);
        json.endObject(3, true);
      }
      json.endCollection(2, true);

      json.beginObject(1, true, "profiler");
      json.beginCollection(2, true, "counters");
      for (String c : OProfiler.getInstance().getCounters()) {
        json.beginObject(3);
        writeField(json, 3, "name", c);
        writeField(json, 3, "value", OProfiler.getInstance().getCounter(c));
View Full Code Here

Examples of com.orientechnologies.orient.core.serialization.serializer.OJSONWriter.beginObject()

      json.endCollection(2, true);

      json.beginObject(1, true, "profiler");
      json.beginCollection(2, true, "counters");
      for (String c : OProfiler.getInstance().getCounters()) {
        json.beginObject(3);
        writeField(json, 3, "name", c);
        writeField(json, 3, "value", OProfiler.getInstance().getCounter(c));
        json.endObject(3);
      }
      json.endCollection(2, false);
View Full Code Here

Examples of com.orientechnologies.orient.core.serialization.serializer.OJSONWriter.beginObject()

      json.beginCollection(2, true, "stats");
      for (String s : OProfiler.getInstance().getStats()) {
        pEntry = OProfiler.getInstance().getStat(s);

        json.beginObject(3);
        writeField(json, 3, "name", s);
        writeField(json, 3, "total", pEntry.items);
        writeField(json, 3, "averageElapsed", pEntry.average);
        writeField(json, 3, "minElapsed", pEntry.min);
        writeField(json, 3, "maxElapsed", pEntry.max);
View Full Code Here

Examples of com.orientechnologies.orient.core.serialization.serializer.OJSONWriter.beginObject()

      json.beginCollection(2, true, "chronos");
      for (String c : OProfiler.getInstance().getChronos()) {
        pEntry = OProfiler.getInstance().getChrono(c);

        json.beginObject(3);
        writeField(json, 3, "name", c);
        writeField(json, 3, "total", pEntry.items);
        writeField(json, 3, "averageElapsed", pEntry.average);
        writeField(json, 3, "minElapsed", pEntry.min);
        writeField(json, 3, "maxElapsed", pEntry.max);
View Full Code Here

Examples of com.orientechnologies.orient.core.serialization.serializer.OJSONWriter.beginObject()

        db = getProfiledDatabaseInstance(iRequest);

      final StringWriter buffer = new StringWriter();
      final OJSONWriter json = new OJSONWriter(buffer);

      json.beginObject();
      if (db.getMetadata().getSchema().getClasses() != null) {
        json.beginCollection(1, false, "classes");
        for (OClass cls : db.getMetadata().getSchema().getClasses()) {
          try {
            exportClass(db, json, cls);
View Full Code Here

Examples of com.orientechnologies.orient.core.serialization.serializer.OJSONWriter.beginObject()

      }

      if (db.getStorage() instanceof OStorageLocal) {
        json.beginCollection(1, false, "dataSegments");
        for (ODataLocal data : ((OStorageLocal) db.getStorage()).getDataSegments()) {
          json.beginObject(2, true, null);
          json.writeAttribute(3, false, "id", data.getId());
          json.writeAttribute(3, false, "name", data.getName());
          json.writeAttribute(3, false, "size", data.getSize());
          json.writeAttribute(3, false, "filled", data.getFilledUpTo());
          json.writeAttribute(3, false, "maxSize", data.getConfig().maxSize);
View Full Code Here

Examples of com.orientechnologies.orient.core.serialization.serializer.OJSONWriter.beginObject()

        OCluster cluster;
        for (String clusterName : db.getClusterNames()) {
          cluster = ((OStorageEmbedded) db.getStorage()).getClusterById(db.getClusterIdByName(clusterName));

          try {
            json.beginObject(2, true, null);
            json.writeAttribute(3, false, "id", cluster.getId());
            json.writeAttribute(3, false, "name", clusterName);
            json.writeAttribute(3, false, "type", cluster.getType());
            json.writeAttribute(3, false, "records", cluster.getEntries());
            if (cluster instanceof OClusterLocal) {
View Full Code Here

Examples of com.orientechnologies.orient.core.serialization.serializer.OJSONWriter.beginObject()

      }

      if (db.getStorage() instanceof OStorageLocal) {
        json.beginCollection(1, false, "txSegment");
        final OTxSegment txSegment = ((OStorageLocal) db.getStorage()).getTxManager().getTxSegment();
        json.beginObject(2, true, null);
        json.writeAttribute(3, false, "totalLogs", txSegment.getTotalLogCount());
        json.writeAttribute(3, false, "size", txSegment.getSize());
        json.writeAttribute(3, false, "filled", txSegment.getFilledUpTo());
        json.writeAttribute(3, false, "maxSize", txSegment.getConfig().maxSize);
        json.writeAttribute(3, false, "file", txSegment.getConfig().path);
View Full Code Here

Examples of com.orientechnologies.orient.core.serialization.serializer.OJSONWriter.beginObject()

      json.beginCollection(1, false, "users");
      OUser user;
      for (ODocument doc : db.getMetadata().getSecurity().getUsers()) {
        user = new OUser(doc);
        json.beginObject(2, true, null);
        json.writeAttribute(3, false, "name", user.getName());
        json.writeAttribute(3, false, "roles", user.getRoles() != null ? Arrays.toString(user.getRoles().toArray()) : "null");
        json.endObject(2, false);
      }
      json.endCollection(1, true);
View Full Code Here

Examples of com.orientechnologies.orient.core.serialization.serializer.OJSONWriter.beginObject()

  protected void sendRecordsContent(final OHttpRequest iRequest, final List<ORecord<?>> iRecords, String iFetchPlan)
      throws IOException {
    final StringWriter buffer = new StringWriter();
    final OJSONWriter json = new OJSONWriter(buffer, JSON_FORMAT);
    json.beginObject();

    // WRITE ENTITY SCHEMA IF ANY
    if (iRecords != null && iRecords.size() > 0) {
      ORecord<?> first = iRecords.get(0);
      if (first != null && first instanceof ODocument) {
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.