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

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


         validateRepositoryName(repository);

         //workspace name and repository name should equals original names from backup set.
         if (!repository.equals(backupChainLog.getBackupConfig().getRepository()))
         {
            throw new WorkspaceRestoreException("Repository name\"" + repository
                     + "\" should equals original repository name from backup set : \""
                     + backupChainLog.getBackupConfig().getRepository() + "\".");
         }

         if (!workspace.equals(backupChainLog.getBackupConfig().getWorkspace()))
         {
            throw new WorkspaceRestoreException("Workspace name\"" + workspace
                     + "\" should equals original workspace name from backup set : \""
                     + backupChainLog.getBackupConfig().getWorkspace() + "\".");
         }

         if (removeExisting)
         {
            if (!isWorkspaceExist(repository, workspace))
            {
               throw new WorkspaceRestoreException("Workspace " + workspace + " is not exists!");
            }

            backupManager.restoreExistingWorkspace(backupId, true);
         }
         else
View Full Code Here


            if (removeExisting)
            {
               if (!isWorkspaceExist(repository, workspace))
               {
                  throw new WorkspaceRestoreException("Workspace " + workspace + " is not exists!");
               }

               backupManager.restoreExistingWorkspace(backupSetDir, true);
            }
            else
View Full Code Here

            {
               log.error("Can't rollback changes", e);
            }
         }

         throw new WorkspaceRestoreException("Workspace " + wEntry.getName() + " was not restored", t);
      }
      finally
      {
         // close
         for (DataRestore restorer : dataRestorer)
View Full Code Here

            }
         }

         if (wEntry == null)
         {
            throw new WorkspaceRestoreException("Workspace " + this.wEntry.getName()
               + " did not found in current repository " + repositoryName + " configuration");
         }

         // get all backupable components
         List<Backupable> backupable =
            repositoryService.getRepository(repositoryName).getWorkspaceContainer(wEntry.getName())
               .getComponentInstancesOfType(Backupable.class);

         // close all session
         forceCloseSession(repositoryName, wEntry.getName());

         repositoryService.getRepository(repositoryName).removeWorkspace(wEntry.getName());

         // clean
         for (Backupable component : backupable)
         {
            component.clean();
         }

         super.restoreWorkspace();
      }
      catch (Throwable t)
      {
         throw new WorkspaceRestoreException("Workspace " + wEntry.getName() + " was not restored", t);
      }
   }
View Full Code Here

            throw new BackupLogNotFoundException("The backup log file with id " + backupId + " not exists.");

         validateRepositoryName(repository);

         if (isWorkspaceExist(repository, wEntry.getName()))
            throw new WorkspaceRestoreException("Workspace " + wEntry.getName() + " already exist!");

         BackupChainLog backupChainLog = new BackupChainLog(backupLog);

         backupManager.restore(backupChainLog, repository, wEntry, true);
View Full Code Here

         if (removeExisting)
         {
            if (!isWorkspaceExist(repository, wEntry.getName()))
            {
               throw new WorkspaceRestoreException("Workspace " + wEntry.getName() + " is not exist!");
            }

            backupManager.restoreExistingWorkspace(backupChainLog, repository, wEntry, true);
         }
         else
View Full Code Here

         if (removeExisting)
         {
            if (!isWorkspaceExist(repository, wEntry.getName()))
            {
               throw new WorkspaceRestoreException("Workspace " + wEntry.getName() + " is not exist!");
            }

            backupManager.restoreExistingWorkspace(backupChainLog, repository, wEntry, true);
         }
         else
View Full Code Here

         validateRepositoryName(repository);

         //workspace name and repository name should equals original names from backup set.
         if (!repository.equals(backupChainLog.getBackupConfig().getRepository()))
         {
            throw new WorkspaceRestoreException("Repository name\"" + repository
                     + "\" should equals original repository name from backup set : \""
                     + backupChainLog.getBackupConfig().getRepository() + "\".");
         }

         if (!workspace.equals(backupChainLog.getBackupConfig().getWorkspace()))
         {
            throw new WorkspaceRestoreException("Workspace name\"" + workspace
                     + "\" should equals original workspace name from backup set : \""
                     + backupChainLog.getBackupConfig().getWorkspace() + "\".");
         }

         if (removeExisting)
         {
            if (!isWorkspaceExist(repository, workspace))
            {
               throw new WorkspaceRestoreException("Workspace " + workspace + " is not exists!");
            }

            backupManager.restoreExistingWorkspace(backupId, true);
         }
         else
View Full Code Here

            if (removeExisting)
            {
               if (!isWorkspaceExist(repository, workspace))
               {
                  throw new WorkspaceRestoreException("Workspace " + workspace + " is not exists!");
               }

               backupManager.restoreExistingWorkspace(backupSetDir, true);
            }
            else
View Full Code Here

            throw new BackupLogNotFoundException("The backup log file with id " + backupId + " not exists.");

         validateRepositoryName(repository);

         if (isWorkspaceExist(repository, wEntry.getName()))
            throw new WorkspaceRestoreException("Workspace " + wEntry.getName() + " already exist!");

         BackupChainLog backupChainLog = new BackupChainLog(backupLog);

         backupManager.restore(backupChainLog, repository, wEntry, true);
View Full Code Here

TOP

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

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.