Examples of ShortInfo


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

         validateWorkspaceName(repository, workspace);
         validateOneBackupInstants(repository, workspace);

         BackupChain chain = backupManager.startBackup(config);

         ShortInfo shortInfo = new ShortInfo(ShortInfo.CURRENT, chain);

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

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

         validateRepositoryName(repository);

         RepositoryBackupChain chain = backupManager.startBackup(config);

         ShortInfo shortInfo = new ShortInfo(ShortInfo.CURRENT, chain);

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

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

            }
         }

         if (restore != null)
         {
            ShortInfo info =
               new ShortInfo(ShortInfo.RESTORE, restore.getBackupChainLog(), restore.getStartTime(), restore
                  .getEndTime(), restore.getStateRestore(), restore.getRepositoryName(), restore.getWorkspaceName());
            return Response.ok(info).cacheControl(noCache).build();
         }

         return Response.ok().cacheControl(noCache).build();
View Full Code Here

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

            }
         }

         if (restore != null)
         {
            ShortInfo info =
                     new ShortInfo(ShortInfo.RESTORE, restore.getBackupChainLog(), restore.getStartTime(), restore
                              .getEndTime(), restore.getStateRestore(), restore.getRepositoryName(), restore
                              .getWorkspaceName());
            return Response.ok(info).cacheControl(noCache).build();
         }
View Full Code Here

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

            }
         }

         if (restore != null)
         {
            ShortInfo info =
                     new ShortInfo(ShortInfo.RESTORE, restore.getBackupChainLog(), restore.getStartTime(), restore
                              .getEndTime(), restore.getStateRestore(), restore.getRepositoryName(), restore
                              .getWorkspaceName());
            return Response.ok(info).cacheControl(noCache).build();
         }
View Full Code Here

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

            }
         }

         if (restore != null)
         {
            ShortInfo info =
                     new ShortInfo(ShortInfo.RESTORE, restore.getBackupChainLog(), restore.getStartTime(), restore
                              .getEndTime(), restore.getStateRestore(), restore.getRepositoryName(), restore
                              .getWorkspaceName());
            return Response.ok(info).cacheControl(noCache).build();
         }
View Full Code Here

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

               }
            }

            if (restore != null)
            {
               ShortInfo info =
                        new ShortInfo(ShortInfo.RESTORE, restore.getBackupChainLog(), restore.getStartTime(), restore
                                 .getEndTime(), restore.getStateRestore(), restore.getRepositoryName(), restore
                                 .getWorkspaceName());
               return Response.ok(info).cacheControl(noCache).build();
            }

            return Response.ok().cacheControl(noCache).build();
         }
         catch (WorkspaceRestoreExeption e)
         {
            exception = e;
            status = Response.Status.FORBIDDEN;
            failMessage = e.getMessage();
         }
         catch (RepositoryException e)
         {
            exception = e;
            status = Response.Status.NOT_FOUND;
            failMessage = e.getMessage();
         }
         catch (RepositoryConfigurationException e)
         {
            exception = e;
            status = Response.Status.NOT_FOUND;
            failMessage = e.getMessage();
         }
         catch (BackupLogNotFoundException e)
         {
            exception = e;
            status = Response.Status.NOT_FOUND;
            failMessage = e.getMessage();
         }
         catch (Throwable e)
         {
            exception = e;
            status = Response.Status.INTERNAL_SERVER_ERROR;
            failMessage = e.getMessage();
         }

         LOG.error("Can not start restore the workspace '" + "/" + repository + "/" + workspace
                  + "' from backup set \"" + backupSetPath + "\"", exception);

         return Response.status(status).entity(
                  "Can not start restore the workspace '" + "/" + repository + "/" + workspace + "' from backup set \""
                           + backupSetPath + "\" : " + failMessage).type(MediaType.TEXT_PLAIN).cacheControl(noCache)
                  .build();
      }
      else
      {
         String repository = null;

         try
         {

            RepositoryBackupChainLog backupChainLog = new RepositoryBackupChainLog(backuplog);
            repository = backupChainLog.getBackupConfig().getRepository();

            validateOneRepositoryRestoreInstants(repository);

            if (removeExisting)
            {
               if (!isRepositoryExist(repository))
               {
                  throw new RepositoryRestoreExeption("Repository " + repository + " is not exists!");
               }

               backupManager.restoreExistingRepository(backupSetDir, true);
            }
            else
            {
               if (isRepositoryExist(repository))
               {
                  throw new RepositoryRestoreExeption("Repository " + repository + " already exists!");
               }

               backupManager.restoreRepository(backupSetDir, true);
            }

            // Sleeping. Restore should be initialized by job thread
            Thread.sleep(100);

            // search necessary restore
            JobRepositoryRestore restore = backupManager.getLastRepositoryRestore(repository);
            ShortInfo info =
                     new ShortInfo(ShortInfo.RESTORE, restore.getRepositoryBackupChainLog(), restore.getStartTime(),
                              restore.getEndTime(), restore.getStateRestore(), restore.getRepositoryName());

            return Response.ok(info).cacheControl(noCache).build();
         }
         catch (RepositoryRestoreExeption e)
View Full Code Here

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

         // Sleeping. Restore should be initialized by job thread
         Thread.sleep(100);

         // search necessary restore
         JobRepositoryRestore restore = backupManager.getLastRepositoryRestore(rEntry.getName());
         ShortInfo info =
            new ShortInfo(ShortInfo.RESTORE, restore.getRepositoryBackupChainLog(), restore.getStartTime(), restore
               .getEndTime(), restore.getStateRestore(), restore.getRepositoryName());

         return Response.ok(info).cacheControl(noCache).build();
      }
      catch (RepositoryRestoreExeption e)
View Full Code Here

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

         // Sleeping. Restore should be initialized by job thread
         Thread.sleep(100);

         // search necessary restore
         JobRepositoryRestore restore = backupManager.getLastRepositoryRestore(rEntry.getName());
         ShortInfo info =
                  new ShortInfo(ShortInfo.RESTORE, restore.getRepositoryBackupChainLog(), restore.getStartTime(),
                           restore.getEndTime(), restore.getStateRestore(), restore.getRepositoryName());

         return Response.ok(info).cacheControl(noCache).build();
      }
      catch (RepositoryRestoreExeption e)
View Full Code Here

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

         // Sleeping. Restore should be initialized by job thread
         Thread.sleep(100);

         // search necessary restore
         JobRepositoryRestore restore = backupManager.getLastRepositoryRestore(rEntry.getName());
         ShortInfo info =
                  new ShortInfo(ShortInfo.RESTORE, restore.getRepositoryBackupChainLog(), restore.getStartTime(),
                           restore.getEndTime(), restore.getStateRestore(), restore.getRepositoryName());

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