Examples of JsonGeneratorImpl


Examples of org.exoplatform.ws.frameworks.json.impl.JsonGeneratorImpl

      {
         if (Tools.forName(
            workspacesMapping.get(repositoryEntry.getWorkspaceEntries().get(0).getName()).getFullBackupType(), this)
            .equals(org.exoplatform.services.jcr.ext.backup.impl.rdbms.FullBackupJob.class))
         {
            String newConf = new JsonGeneratorImpl().createJsonObject(repositoryEntry).toString();
            String currnetConf =
               new JsonGeneratorImpl().createJsonObject(
                  repoService.getRepository(repositoryEntry.getName()).getConfiguration()).toString();

            isSameConfigRestore = newConf.equals(currnetConf);
         }
      }
View Full Code Here

Examples of org.exoplatform.ws.frameworks.json.impl.JsonGeneratorImpl

                  currentWsEntry = wsEntry;
                  break;
               }
            }

            String newConf = new JsonGeneratorImpl().createJsonObject(workspaceEntry).toString();
            String currnetConf = new JsonGeneratorImpl().createJsonObject(currentWsEntry).toString();

            isSameConfigRestore = newConf.equals(currnetConf);
         }
      }
      catch (JsonException e)
View Full Code Here

Examples of org.exoplatform.ws.frameworks.json.impl.JsonGeneratorImpl

            // Don't do any transformation if object is prepared JsonValue.
            jsonValue = (JsonValue)t;
         }
         else
         {
            JsonGeneratorImpl generator = new JsonGeneratorImpl();
            Types jtype = JsonUtils.getType(type);
            if (jtype == Types.ARRAY_BOOLEAN || jtype == Types.ARRAY_BYTE || jtype == Types.ARRAY_SHORT
               || jtype == Types.ARRAY_INT || jtype == Types.ARRAY_LONG || jtype == Types.ARRAY_FLOAT
               || jtype == Types.ARRAY_DOUBLE || jtype == Types.ARRAY_CHAR || jtype == Types.ARRAY_STRING
               || jtype == Types.ARRAY_OBJECT)
            {
               jsonValue = generator.createJsonArray(t);
            }
            else if (jtype == Types.COLLECTION)
            {
               jsonValue = generator.createJsonArray((Collection<?>)t);
            }
            else if (jtype == Types.MAP)
            {
               jsonValue = generator.createJsonObjectFromMap((Map<String, ?>)t);
            }
            else
            {
               jsonValue = generator.createJsonObject(t);
            }
         }
         JsonWriterImpl jsonWriter = new JsonWriterImpl(entityStream);
         jsonValue.writeTo(jsonWriter);
         jsonWriter.flush();
View Full Code Here

Examples of org.exoplatform.ws.frameworks.json.impl.JsonGeneratorImpl

      if (rpcService != null)
      {
         String stringRepositoryEntry = null;
         try
         {
            JsonGeneratorImpl generatorImpl = new JsonGeneratorImpl();
            JsonValue json = generatorImpl.createJsonObject(rEntry);
            stringRepositoryEntry = json.toString();
         }
         catch (JsonException e)
         {
            throw new RepositoryCreationException("Can not serialize repository entry: " + e.getMessage(), e);
View Full Code Here

Examples of org.exoplatform.ws.frameworks.json.impl.JsonGeneratorImpl

      {
         if (Class.forName(
            workspacesMapping.get(repositoryEntry.getWorkspaceEntries().get(0).getName()).getFullBackupType()).equals(
            org.exoplatform.services.jcr.ext.backup.impl.rdbms.FullBackupJob.class))
         {
            String newConf = new JsonGeneratorImpl().createJsonObject(repositoryEntry).toString();
            String currnetConf =
               new JsonGeneratorImpl().createJsonObject(
                  repoService.getRepository(repositoryEntry.getName()).getConfiguration()).toString();

            isSameConfigRestore = newConf.equals(currnetConf);
         }
      }
View Full Code Here

Examples of org.exoplatform.ws.frameworks.json.impl.JsonGeneratorImpl

                  currentWsEntry = wsEntry;
                  break;
               }
            }

            String newConf = new JsonGeneratorImpl().createJsonObject(workspaceEntry).toString();
            String currnetConf = new JsonGeneratorImpl().createJsonObject(currentWsEntry).toString();

            isSameConfigRestore = newConf.equals(currnetConf);
         }
      }
      catch (JsonException e)
View Full Code Here

Examples of org.exoplatform.ws.frameworks.json.impl.JsonGeneratorImpl

                  "/" + workspaceName;

    BackupConfigBean bean = new BackupConfigBean(BackupManager.FULL_BACKUP_ONLY,
                                                 backupDir);
   
    JsonGeneratorImpl generatorImpl = new JsonGeneratorImpl();
    JsonValue json;
    try {
      json = generatorImpl.createJsonObject(bean);
    } catch (JsonException e) {
      throw new BackupExecuteException("Can not get json from  : " + bean.getClass().toString(), e);
    }
       
    BackupAgentResponse response  = transport.executePOST(sURL, json.toString());
View Full Code Here

Examples of org.exoplatform.ws.frameworks.json.impl.JsonGeneratorImpl

    BackupConfigBean bean = new BackupConfigBean(BackupManager.FULL_AND_INCREMENTAL,
                                                 backupDir,
                                                 incr);
   
    JsonGeneratorImpl generatorImpl = new JsonGeneratorImpl();
    JsonValue json;
    try {
      json = generatorImpl.createJsonObject(bean);
    } catch (JsonException e) {
      throw new BackupExecuteException("Can not get json from  : " + bean.getClass().toString(), e);
    }
       
    BackupAgentResponse response  = transport.executePOST(sURL, json.toString());
View Full Code Here

Examples of org.exoplatform.ws.frameworks.json.impl.JsonGeneratorImpl

      wEntry = getWorkspaceEntry(config, repositoryName, workspaceName);
    } catch (Throwable e) {
     throw new BackupExecuteException("Can not get WorkspaceEntry for workspace '" + workspaceName + "' from config.", e);
    }
   
    JsonGeneratorImpl generatorImpl = new JsonGeneratorImpl();
    JsonValue json;
   
    try {
      json = generatorImpl.createJsonObject(wEntry);
    } catch (JsonException e) {
      throw new BackupExecuteException("Can not get json from  : " + wEntry.getClass().toString(), e);
    }
       
    BackupAgentResponse response  = transport.executePOST(sURL, json.toString());
View Full Code Here

Examples of org.exoplatform.ws.frameworks.json.impl.JsonGeneratorImpl

            // Don't do any transformation if object is prepared JsonValue.
            jsonValue = (JsonValue)t;
         }
         else
         {
            JsonGeneratorImpl generator = new JsonGeneratorImpl();
            Types jtype = JsonUtils.getType(type);
            if (jtype == Types.ARRAY_BOOLEAN || jtype == Types.ARRAY_BYTE || jtype == Types.ARRAY_SHORT
               || jtype == Types.ARRAY_INT || jtype == Types.ARRAY_LONG || jtype == Types.ARRAY_FLOAT
               || jtype == Types.ARRAY_DOUBLE || jtype == Types.ARRAY_CHAR || jtype == Types.ARRAY_STRING
               || jtype == Types.ARRAY_OBJECT)
            {
               jsonValue = generator.createJsonArray(t);
            }
            else if (jtype == Types.COLLECTION)
            {
               jsonValue = generator.createJsonArray((Collection<?>)t);
            }
            else if (jtype == Types.MAP)
            {
               jsonValue = generator.createJsonObjectFromMap((Map<String, ?>)t);
            }
            else
            {
               jsonValue = generator.createJsonObject(t);
            }
         }
         JsonWriterImpl jsonWriter = new JsonWriterImpl(entityStream);
         jsonValue.writeTo(jsonWriter);
         jsonWriter.flush();
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.