Package com.orientechnologies.orient.core.serialization.serializer

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


      } else

        throw new OSerializationException("Error on marshalling record of type '" + iRecord.getClass()
            + "' to JSON. The record type can't be exported to JSON");

      json.endObject(indentLevel);
      parsedRecords.clear();

      iOutput.append(buffer);
      return iOutput;
    } catch (IOException e) {
View Full Code Here


          }
      }
    }
    json.endCollection(1, true);

    json.endObject();

    sendTextContent(iRequest, OHttpUtils.STATUS_OK_CODE, "OK", null, OHttpUtils.CONTENT_JSON, buffer.toString());
  }

  protected void sendRecordContent(final OHttpRequest iRequest, final ORecord<?> iRecord) throws IOException {
View Full Code Here

          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);
          json.writeAttribute(3, false, "files", Arrays.toString(data.getConfig().infoFiles));
          json.endObject(2, false);
        }
        json.endCollection(1, true);
      }

      if (db.getClusterNames() != null) {
View Full Code Here

              json.writeAttribute(3, false, "files", "-");
            }
          } catch (Exception e) {
            json.writeAttribute(3, false, "records", "? (Unauthorized)");
          }
          json.endObject(2, false);
        }
        json.endCollection(1, true);
      }

      if (db.getStorage() instanceof OStorageLocal) {
View Full Code Here

        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);
        json.endObject(2, false);
        json.endCollection(1, true);
      }

      json.beginCollection(1, false, "users");
      OUser user;
View Full Code Here

      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);

      json.beginCollection(1, true, "roles");
      ORole role;
View Full Code Here

          json.writeAttribute(4, true, "name", rule.getKey());
          json.writeAttribute(4, false, "create", role.allow(rule.getKey(), ORole.PERMISSION_CREATE));
          json.writeAttribute(4, false, "read", role.allow(rule.getKey(), ORole.PERMISSION_READ));
          json.writeAttribute(4, false, "update", role.allow(rule.getKey(), ORole.PERMISSION_UPDATE));
          json.writeAttribute(4, false, "delete", role.allow(rule.getKey(), ORole.PERMISSION_DELETE));
          json.endObject(4, true);
        }
        json.endCollection(3, false);

        json.endObject(2, true);
      }
View Full Code Here

          json.writeAttribute(4, false, "delete", role.allow(rule.getKey(), ORole.PERMISSION_DELETE));
          json.endObject(4, true);
        }
        json.endCollection(3, false);

        json.endObject(2, true);
      }
      json.endCollection(1, true);

      json.beginObject(1, true, "config");
View Full Code Here

        for (OStorageEntryConfiguration entry : db.getStorage().getConfiguration().properties) {
          if (entry != null) {
            json.beginObject(3, true, null);
            json.writeAttribute(4, false, "name", entry.name);
            json.writeAttribute(4, false, "value", entry.value);
            json.endObject(3, true);
          }
        }
      json.endCollection(2, true);

      json.endObject(1, true);
View Full Code Here

            json.endObject(3, true);
          }
        }
      json.endCollection(2, true);

      json.endObject(1, true);
      json.endObject();
      json.flush();

      sendTextContent(iRequest, OHttpUtils.STATUS_OK_CODE, "OK", null, OHttpUtils.CONTENT_JSON, buffer.toString());
    } finally {
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.