Package org.exoplatform.services.jcr.ext.backup.impl

Examples of org.exoplatform.services.jcr.ext.backup.impl.JobRepositoryRestore


      for (WorkspaceEntry wsEntry : rblog.getOriginalRepositoryEntry().getWorkspaceEntries())
      {
         workspacesMapping.put(wsEntry.getName(), new File(backups.get(wsEntry.getName()).getLogFilePath()));
      }

      JobRepositoryRestore job =
         new JobRepositoryRestore(repositoryService, backupManagerImpl, rblog.getOriginalRepositoryEntry(),
            workspacesMapping, new File(rblog.getLogFilePath()), false);

      job.run();
      assertEquals(JobRepositoryRestore.REPOSITORY_RESTORE_SUCCESSFUL, job.getStateRestore());

      checkConent(repositoryName);
   }
View Full Code Here


      assertNotNull(bchLog.getFinishedTime());

      backupManagerImpl.restoreExistingRepository(bchLog, repositoryService.getRepository(repositoryName)
         .getConfiguration(), false);

      JobRepositoryRestore restore = backupManagerImpl.getLastRepositoryRestore(repositoryName);
      if (restore != null)
      {
         if (restore.getStateRestore() != JobRepositoryRestore.REPOSITORY_RESTORE_SUCCESSFUL)
         {
            fail(restore.getRestoreException().getMessage());
         }
      }
   }
View Full Code Here

            // 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

         // 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

         // 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

         // 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

         // 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

   @Path("/info/restore-repository/{repo}")
   public Response infoRestoreRepository(@PathParam("repo") String repository)
   {
      try
      {
         JobRepositoryRestore restoreJob = backupManager.getLastRepositoryRestore(repository);

         if (restoreJob != null)
         {
            DetailedInfoEx info =
               new DetailedInfoEx(DetailedInfo.RESTORE, restoreJob.getRepositoryBackupChainLog(), restoreJob
                  .getStartTime(), restoreJob.getEndTime(), restoreJob.getStateRestore(), restoreJob
                  .getRepositoryName(),

               restoreJob.getRepositoryEntry(), restoreJob.getRestoreException() == null ? "" : restoreJob
                  .getRestoreException().getMessage());

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

         List<JobRepositoryRestore> jobs = new ArrayList<JobRepositoryRestore>();

         for (int i = restoreJobs.size() - 1; i >= 0; i--)
         {
            JobRepositoryRestore job = restoreJobs.get(i);
            boolean isUnique = true;
            for (JobRepositoryRestore unJob : jobs)
            {
               if (unJob.getRepositoryName().equals(job.getRepositoryName()))
                  isUnique = false;
            }

            if (isUnique)
               jobs.add(job);
         }

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

         for (JobRepositoryRestore job : jobs)
         {
            ShortInfo info =
               new ShortInfo(ShortInfo.RESTORE, job.getRepositoryBackupChainLog(), job.getStartTime(),
                  job.getEndTime(), job.getStateRestore(), job.getRepositoryName());
            list.add(info);
         }

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

TOP

Related Classes of org.exoplatform.services.jcr.ext.backup.impl.JobRepositoryRestore

Copyright © 2018 www.massapicom. 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.