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

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


     json.beginCollection(1, true, "roles");
     ORole role;
     for (ODocument doc : db.getMetadata().getSecurity().getAllRoles()) {
       role = new ORole(doc);
       json.beginObject(2, true, null);
       json.writeAttribute(3, false, "name", role.getName());
       json.writeAttribute(3, false, "mode", role.getMode().toString());

       json.beginCollection(3, true, "rules");
       for (Entry<String, Byte> rule : role.getRules().entrySet()) {
View Full Code Here


       json.writeAttribute(3, false, "name", role.getName());
       json.writeAttribute(3, false, "mode", role.getMode().toString());

       json.beginCollection(3, true, "rules");
       for (Entry<String, Byte> rule : role.getRules().entrySet()) {
         json.beginObject(4);
         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));
View Full Code Here

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

     json.beginObject(1, true, "config");

     json.beginCollection(2, true, "values");
     json.writeObjects(3, true, null, new Object[] { "name", "dateFormat", "value", db.getStorage().getConfiguration().dateFormat },
         new Object[] { "name", "dateTimeFormat", "value", db.getStorage().getConfiguration().dateTimeFormat }, new Object[] {
             "name", "localeCountry", "value", db.getStorage().getConfiguration().getLocaleCountry() }, new Object[] { "name",
View Full Code Here

     json.beginCollection(2, true, "properties");
     if (db.getStorage().getConfiguration().properties != null)
       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);
         }
       }
View Full Code Here

    try {
      final StringWriter buffer = new StringWriter(INITIAL_SIZE);
      final OJSONWriter json = new OJSONWriter(buffer, iFormat);
      final FormatSettings settings = new FormatSettings(iFormat);

      json.beginObject();
      OJSONFetchContext context = new OJSONFetchContext(json, settings);
      context.writeSignature(json, iRecord);

      if (iRecord instanceof ODocument) {
View Full Code Here

     iRequest.data.commandInfo = "Server status";

     try {
       final StringWriter jsonBuffer = new StringWriter();
       final OJSONWriter json = new OJSONWriter(jsonBuffer);
       json.beginObject();

       final String databaseName = args.length > 1 && args[1].length() > 0 ? args[1] : null;

       writeConnections(json, databaseName);
View Full Code Here

     iRequest.data.commandInfo = "Server status";

     try {
       final StringWriter jsonBuffer = new StringWriter();
       final OJSONWriter json = new OJSONWriter(jsonBuffer);
       json.beginObject();

       writeConnections(json, null);
       writeDatabases(json);
       writeStorages(json);
       writeProperties(json);
View Full Code Here

       } else
         db = getProfiledDatabaseInstance(iRequest);

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

       json.beginObject("server");
       json.writeAttribute("version", OConstants.ORIENT_VERSION);
       if (OConstants.getBuildNumber() != null)
         json.writeAttribute("build", OConstants.getBuildNumber());
View Full Code Here

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

       json.beginObject("server");
       json.writeAttribute("version", OConstants.ORIENT_VERSION);
       if (OConstants.getBuildNumber() != null)
         json.writeAttribute("build", OConstants.getBuildNumber());
       json.writeAttribute("osName", System.getProperty("os.name"));
       json.writeAttribute("osVersion", System.getProperty("os.version"));
View Full Code Here

           }

           try {
             final String conflictStrategy = cluster.getRecordConflictStrategy() != null ? cluster.getRecordConflictStrategy().getName() : null;

             json.beginObject();
             json.writeAttribute("id", cluster.getId());
             json.writeAttribute("name", clusterName);
             json.writeAttribute("records", cluster.getEntries() - cluster.getTombstonesCount());
             json.writeAttribute("conflictStrategy", conflictStrategy);
             json.writeAttribute("size", "-");
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.