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

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


      if (workspaceEntry.getQueryHandler() != null)
      {
         File srcDir = new File(workspaceEntry.getQueryHandler().getParameterValue(QueryHandlerParams.PARAM_INDEX_DIR));
         if (!PrivilegedFileHelper.exists(srcDir))
         {
            throw new BackupOperationException("Can't backup index. Directory " + srcDir.getName() + " doesn't exists");
         }
         else
         {
            File destDir = new File(getStorageURL().getFile(), INDEX_DIR);
            copyDirectory(srcDir, destDir);
         }

         if (repository.getConfiguration().getSystemWorkspaceName().equals(workspaceName))
         {
            srcDir =
               new File(PrivilegedFileHelper.getCanonicalPath(srcDir) + "_" + SystemSearchManager.INDEX_DIR_SUFFIX);
            if (!PrivilegedFileHelper.exists(srcDir))
            {
               throw new BackupOperationException("Can't backup system index. Directory " + srcDir.getName()
                  + " doesn't exists");
            }
            else
            {
               File destDir = new File(getStorageURL().getFile(), SYSTEM_INDEX_DIR);
View Full Code Here


         for (ValueStorageEntry valueStorage : workspaceEntry.getContainer().getValueStorages())
         {
            File srcDir = new File(valueStorage.getParameterValue(FileValueStorage.PATH));
            if (!PrivilegedFileHelper.exists(srcDir))
            {
               throw new BackupOperationException("Can't backup value storage. Directory " + srcDir.getName()
                  + " doesn't exists");
            }
            else
            {
               File destValuesDir = new File(getStorageURL().getFile(), VALUE_STORAGE_DIR);
View Full Code Here

      {
         repository = repositoryService.getConfig().getRepositoryConfiguration(config.getRepository());
      }
      catch (RepositoryConfigurationException e)
      {
         throw new BackupOperationException("Can not get repository \"" + config.getRepository() + "\"", e);
      }
     
      for (WorkspaceEntry workspaceEntry : repository.getWorkspaceEntries())
      {
         BackupConfig wsBackupConfig = new BackupConfig();
View Full Code Here

         {
            fullbackupType = systemBackupChainLog.getFullBackupType();
         }
         else
         {
            throw new BackupOperationException("Class  \"" + systemBackupChainLog.getFullBackupType()
                     + "\" is not support as full backup.");
         }
      }
      catch (ClassNotFoundException e)
      {
         throw new BackupOperationException("Class \"" + systemBackupChainLog.getFullBackupType() + "\" is not found.",
                  e);
      }

      WorkspaceInitializerEntry wiEntry = new WorkspaceInitializerEntry();
      if ((Class.forName(fullbackupType).equals(FullBackupJob.class)))
View Full Code Here

               {
                  fullRestore(list.get(i).getURL().getPath(), reposytoryName, workspaceName, workspaceEntry);
               }
               catch (FileNotFoundException e)
               {
                  throw new BackupOperationException("Restore of full backup file error " + e, e);
               }
               catch (IOException e)
               {
                  throw new BackupOperationException("Restore of full backup file I/O error " + e, e);
               }
            }
            else
            {
               // TODO do we not restoring same content few times, i.e. on STARTING, WAITIG, FINISHED
               // events which are logged in chan log one after another
               try
               {
                  incrementalRestore(list.get(i).getURL().getPath(), reposytoryName, workspaceName);
               }
               catch (FileNotFoundException e)
               {
                  throw new BackupOperationException("Restore of incremental backup file error " + e, e);
               }
               catch (IOException e)
               {
                  throw new BackupOperationException("Restore of incremental backup file I/O error " + e, e);
               }
               catch (ClassNotFoundException e)
               {
                  throw new BackupOperationException("Restore of incremental backup error " + e, e);
               }
            }
         }
      }
      else
View Full Code Here

         {
            fullbackupType = log.getFullBackupType();
         }
         else
         {
            throw new BackupOperationException("Class  \"" + log.getFullBackupType() + "\" is not support as full backup.");
        
      }
      catch (ClassNotFoundException e)
      {
         throw new BackupOperationException("Class \"" + log.getFullBackupType() + "\" is not found." , e);
      }

      // ws should not exists.
      if (!workspaceAlreadyExist(reposytoryName, workspaceName))
      {

         for (int i = 0; i < list.size(); i++)
         {
            if (i == 0)
            {
               try
               {
                  fullRestoreOverInitializer(list.get(i).getURL().getPath(), reposytoryName, workspaceEntry,
                           fullbackupType);
               }
               catch (FileNotFoundException e)
               {
                  throw new BackupOperationException("Restore of full backup file error " + e, e);
               }
               catch (IOException e)
               {
                  throw new BackupOperationException("Restore of full backup file I/O error " + e, e);
               }
               catch (ClassNotFoundException e)
               {
                  throw new BackupOperationException("Restore of full backup class load error " + e, e);
               }

               repoService.getConfig().retain(); // save configuration to persistence (file or persister)
            }
            else
            {
               // TODO do we not restoring same content few times, i.e. on STARTING, WAITIG, FINISHED
               // events which are logged in chan log one after another
               try
               {
                  incrementalRestore(list.get(i).getURL().getPath(), reposytoryName, workspaceName);
               }
               catch (FileNotFoundException e)
               {
                  throw new BackupOperationException("Restore of incremental backup file error " + e, e);
               }
               catch (IOException e)
               {
                  throw new BackupOperationException("Restore of incremental backup file I/O error " + e, e);
               }
               catch (ClassNotFoundException e)
               {
                  throw new BackupOperationException("Restore of incremental backup error " + e, e);
               }
            }
         }
      }
      else
View Full Code Here

         TransactionChangesLog normalizeChangesLog =
            getNormalizedChangesLog(e.getIdentifier(), e.getState(), changesLog);
         if (normalizeChangesLog != null)
            saveChangesLog(dataManager, normalizeChangesLog);
         else
            throw new BackupOperationException(
               "Collisions found during save of restore changes log, but caused item is not found by ID "
                  + e.getIdentifier() + ". " + e, e);
      }
      catch (JCRItemExistsException e)
      {
View Full Code Here

               {
                  fullRestore(list.get(i).getURL().getPath(), reposytoryName, workspaceName, workspaceEntry);
               }
               catch (FileNotFoundException e)
               {
                  throw new BackupOperationException("Restore of full backup file error " + e, e);
               }
               catch (IOException e)
               {
                  throw new BackupOperationException("Restore of full backup file I/O error " + e, e);
               }
            }
            else
            {
               try
               {
                  incrementalRestore(list.get(i).getURL().getPath(), reposytoryName, workspaceName);
               }
               catch (FileNotFoundException e)
               {
                  throw new BackupOperationException("Restore of incremental backup file error " + e, e);
               }
               catch (IOException e)
               {
                  throw new BackupOperationException("Restore of incremental backup file I/O error " + e, e);
               }
               catch (ClassNotFoundException e)
               {
                  throw new BackupOperationException("Restore of incremental backup error " + e, e);
               }
            }
         }
      }
      else
View Full Code Here

         {
            fullbackupType = log.getFullBackupType();
         }
         else
         {
            throw new BackupOperationException("Class  \"" + log.getFullBackupType()
               + "\" is not support as full backup.");
         }
      }
      catch (ClassNotFoundException e)
      {
         throw new BackupOperationException("Class \"" + log.getFullBackupType() + "\" is not found.", e);
      }

      // ws should not exists.
      if (!workspaceAlreadyExist(reposytoryName, workspaceName))
      {

         for (int i = 0; i < list.size(); i++)
         {
            if (i == 0)
            {
               try
               {
                  fullRestoreOverInitializer(list.get(i).getURL().getPath(), reposytoryName, workspaceEntry,
                     fullbackupType);
               }
               catch (FileNotFoundException e)
               {
                  throw new BackupOperationException("Restore of full backup file error " + e, e);
               }
               catch (IOException e)
               {
                  throw new BackupOperationException("Restore of full backup file I/O error " + e, e);
               }
               catch (ClassNotFoundException e)
               {
                  throw new BackupOperationException("Restore of full backup class load error " + e, e);
               }

               repoService.getConfig().retain(); // save configuration to persistence (file or persister)
            }
            else
            {
               try
               {
                  incrementalRestore(list.get(i).getURL().getPath(), reposytoryName, workspaceName);
               }
               catch (FileNotFoundException e)
               {
                  throw new BackupOperationException("Restore of incremental backup file error " + e, e);
               }
               catch (IOException e)
               {
                  throw new BackupOperationException("Restore of incremental backup file I/O error " + e, e);
               }
               catch (ClassNotFoundException e)
               {
                  throw new BackupOperationException("Restore of incremental backup error " + e, e);
               }
            }
         }
      }
      else
View Full Code Here

         {
            jobRestore.restore();
         }
         catch (Throwable e)
         {
            throw new BackupOperationException(e);
         }
      }
   }
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.ext.backup.BackupOperationException

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.