Examples of JsonGeneratorImpl


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

      }

      // Restore
      {
         // Create JSON to WorkspaceEntry
         JsonGeneratorImpl generatorImpl = new JsonGeneratorImpl();
         JsonValue json = generatorImpl.createJsonObject(wEntry);

         // Execute restore
         MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
         headers.putSingle("Content-Type", "application/json; charset=UTF-8");
         ContainerRequestUserRole creq =
View Full Code Here

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

      }

      // Restore
      {
         // Create JSON to WorkspaceEntry
         JsonGeneratorImpl generatorImpl = new JsonGeneratorImpl();
         JsonValue json = generatorImpl.createJsonObject(rEntry);

         // Execute restore
         MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
         headers.putSingle("Content-Type", "application/json; charset=UTF-8");
         ContainerRequestUserRole creq =
View Full Code Here

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

      }

      // Restore
      {
         // Create JSON to WorkspaceEntry
         JsonGeneratorImpl generatorImpl = new JsonGeneratorImpl();
         JsonValue json = generatorImpl.createJsonObject(rEntry);

         // Execute restore
         MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
         headers.putSingle("Content-Type", "application/json; charset=UTF-8");
         ContainerRequestUserRole creq =
View Full Code Here

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

      }

      // Restore
      {
         // Create JSON to WorkspaceEntry
         JsonGeneratorImpl generatorImpl = new JsonGeneratorImpl();
         JsonValue json = generatorImpl.createJsonObject(rEntry);

         // Execute restore
         MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
         headers.putSingle("Content-Type", "application/json; charset=UTF-8");
         ContainerRequestUserRole creq =
View Full Code Here

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

      }

      // Restore
      {
         // Create JSON to WorkspaceEntry
         JsonGeneratorImpl generatorImpl = new JsonGeneratorImpl();
         JsonValue json = generatorImpl.createJsonObject(rEntry);

         // Execute restore
         MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
         headers.putSingle("Content-Type", "application/json; charset=UTF-8");
         ContainerRequestUserRole creq =
View Full Code Here

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

      }

      // Restore
      {
         // Create JSON to WorkspaceEntry
         JsonGeneratorImpl generatorImpl = new JsonGeneratorImpl();
         JsonValue json = generatorImpl.createJsonObject(rEntry);

         // Execute restore
         MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
         headers.putSingle("Content-Type", "application/json; charset=UTF-8");
         ContainerRequestUserRole creq =
View Full Code Here

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

                  path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackupAgent.Constants.OperationType.START_BACKUP
                           + "/" + repositoryName + "/" + 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());

         if (response.getStatus() == Response.Status.OK.getStatusCode())
         {
            return "\nSuccessful : \n" + "\tstatus code = " + response.getStatus() + "\n";
         }
         else
         {
            return failureProcessing(response);
         }
      }
      else
      {
         String sURL =
                  path + HTTPBackupAgent.Constants.BASE_URL
                           + HTTPBackupAgent.Constants.OperationType.START_BACKUP_REPOSITORY + "/" + repositoryName;

         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);
         }
View Full Code Here

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

                  path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackupAgent.Constants.OperationType.START_BACKUP
                           + "/" + repositoryName + "/" + workspaceName;

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

         if (response.getStatus() == Response.Status.OK.getStatusCode())
         {
            return "\nSuccessful : \n" + "\tstatus code = " + response.getStatus() + "\n";
         }
         else
         {
            return failureProcessing(response);
         }
      }
      else
      {
         String sURL =
                  path + HTTPBackupAgent.Constants.BASE_URL
                           + HTTPBackupAgent.Constants.OperationType.START_BACKUP_REPOSITORY + "/" + repositoryName;

         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);
         }
View Full Code Here

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

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

            response = transport.executePOST(sURL, json.toString());
         }
      }
      else if (repositoryName != null)
      {
         if (config != null)
         {
            if (backupId != null)
            {
               sURL =
                        path + HTTPBackupAgent.Constants.BASE_URL
                                 + HTTPBackupAgent.Constants.OperationType.RESTORE_REPOSITORY + "/" + backupId + "/"
                                 + removeExists;
            }
            else if (backupSetPath != null)
            {
               sURL =
                        path + HTTPBackupAgent.Constants.BASE_URL
                                 + HTTPBackupAgent.Constants.OperationType.RESTORE_REPOSITORY_BACKUP_SET + "/"
                                 + removeExists + "?backup-set-path=" + backupSetPathEncoded;
            }
  
            RepositoryEntry wEntry = null;
            try
            {
               wEntry = getRepositoryEntry(config, repositoryName);
            }
            catch (Throwable e)
            {
               throw new BackupExecuteException("Can not get RepositoryEntry for repository '" + repositoryName
                        + "' 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);
            }
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
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.