Examples of BackupConfigurationException


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

      {
         this.fullBackup = (AbstractFullBackupJob)Tools.forName(fullBackupType, this).newInstance();
      }
      catch (Exception e)
      {
         throw new BackupConfigurationException("FullBackupType error, " + e, e);
      }
      fullBackup.init(repository, config.getWorkspace(), config, timeStamp);

      if (config.getBackupType() == BackupManager.FULL_AND_INCREMENTAL)
      {
         try
         {
            this.incrementalBackup = (AbstractIncrementalBackupJob)Tools.forName(incrementalBackupType, this).newInstance();
         }
         catch (Exception e)
         {
            throw new BackupConfigurationException("IncrementalBackupType error, " + e, e);
         }
         incrementalBackup.init(repository, config.getWorkspace(), config, timeStamp);

         periodConroller = new PeriodConroller(config.getIncrementalJobPeriod() * 1000); // sec --> ms
      }
View Full Code Here

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

            }
         }
      }
      else
      {
         throw new BackupConfigurationException("Workspace should exists " + workspaceName);
      }
   }
View Full Code Here

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

            }
         }
      }
      else
      {
         throw new BackupConfigurationException("Workspace \"" + workspaceName + "\" should not exists.");
      }
   }
View Full Code Here

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

    */
   private void validateBackupConfig(RepositoryBackupConfig config) throws BackupConfigurationException
   {
      if (config.getIncrementalJobPeriod() < 0)
      {
         throw new BackupConfigurationException("The parameter 'incremental job period' can not be negative.");
      }

      if (config.getIncrementalJobNumber() < 0)
      {
         throw new BackupConfigurationException("The parameter 'incremental job number' can not be negative.");
      }

      if (config.getIncrementalJobPeriod() == 0 && config.getBackupType() == BackupManager.FULL_AND_INCREMENTAL)
      {
         config.setIncrementalJobPeriod(defaultIncrementalJobPeriod);
View Full Code Here

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

   {
      // Checking repository exists.
      try
      {
         repoService.getRepository(repositoryEntry.getName());
         throw new BackupConfigurationException("Repository \"" + repositoryEntry.getName() + "\" is already exists.");
      }
      catch (RepositoryException e)
      {
         //OK. Repository with "repositoryEntry.getName" is not exists.
      }

      Map<String, BackupChainLog> workspacesMapping = new HashedMap();

      Map<String, BackupChainLog> backups = new HashedMap();

      if (workspaceNamesCorrespondMap == null)
      {
         for (String path : rblog.getWorkspaceBackupsInfo())
         {
            BackupChainLog bLog = new BackupChainLog(new File(path));
            backups.put(bLog.getBackupConfig().getWorkspace(), bLog);
         }

         if (!rblog.getSystemWorkspace().equals(repositoryEntry.getSystemWorkspaceName()))
         {
            throw new BackupConfigurationException(
               "The backup to system workspace is not system workspace in repository entry: "
                  + rblog.getSystemWorkspace() + " is not equal " + repositoryEntry.getSystemWorkspaceName());
         }

         if (backups.size() != repositoryEntry.getWorkspaceEntries().size())
         {
            throw new BackupConfigurationException(
               "The repository entry is contains more or less workspace entry than backups of workspace in "
                  + rblog.getLogFilePath());
         }

         for (WorkspaceEntry wsEntry : repositoryEntry.getWorkspaceEntries())
         {
            if (!backups.containsKey(wsEntry.getName()))
            {
               throw new BackupConfigurationException("The workspace '" + wsEntry.getName()
                  + "' is not found in backup " + rblog.getLogFilePath());
            }
            else
            {
               workspacesMapping.put(wsEntry.getName(), backups.get(wsEntry.getName()));
            }
         }
      }
      else
      {
         // Create map [new_ws_name : backupLog to that workspace].
         for (String path : rblog.getWorkspaceBackupsInfo())
         {
            BackupChainLog bLog = new BackupChainLog(new File(path));

            if (!workspaceNamesCorrespondMap.containsKey(bLog.getBackupConfig().getWorkspace()))
            {
               throw new BackupConfigurationException("Can not found coresptonding workspace name to workspace '"
                  + bLog.getBackupConfig().getWorkspace() + "' in  " + workspaceNamesCorrespondMap.keySet());
            }

            backups.put(workspaceNamesCorrespondMap.get(bLog.getBackupConfig().getWorkspace()), bLog);
         }

         // Checking system workspace.
         if (!repositoryEntry.getSystemWorkspaceName().equals(
            workspaceNamesCorrespondMap.get(rblog.getSystemWorkspace())))
         {
            throw new BackupConfigurationException(
               "The backup to system workspace is not system workspace in repository entry: "
                  + repositoryEntry.getSystemWorkspaceName() + " is not equal "
                  + workspaceNamesCorrespondMap.get(rblog.getSystemWorkspace()));
         }

         // Checking count of corresponding workspaces.
         if (workspaceNamesCorrespondMap.size() != repositoryEntry.getWorkspaceEntries().size())
         {
            throw new BackupConfigurationException(
               "The repository entry is contains more or less workspace entry than backups of workspace in "
                  + rblog.getLogFilePath());
         }

         for (WorkspaceEntry wsEntry : repositoryEntry.getWorkspaceEntries())
         {
            if (!workspaceNamesCorrespondMap.containsValue(wsEntry.getName()))
            {
               throw new BackupConfigurationException("The workspace '" + wsEntry.getName()
                  + "' is not found workspaceNamesCorrespondMap  : " + workspaceNamesCorrespondMap.values());
            }
            else if (!backups.containsKey(wsEntry.getName()))
            {
               throw new BackupConfigurationException("The workspace '" + wsEntry.getName()
                  + "' is not found in backup " + rblog.getLogFilePath());
            }
            else
            {
               workspacesMapping.put(wsEntry.getName(), backups.get(wsEntry.getName()));
View Full Code Here

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

         backups.put(bLog.getBackupConfig().getWorkspace(), bLog);
      }

      if (!rblog.getSystemWorkspace().equals(repositoryEntry.getSystemWorkspaceName()))
      {
         throw new BackupConfigurationException(
            "The backup to system workspace is not system workspace in repository entry: " + rblog.getSystemWorkspace()
               + " is not equal " + repositoryEntry.getSystemWorkspaceName());
      }

      if (backups.size() != repositoryEntry.getWorkspaceEntries().size())
      {
         throw new BackupConfigurationException(
            "The repository entry is contains more or less workspace entry than backups of workspace in "
               + rblog.getLogFilePath());
      }

      for (WorkspaceEntry wsEntry : repositoryEntry.getWorkspaceEntries())
      {
         if (!backups.containsKey(wsEntry.getName()))
         {
            throw new BackupConfigurationException("The workspace '" + wsEntry.getName() + "' is not found in backup "
               + rblog.getLogFilePath());
         }
         else
         {
            workspacesMapping.put(wsEntry.getName(), backups.get(wsEntry.getName()));
View Full Code Here

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

         }
      }

      if (backupChainLog == null)
      {
         throw new BackupConfigurationException("Can not found backup of repository with id \""
            + repositoryBackupIdentifier + "\"");
      }

      this.restoreExistingRepository(backupChainLog, repositoryEntry, asynchronous);
   }
View Full Code Here

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

         }
      }

      if (backupChainLog == null)
      {
         throw new BackupConfigurationException("Can not found backup of workspace with id \""
            + workspaceBackupIdentifier + "\"");
      }

      this.restoreExistingWorkspace(backupChainLog, repositoryName, workspaceEntry, asynchronous);
   }
View Full Code Here

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

         }
      }

      if (backupChainLog == null)
      {
         throw new BackupConfigurationException("Can not found backup of repository with id \""
            + repositoryBackupIdentifier + "\"");
      }

      this.restoreExistingRepository(backupChainLog, backupChainLog.getOriginalRepositoryEntry(), asynchronous);
View Full Code Here

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

         }
      }

      if (backupChainLog == null)
      {
         throw new BackupConfigurationException("Can not found backup of workspace with id \""
            + workspaceBackupIdentifier + "\"");
      }

      this.restoreExistingWorkspace(backupChainLog, backupChainLog.getBackupConfig().getRepository(), backupChainLog
         .getOriginalWorkspaceEntry(), asynchronous);
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.