Examples of DetailedInfo


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

      {
         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

                  "/" + backupId;

    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  RuntimeException("Can not get DetailedInfo from responce.", e);
      }
     
      if (info.getType() == DetailedInfo.COMPLETED) {
        String result = "\nThe completed (ready to restore) backup information : \n";
     
        BackupConfigBean configBean = info.getBackupConfig();
       
        result  += ("\t\tbackup id               : " + info.getBackupId() + "\n"
                  + "\t\tbackup folder           : " + configBean.getBackupDir() + "\n"
                  + "\t\trepository name         : " + info.getRepositoryName() + "\n"
                  + "\t\tworkspace name          : " + info.getWorkspaceName() + "\n"
                  + "\t\tbackup type             : " + (configBean.getBackupType() == BackupManager.FULL_AND_INCREMENTAL ? "full + incremetal" : "full only") + "\n"
                  + "\t\tstarted time            : " + info.getStartedTime() + "\n"
                  + (info.getFinishedTime().equals("") ? "\n" :
                    "\t\tfinished time           : " + info.getFinishedTime() + "\n\n"));
       
        return result;
      } else {
        String result = "\nThe current backup information : \n";
       
        BackupConfigBean configBean = info.getBackupConfig();
       
        result  += ("\t\tbackup id                : " + info.getBackupId() + "\n"
                  + "\t\tbackup folder            : " + configBean.getBackupDir() + "\n"
                  + "\t\trepository name          : " + info.getRepositoryName() + "\n"
                  + "\t\tworkspace name           : " + info.getWorkspaceName() + "\n"
                  + "\t\tbackup type              : " + (configBean.getBackupType() == BackupManager.FULL_AND_INCREMENTAL ? "full + incremetal" : "full only") + "\n"
                  + "\t\tfull backup state        : " + getState(info.getState())) + "\n"
                  + (info.getBackupType() == BackupManager.FULL_BACKUP_ONLY ? "" :
                    "\t\tincremental backup state : " "working" + "\n")
                  + "\t\tstarted time             : " + info.getStartedTime() + "\n"
                  + (info.getFinishedTime().equals("") ? "\n" :
                    "\t\tfinished time            : " + info.getFinishedTime() + "\n\n");
       
        return result;
      }
    } else {
      return failureProcessing(response);
View Full Code Here

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

                  "/" + repositoryName +
                  "/" + 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  RuntimeException("Can not get DetailedInfo from responce.", e);
      }
     
     
      String result = "\nThe current restores information : \n";
     
        result += "\tRestore with id " + info.getBackupId()  + ":\n";
       
        BackupConfigBean configBean = info.getBackupConfig();
       
        result  += ("\t\tbackup folder           : " + configBean.getBackupDir() + "\n"
                  + "\t\trepository name         : " + info.getRepositoryName() + "\n"
                  + "\t\tworkspace name          : " + info.getWorkspaceName() + "\n"
                  + "\t\tbackup type             : " + (configBean.getBackupType() == BackupManager.FULL_AND_INCREMENTAL ? "full + incremetal" : "full only") + "\n"
                  + "\t\trestore state           : " +  getRestoreState(info.getState()) + "\n"
                  + "\t\tstarted time            : " + info.getStartedTime() + "\n"
                  + (info.getFinishedTime().equals("") ? "\n" :
                    "\t\tfinished time           : " + info.getFinishedTime() + "\n\n"));
       
        return result;
    } else {
      return failureProcessing(response);
    }
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

         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());
         assertNotNull(info.getBackupConfig());

         assertNotNull(repositoryService.getRepository("db6"));
         Session sessin_ws = repositoryService.getRepository("db6").login(credentials, "ws");
         assertNotNull(sessin_ws);
         assertNotNull(sessin_ws.getRootNode());
View Full Code Here

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("db6backup", info.getRepositoryName());
         assertNotNull(info.getBackupConfig());

         assertNotNull(repositoryService.getRepository("db6backup"));
         Session sessin_ws = repositoryService.getRepository("db6backup").login(credentials, "ws");
         assertNotNull(sessin_ws);
         assertNotNull(sessin_ws.getRootNode());
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.