Examples of RepositoryBackupChain


Examples of org.exoplatform.services.jcr.ext.backup.RepositoryBackupChain

   public RepositoryBackupChain findRepositoryBackup(String repository)
   {
      Iterator<RepositoryBackupChain> it = currentRepositoryBackups.iterator();
      while (it.hasNext())
      {
         RepositoryBackupChain chain = it.next();
         if (repository.equals(chain.getBackupConfig().getRepository()))
            return chain;
      }
      return null;
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.RepositoryBackupChain

   public RepositoryBackupChain findRepositoryBackupId(String backupId)
   {
      Iterator<RepositoryBackupChain> it = currentRepositoryBackups.iterator();
      while (it.hasNext())
      {
         RepositoryBackupChain chain = it.next();
         if (backupId.equals(chain.getBackupId()))
            return chain;
      }
      return null;
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.RepositoryBackupChain

      RepositoryBackupConfig config = new RepositoryBackupConfig();
      config.setRepository(repositoryName);
      config.setBackupType(BackupManager.FULL_BACKUP_ONLY);
      config.setBackupDir(backDir);

      RepositoryBackupChain bch = backupManagerImpl.startBackup(config);
     
      // wait till full backup will stop
      while (bch.getState() != BackupJob.FINISHED)
      {
         Thread.yield();
         Thread.sleep(30);
      }

      if (bch != null)
      {
         backupManagerImpl.stopBackup(bch);
      }
     
      TesterConfigurationHelper helper = TesterConfigurationHelper.getInstance();
      RepositoryEntry repositoryEntryIsolated = helper.copyRepositoryEntry(repositoryService.getRepository(repositoryName).getConfiguration());
     
      for (WorkspaceEntry we : repositoryEntryIsolated.getWorkspaceEntries())
      {
         List<SimpleParameterEntry> props = we.getContainer().getParameters();
        
         for (int i = 0; i < props.size(); i++)
         {
            SimpleParameterEntry spe = props.get(i);
           
            if (spe.getName().equals(JDBCWorkspaceDataContainer.DB_STRUCTURE_TYPE))
            {
              props.set(i, new SimpleParameterEntry(spe.getName(), DatabaseStructureType.ISOLATED.toString()));
              break;
            }
         }
      }
     
      // restore single backup on structure single to isolated
      {
         RepositoryEntry newRE = helper.copyRepositoryEntry(repositoryEntryIsolated);
  
         File backLog = new File(bch.getLogFilePath());
         assertTrue(backLog.exists());
         RepositoryBackupChainLog bchLog = new RepositoryBackupChainLog(backLog);
        
         backupManagerImpl.restoreExistingRepository(bchLog, newRE, false);
         checkConent(newRE.getName());
        
         String dbStructureType = repositoryService.getRepository(repositoryName).getConfiguration().getWorkspaceEntries().get(0).getContainer().getParameterValue(JDBCWorkspaceDataContainer.DB_STRUCTURE_TYPE);
         assertTrue(DatabaseStructureType.ISOLATED.toString().equalsIgnoreCase(dbStructureType));
      }
     
     
      // restore  single backup on structure isolated to isolated
      {
         RepositoryEntry newRE = helper.copyRepositoryEntry(repositoryEntryIsolated);
  
         File backLog = new File(bch.getLogFilePath());
         assertTrue(backLog.exists());
  
         RepositoryBackupChainLog bchLog = new RepositoryBackupChainLog(backLog);
  
         backupManagerImpl.restoreExistingRepository(bchLog, newRE, false);
         checkConent(newRE.getName());
        
         String dbStructureType = repositoryService.getRepository(repositoryName).getConfiguration().getWorkspaceEntries().get(0).getContainer().getParameterValue(JDBCWorkspaceDataContainer.DB_STRUCTURE_TYPE);
         assertTrue(DatabaseStructureType.ISOLATED.toString().equalsIgnoreCase(dbStructureType));
      }
     
      // revert the single structure in repository
      {
         File backLog = new File(bch.getLogFilePath());
         assertTrue(backLog.exists());
  
         RepositoryBackupChainLog bchLog = new RepositoryBackupChainLog(backLog);
  
         backupManagerImpl.restoreExistingRepository(bchLog.getBackupId(), false);
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.RepositoryBackupChain

      RepositoryBackupConfig config = new RepositoryBackupConfig();
      config.setRepository(repositoryName);
      config.setBackupType(BackupManager.FULL_BACKUP_ONLY);
      config.setBackupDir(backDir);

      RepositoryBackupChain bch = backupManagerImpl.startBackup(config);

      // wait till full backup will stop
      while (bch.getState() != BackupJob.FINISHED)
      {
         Thread.yield();
         Thread.sleep(30);
      }

      if (bch != null)
      {
         backupManagerImpl.stopBackup(bch);
      }

      // restore
      RepositoryBackupChainLog rblog = new RepositoryBackupChainLog(new File(bch.getLogFilePath()));

      Map<String, File> workspacesMapping = new HashMap<String, File>();
      Map<String, BackupChainLog> backups = new HashMap<String, BackupChainLog>();

      for (String path : rblog.getWorkspaceBackupsInfo())
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.RepositoryBackupChain

      RepositoryBackupConfig config = new RepositoryBackupConfig();
      config.setRepository(repositoryName);
      config.setBackupType(BackupManager.FULL_BACKUP_ONLY);
      config.setBackupDir(backDir);

      RepositoryBackupChain bch = backupManagerImpl.startBackup(config);

      // wait till full backup will stop
      while (bch.getState() != BackupJob.FINISHED)
      {
         Thread.yield();
         Thread.sleep(30);
      }

      if (bch != null)
      {
         backupManagerImpl.stopBackup(bch);
      }

      // restore
      RepositoryBackupChainLog rblog = new RepositoryBackupChainLog(new File(bch.getLogFilePath()));

      Map<String, File> workspacesMapping = new HashMap<String, File>();
      Map<String, BackupChainLog> backups = new HashMap<String, BackupChainLog>();

      for (String path : rblog.getWorkspaceBackupsInfo())
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.RepositoryBackupChain

      RepositoryBackupConfig config = new RepositoryBackupConfig();
      config.setRepository(repositoryName);
      config.setBackupType(BackupManager.FULL_BACKUP_ONLY);
      config.setBackupDir(backDir);

      RepositoryBackupChain bch = backupManagerImpl.startBackup(config);

      // wait till full backup will stop
      while (bch.getState() != BackupJob.FINISHED)
      {
         Thread.yield();
         Thread.sleep(30);
      }

      if (bch != null)
      {
         backupManagerImpl.stopBackup(bch);
      }

      // restore
      RepositoryBackupChainLog rblog = new RepositoryBackupChainLog(new File(bch.getLogFilePath()));

      // clean existing repository
      // list of components to clean
      List<Backupable> backupable = new ArrayList<Backupable>();
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.RepositoryBackupChain

      RepositoryBackupConfig config = new RepositoryBackupConfig();
      config.setRepository(repositoryName);
      config.setBackupType(BackupManager.FULL_BACKUP_ONLY);
      config.setBackupDir(backDir);

      RepositoryBackupChain bch = backupManagerImpl.startBackup(config);

      // wait end of backup
      while (bch.getState() != BackupJob.FINISHED)
      {
         Thread.yield();
         Thread.sleep(30);
      }
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.RepositoryBackupChain

         config.setIncrementalJobPeriod(bConfigBeen.getIncrementalJobPeriod());
         config.setIncrementalJobNumber(bConfigBeen.getIncrementalRepetitionNumber());

         validateRepositoryName(repository);

         RepositoryBackupChain chain = backupManager.startBackup(config);

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

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

Examples of org.exoplatform.services.jcr.ext.backup.RepositoryBackupChain

      Response.Status status;
      Throwable exception;

      try
      {
         RepositoryBackupChain bch = backupManager.findRepositoryBackupId(backupId);

         if (bch != null)
            backupManager.stopBackup(bch);
         else
            throw new BackupNotFoundException("No active repository backup with id '" + backupId + "'");
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.RepositoryBackupChain

   @Path("/info/backup-repository-id/{id}")
   public Response infoBackupRepositoryId(@PathParam("id") String id)
   {
      try
      {
         RepositoryBackupChain current = backupManager.findRepositoryBackupId(id);

         if (current != null)
         {
            DetailedInfo info = new DetailedInfo(DetailedInfo.CURRENT, current);
            return Response.ok(info).cacheControl(noCache).build();
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.