Examples of DetailedInfo


Examples of org.exoplatform.services.jcr.ext.backup.server.bean.response.DetailedInfo

         ContainerResponse cres = new ContainerResponse(responseWriter);
         handler.handleRequest(creq, cres);

         assertEquals(200, cres.getStatus());

         DetailedInfo info = (DetailedInfo) getObject(DetailedInfo.class, responseWriter.getBody());

         assertNotNull(info);
         assertEquals(BackupManager.FULL_AND_INCREMENTAL, info.getBackupType().intValue());
         assertNotNull(info.getStartedTime());
         assertNotNull(info.getFinishedTime());
         assertEquals(ShortInfo.RESTORE, info.getType().intValue());
         assertEquals(JobWorkspaceRestore.RESTORE_SUCCESSFUL, info.getState().intValue());
         assertEquals("db6", info.getRepositoryName());
         assertEquals("ws3", info.getWorkspaceName());
         assertNotNull(info.getBackupConfig());

         Session sessin_ws3 = repositoryService.getRepository("db6").login(credentials, "ws3");
         assertNotNull(sessin_ws3);
         assertNotNull(sessin_ws3.getRootNode());
      }
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.server.bean.response.DetailedInfo

         response = transport.executeGET(sURL);
      }

      if (response.getStatus() == Response.Status.OK.getStatusCode())
      {
         DetailedInfo info;
         try
         {
            info = (DetailedInfo) getObject(DetailedInfo.class, response.getResponseData());
         }
         catch (Exception e)
         {
            throw new IllegalStateException("Can not get DetailedInfo from responce.", e);
         }

         if (info.getType() == DetailedInfo.COMPLETED)
         {
            StringBuilder result = new StringBuilder("\nThe completed (ready to restore) backup information : \n");

            BackupConfigBean configBean = info.getBackupConfig();

            result.append("\t\tbackup id               : ").append(info.getBackupId()).append("\n");
            result.append("\t\tbackup folder           : ").append(configBean.getBackupDir()).append("\n");
            result.append("\t\trepository name         : ").append(info.getRepositoryName()).append("\n");
            result.append(info.getWorkspaceName().equals("") ? "" : "\t\tworkspace name          : "
               + info.getWorkspaceName() + "\n");
            result.append("\t\tbackup type             : ");
            result.append(configBean.getBackupType() == BackupManager.FULL_AND_INCREMENTAL ? "full + incremental"
               : "full only");
            result.append("\n");
            result.append("\t\tstarted time            : ").append(info.getStartedTime()).append("\n");
            result.append(info.getFinishedTime().equals("") ? "\n" : "\t\tfinished time           : "
               + info.getFinishedTime() + "\n\n");

            return result.toString();
         }
         else
         {
            StringBuilder result = new StringBuilder("\nThe current backup information : \n");
            BackupConfigBean configBean = info.getBackupConfig();

            result.append("\t\tbackup id                : ").append(info.getBackupId()).append("\n");
            result.append("\t\tbackup folder            : ").append(configBean.getBackupDir()).append("\n");
            result.append("\t\trepository name          : ").append(info.getRepositoryName()).append("\n");
            result.append(info.getWorkspaceName().equals("") ? "" : "\t\tworkspace name           : "
               + info.getWorkspaceName() + "\n");
            result.append("\t\tbackup type              : ");
            result.append(configBean.getBackupType() == BackupManager.FULL_AND_INCREMENTAL ? "full + incremental"
               : "full only");
            result.append("\n");
            result.append("\t\tfull backup state        : ");
            result.append(info.getWorkspaceName().equals("") ? getRepositoryBackupToFullState(info.getState())
               : getState(info.getState()));
            result.append("\n");
            result.append(info.getBackupType() == BackupManager.FULL_BACKUP_ONLY ? ""
               : "\t\tincremental backup state : " + "working" + "\n");
            result.append("\t\tstarted time             : ").append(info.getStartedTime()).append("\n");
            result.append(info.getFinishedTime().equals("") ? "\n" : "\t\tfinished time            : "
               + info.getFinishedTime() + "\n\n");
           
            return result.toString();
         }
      }
      else
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.server.bean.response.DetailedInfo

                           + "/" + workspaceName;
         BackupAgentResponse response = transport.executeGET(sURL);

         if (response.getStatus() == Response.Status.OK.getStatusCode())
         {
            DetailedInfo info;
            try
            {
               info = (DetailedInfo) getObject(DetailedInfo.class, response.getResponseData());
            }
            catch (Exception e)
            {
               throw new IllegalStateException("Can not get DetailedInfo from responce.", e);
            }

            StringBuilder result = new StringBuilder("\nThe current restores information : \n");

            result.append("\tWorkspace restore with id ").append(info.getBackupId()).append(":\n");

            BackupConfigBean configBean = info.getBackupConfig();

            result.append("\t\tbackup folder           : ").append(configBean.getBackupDir()).append("\n");
            result.append("\t\trepository name         : ").append(info.getRepositoryName()).append("\n");
            result.append("\t\tworkspace name          : ").append(info.getWorkspaceName()).append("\n");
            result.append("\t\tbackup type             : ");
            result.append(
               configBean.getBackupType() == BackupManager.FULL_AND_INCREMENTAL ? "full + incremental" : "full only")
               .append("\n");
            result.append("\t\trestore state           : ").append(getRestoreState(info.getState())).append("\n");
            result.append("\t\tstarted time            : ").append(info.getStartedTime()).append("\n");
            result.append(info.getFinishedTime().equals("") ? "\n"
               : "\t\tfinished time           : " + info.getFinishedTime() + "\n\n");

            return result.toString();
         }
         else
         {
            return failureProcessing(response);
         }
      }
      else
      {
         String sURL =
                  path + HTTPBackupAgent.Constants.BASE_URL
                           + HTTPBackupAgent.Constants.OperationType.CURRENT_RESTORE_INFO_ON_REPOSITORY + "/"
                           + repositoryName;

         BackupAgentResponse response = transport.executeGET(sURL);

         if (response.getStatus() == Response.Status.OK.getStatusCode())
         {
            DetailedInfo info;
            try
            {
               info = (DetailedInfo) getObject(DetailedInfo.class, response.getResponseData());
            }
            catch (Exception e)
            {
               throw new IllegalStateException("Can not get DetailedInfo from responce.", e);
            }

            StringBuilder result = new StringBuilder("\nThe current restores information : \n");

            result.append("\tRepository restore with id ").append(info.getBackupId()).append(":\n");

            BackupConfigBean configBean = info.getBackupConfig();

            result.append("\t\tbackup folder           : ").append(configBean.getBackupDir()).append("\n");
            result.append("\t\trepository name         : ").append(info.getRepositoryName()).append("\n");
            result.append("\t\tbackup type             : ");
            result.append(
               configBean.getBackupType() == BackupManager.FULL_AND_INCREMENTAL ? "full + incremental" : "full only")
               .append("\n");
            result.append("\t\trestore state           : ").append(getRepositoryRestoreState(info.getState()))
               .append("\n");
            result.append("\t\tstarted time            : ").append(info.getStartedTime()).append("\n");
            result.append(info.getFinishedTime().equals("") ? "\n"
               : "\t\tfinished time           : " + info.getFinishedTime() + "\n\n");
           
            return result.toString();
         }
         else
         {
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.server.bean.response.DetailedInfo

      {
         BackupChain current = backupManager.findBackup(id);

         if (current != null)
         {
            DetailedInfo info = new DetailedInfo(DetailedInfo.CURRENT, current);
            return Response.ok(info).cacheControl(noCache).build();
         }

         BackupChainLog completed = null;

         for (BackupChainLog chainLog : backupManager.getBackupsLogs())
            if (id.equals(chainLog.getBackupId()))
               completed = chainLog;

         if (completed != null)
         {
            DetailedInfo info = new DetailedInfo(DetailedInfo.COMPLETED, completed);
            return Response.ok(info).cacheControl(noCache).build();
         }

         return Response.status(Response.Status.NOT_FOUND).entity("No current or completed backup with 'id' " + id)
            .type(MediaType.TEXT_PLAIN).cacheControl(noCache).build();
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.server.bean.response.DetailedInfo

      {
         RepositoryBackupChain current = backupManager.findRepositoryBackupId(id);

         if (current != null)
         {
            DetailedInfo info = new DetailedInfo(DetailedInfo.CURRENT, current);
            return Response.ok(info).cacheControl(noCache).build();
         }

         RepositoryBackupChainLog completed = null;

         for (RepositoryBackupChainLog chainLog : backupManager.getRepositoryBackupsLogs())
            if (id.equals(chainLog.getBackupId()))
               completed = chainLog;

         if (completed != null)
         {
            DetailedInfo info = new DetailedInfo(DetailedInfo.COMPLETED, completed);
            return Response.ok(info).cacheControl(noCache).build();
         }

         return Response.status(Response.Status.NOT_FOUND).entity(
            "No current or completed repository backup with 'id' " + id).type(MediaType.TEXT_PLAIN).cacheControl(
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.server.bean.response.DetailedInfo

         response = transport.executeGET(sURL);
      }

      if (response.getStatus() == Response.Status.OK.getStatusCode())
      {
         DetailedInfo info;
         try
         {
            info = (DetailedInfo) getObject(DetailedInfo.class, response.getResponseData());
         }
         catch (Exception e)
         {
            throw new IllegalStateException("Can not get DetailedInfo from responce.", e);
         }

         if (info.getType() == DetailedInfo.COMPLETED)
         {
            StringBuilder result = new StringBuilder("\nThe completed (ready to restore) backup information : \n");

            BackupConfigBean configBean = info.getBackupConfig();

            result.append("\t\tbackup id               : ").append(info.getBackupId()).append("\n");
            result.append("\t\tbackup folder           : ").append(configBean.getBackupDir()).append("\n");
            result.append("\t\trepository name         : ").append(info.getRepositoryName()).append("\n");
            result.append(info.getWorkspaceName().equals("") ? "" : "\t\tworkspace name          : "
               + info.getWorkspaceName() + "\n");
            result.append("\t\tbackup type             : ");
            result.append(configBean.getBackupType() == BackupManager.FULL_AND_INCREMENTAL ? "full + incremental"
               : "full only");
            result.append("\n");
            result.append("\t\tstarted time            : ").append(info.getStartedTime()).append("\n");
            result.append(info.getFinishedTime().equals("") ? "\n" : "\t\tfinished time           : "
               + info.getFinishedTime() + "\n\n");

            return result.toString();
         }
         else
         {
            StringBuilder result = new StringBuilder("\nThe current backup information : \n");
            BackupConfigBean configBean = info.getBackupConfig();

            result.append("\t\tbackup id                : ").append(info.getBackupId()).append("\n");
            result.append("\t\tbackup folder            : ").append(configBean.getBackupDir()).append("\n");
            result.append("\t\trepository name          : ").append(info.getRepositoryName()).append("\n");
            result.append(info.getWorkspaceName().equals("") ? "" : "\t\tworkspace name           : "
               + info.getWorkspaceName() + "\n");
            result.append("\t\tbackup type              : ");
            result.append(configBean.getBackupType() == BackupManager.FULL_AND_INCREMENTAL ? "full + incremental"
               : "full only");
            result.append("\n");
            result.append("\t\tfull backup state        : ");
            result.append(info.getWorkspaceName().equals("") ? getRepositoryBackupToFullState(info.getState())
               : getState(info.getState()));
            result.append("\n");
            result.append(info.getBackupType() == BackupManager.FULL_BACKUP_ONLY ? ""
               : "\t\tincremental backup state : " + "working" + "\n");
            result.append("\t\tstarted time             : ").append(info.getStartedTime()).append("\n");
            result.append(info.getFinishedTime().equals("") ? "\n" : "\t\tfinished time            : "
               + info.getFinishedTime() + "\n\n");
           
            return result.toString();
         }
      }
      else
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.server.bean.response.DetailedInfo

                           + "/" + workspaceName;
         BackupAgentResponse response = transport.executeGET(sURL);

         if (response.getStatus() == Response.Status.OK.getStatusCode())
         {
            DetailedInfo info;
            try
            {
               info = (DetailedInfo) getObject(DetailedInfo.class, response.getResponseData());
            }
            catch (Exception e)
            {
               throw new IllegalStateException("Can not get DetailedInfo from responce.", e);
            }

            StringBuilder result = new StringBuilder("\nThe current restores information : \n");

            result.append("\tWorkspace restore with id ").append(info.getBackupId()).append(":\n");

            BackupConfigBean configBean = info.getBackupConfig();

            result.append("\t\tbackup folder           : ").append(configBean.getBackupDir()).append("\n");
            result.append("\t\trepository name         : ").append(info.getRepositoryName()).append("\n");
            result.append("\t\tworkspace name          : ").append(info.getWorkspaceName()).append("\n");
            result.append("\t\tbackup type             : ");
            result.append(
               configBean.getBackupType() == BackupManager.FULL_AND_INCREMENTAL ? "full + incremental" : "full only")
               .append("\n");
            result.append("\t\trestore state           : ").append(getRestoreState(info.getState())).append("\n");
            result.append("\t\tstarted time            : ").append(info.getStartedTime()).append("\n");
            result.append(info.getFinishedTime().equals("") ? "\n"
               : "\t\tfinished time           : " + info.getFinishedTime() + "\n\n");

            return result.toString();
         }
         else
         {
            return failureProcessing(response);
         }
      }
      else
      {
         String sURL =
                  path + HTTPBackupAgent.Constants.BASE_URL
                           + HTTPBackupAgent.Constants.OperationType.CURRENT_RESTORE_INFO_ON_REPOSITORY + "/"
                           + repositoryName;

         BackupAgentResponse response = transport.executeGET(sURL);

         if (response.getStatus() == Response.Status.OK.getStatusCode())
         {
            DetailedInfo info;
            try
            {
               info = (DetailedInfo) getObject(DetailedInfo.class, response.getResponseData());
            }
            catch (Exception e)
            {
               throw new IllegalStateException("Can not get DetailedInfo from responce.", e);
            }

            StringBuilder result = new StringBuilder("\nThe current restores information : \n");

            result.append("\tRepository restore with id ").append(info.getBackupId()).append(":\n");

            BackupConfigBean configBean = info.getBackupConfig();

            result.append("\t\tbackup folder           : ").append(configBean.getBackupDir()).append("\n");
            result.append("\t\trepository name         : ").append(info.getRepositoryName()).append("\n");
            result.append("\t\tbackup type             : ");
            result.append(
               configBean.getBackupType() == BackupManager.FULL_AND_INCREMENTAL ? "full + incremental" : "full only")
               .append("\n");
            result.append("\t\trestore state           : ").append(getRepositoryRestoreState(info.getState()))
               .append("\n");
            result.append("\t\tstarted time            : ").append(info.getStartedTime()).append("\n");
            result.append(info.getFinishedTime().equals("") ? "\n"
               : "\t\tfinished time           : " + info.getFinishedTime() + "\n\n");
           
            return result.toString();
         }
         else
         {
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.server.bean.response.DetailedInfo

      {
         BackupChain current = backupManager.findBackup(id);

         if (current != null)
         {
            DetailedInfo info = new DetailedInfo(DetailedInfo.CURRENT, current);
            return Response.ok(info).cacheControl(noCache).build();
         }

         BackupChainLog completed = null;

         for (BackupChainLog chainLog : backupManager.getBackupsLogs())
            if (id.equals(chainLog.getBackupId()))
               completed = chainLog;

         if (completed != null)
         {
            DetailedInfo info = new DetailedInfo(DetailedInfo.COMPLETED, completed);
            return Response.ok(info).cacheControl(noCache).build();
         }

         return Response.status(Response.Status.NOT_FOUND).entity("No current or completed backup with 'id' " + id)
                  .type(MediaType.TEXT_PLAIN).cacheControl(noCache).build();
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.server.bean.response.DetailedInfo

      {
         BackupChain current = backupManager.findBackup(id);

         if (current != null)
         {
            DetailedInfo info = new DetailedInfo(DetailedInfo.CURRENT, current);
            return Response.ok(info).cacheControl(noCache).build();
         }

         BackupChainLog completed = null;

         for (BackupChainLog chainLog : backupManager.getBackupsLogs())
            if (id.equals(chainLog.getBackupId()))
               completed = chainLog;

         if (completed != null)
         {
            DetailedInfo info = new DetailedInfo(DetailedInfo.COMPLETED, completed);
            return Response.ok(info).cacheControl(noCache).build();
         }

         return Response.status(Response.Status.NOT_FOUND).entity("No current or completed backup with 'id' " + id)
            .type(MediaType.TEXT_PLAIN).cacheControl(noCache).build();
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.server.bean.response.DetailedInfo

      {
         RepositoryBackupChain current = backupManager.findRepositoryBackupId(id);

         if (current != null)
         {
            DetailedInfo info = new DetailedInfo(DetailedInfo.CURRENT, current);
            return Response.ok(info).cacheControl(noCache).build();
         }

         RepositoryBackupChainLog completed = null;

         for (RepositoryBackupChainLog chainLog : backupManager.getRepositoryBackupsLogs())
            if (id.equals(chainLog.getBackupId()))
               completed = chainLog;

         if (completed != null)
         {
            DetailedInfo info = new DetailedInfo(DetailedInfo.COMPLETED, completed);
            return Response.ok(info).cacheControl(noCache).build();
         }

         return Response.status(Response.Status.NOT_FOUND).entity(
            "No current or completed repository backup with 'id' " + id).type(MediaType.TEXT_PLAIN).cacheControl(
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.