Examples of ShortInfoList


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

  public String list() throws IOException, BackupExecuteException {
    String sURL = path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackupAgent.Constants.OperationType.CURRENT_BACKUPS_INFO;
    BackupAgentResponse response = transport.executeGET(sURL);
   
    if (response.getStatus() == Response.Status.OK.getStatusCode()) {
      ShortInfoList infoList;
      try {
        infoList = (ShortInfoList) getObject(ShortInfoList.class, response.getResponseData());
      } catch (Exception e) {
        throw new  RuntimeException("Can not get ShortInfoList from responce.", e);
      }
     
      String result = "\nThe current backups information : \n";
     
      if (infoList.getBackups().size() == 0)
        result += "\tNo active backups.\n\n";
     
      int count = 1;
      for (ShortInfo shortInfo : infoList.getBackups()) {
        result += "\t" + count + ") Backup with id " + shortInfo.getBackupId()  + " :\n";
       
        result  += ("\t\trepository name           : " + shortInfo.getRepositoryName() + "\n"
                  + "\t\tworkspace name            : " + shortInfo.getWorkspaceName() + "\n"
                  + "\t\tbackup type               : " + (shortInfo.getBackupType() == BackupManager.FULL_AND_INCREMENTAL ? "full + incremetal" : "full only") + "\n" 
View Full Code Here

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

  public String listCompleted() throws IOException, BackupExecuteException {
    String sURL = path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackupAgent.Constants.OperationType.COMPLETED_BACKUPS_INFO;
    BackupAgentResponse response = transport.executeGET(sURL);
   
    if (response.getStatus() == Response.Status.OK.getStatusCode()) {
      ShortInfoList infoList;
      try {
        infoList = (ShortInfoList) getObject(ShortInfoList.class, response.getResponseData());
        new String(response.getResponseData());
      } catch (Exception e) {e.printStackTrace();
        throw new  RuntimeException("Can not get ShortInfoList from responce.", e);
      }
     
      String result = "\nThe completed (ready to restore) backups information : \n";
     
      if (infoList.getBackups().size() == 0)
        result += "\tNo completed backups.\n\n";
     
      int count = 1;
      for (ShortInfo shortInfo : infoList.getBackups()) {
        result += "\t" + count + ") Backup with id " + shortInfo.getBackupId()  + " :\n";
       
        result  += ("\t\trepository name           : " + shortInfo.getRepositoryName() + "\n"
                  + "\t\tworkspace name            : " + shortInfo.getWorkspaceName() + "\n"
                  + "\t\tbackup type               : " + (shortInfo.getBackupType() == BackupManager.FULL_AND_INCREMENTAL ? "full + incremetal" : "full only") + "\n" 
View Full Code Here

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

         for (BackupChainLog chainLog : backupManager.getBackupsLogs())
            if (backupManager.findBackup(chainLog.getBackupId()) == null)
               list.add(new ShortInfo(ShortInfo.COMPLETED, chainLog));

         ShortInfoList shortInfoList = new ShortInfoList(list);

         return Response.ok(shortInfoList).cacheControl(noCache).build();
      }
      catch (Throwable e)
      {
View Full Code Here

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

         for (RepositoryBackupChainLog chainLog : backupManager.getRepositoryBackupsLogs())
            if (backupManager.findRepositoryBackupId(chainLog.getBackupId()) == null)
               list.add(new ShortInfo(ShortInfo.COMPLETED, chainLog));

         ShortInfoList shortInfoList = new ShortInfoList(list);

         return Response.ok(shortInfoList).cacheControl(noCache).build();
      }
      catch (Throwable e)
      {
View Full Code Here

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

         List<ShortInfo> list = new ArrayList<ShortInfo>();

         for (BackupChain chain : backupManager.getCurrentBackups())
            list.add(new ShortInfo(ShortInfo.CURRENT, chain));

         ShortInfoList shortInfoList = new ShortInfoList(list);

         return Response.ok(shortInfoList).cacheControl(noCache).build();
      }
      catch (Throwable e)
      {
View Full Code Here

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

         List<ShortInfo> list = new ArrayList<ShortInfo>();

         for (RepositoryBackupChain chain : backupManager.getCurrentRepositoryBackups())
            list.add(new ShortInfo(ShortInfo.CURRENT, chain));

         ShortInfoList shortInfoList = new ShortInfoList(list);

         return Response.ok(shortInfoList).cacheControl(noCache).build();
      }
      catch (Throwable e)
      {
View Full Code Here

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

         for (BackupChainLog chainLog : backupManager.getBackupsLogs())
            if (backupManager.findBackup(chainLog.getBackupId()) == null)
               completedList.add(new ShortInfo(ShortInfo.COMPLETED, chainLog));

         ShortInfoList list = new ShortInfoList(completedList);

         return Response.ok(list).cacheControl(noCache).build();
      }
      catch (Throwable e)
      {
View Full Code Here

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

         for (RepositoryBackupChainLog chainLog : backupManager.getRepositoryBackupsLogs())
            if (backupManager.findRepositoryBackupId(chainLog.getBackupId()) == null)
               completedList.add(new ShortInfo(ShortInfo.COMPLETED, chainLog));

         ShortInfoList list = new ShortInfoList(completedList);

         return Response.ok(list).cacheControl(noCache).build();
      }
      catch (Throwable e)
      {
View Full Code Here

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

            {
               list.add(new ShortInfo(ShortInfo.COMPLETED, chainLog));
            }
         }

         ShortInfoList shortInfoList = new ShortInfoList(list);

         return Response.ok(shortInfoList).cacheControl(noCache).build();
      }
      catch (Throwable e)
      {
View Full Code Here

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

            {
               list.add(new ShortInfo(ShortInfo.COMPLETED, chainLog));
            }
         }

         ShortInfoList shortInfoList = new ShortInfoList(list);

         return Response.ok(shortInfoList).cacheControl(noCache).build();
      }
      catch (Throwable 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.