@Override public Problems backupRepository( File backupDirectory, BackupOptions backupOptions ) throws RepositoryException { session().checkPermission(Path.ROOT_PATH, ModeShapePermissions.BACKUP); return repository().runningState().backupService().backupRepository(backupDirectory, backupOptions); }
/** * Start backing up the repository. * * @param backupDirectory the directory on the file system into which the backup should be placed; this directory should * typically not exist * @param options a {@link org.modeshape.jcr.api.BackupOptions} instance controlling the behavior of the backup; may not be * {@code null} * @return the problems that occurred during the backup process * @throws RepositoryException if the backup operation cannot be run */ public org.modeshape.jcr.api.Problems backupRepository( File backupDirectory, BackupOptions options ) throws RepositoryException { // Create the activity ... final BackupActivity backupActivity = createBackupActivity(backupDirectory, options); //suspend any existing transactions try { if (runningState.suspendExistingUserTransaction()) { LOGGER.debug("Suspended existing active user transaction before the backup operation starts"); } try { // Run the backup and return the problems ... return new JcrProblems(backupActivity.execute()); } finally { runningState.resumeExistingUserTransaction(); } } catch (SystemException e) { throw new RuntimeException(e); } }
@Override public Problems restoreRepository( File backupDirectory, RestoreOptions options ) throws RepositoryException { session().checkPermission(Path.ROOT_PATH, ModeShapePermissions.RESTORE); return repository().runningState().backupService().restoreRepository(repository(), backupDirectory, options); }
final RestoreActivity restoreActivity = createRestoreActivity(backupDirectory, options);
backupService.shutdown();
this.backupService = new BackupService(this);
final RestoreActivity restoreActivity = createRestoreActivity(backupDirectory, options);
backupService.shutdown();
this.backupService = new BackupService(this);
@Override public Problems restoreRepository( File backupDirectory, RestoreOptions options ) throws RepositoryException { session().checkPermission(Path.ROOT_PATH, ModeShapePermissions.RESTORE); return repository().runningState().backupService().restoreRepository(repository(), backupDirectory, options); }
@Override public Problems backupRepository( File backupDirectory, BackupOptions backupOptions ) throws RepositoryException { session().checkPermission(Path.ROOT_PATH, ModeShapePermissions.BACKUP); return repository().runningState().backupService().backupRepository(backupDirectory, backupOptions); }
/** * Start backing up the repository. * * @param backupDirectory the directory on the file system into which the backup should be placed; this directory should * typically not exist * @param options a {@link org.modeshape.jcr.api.BackupOptions} instance controlling the behavior of the backup; may not be * {@code null} * @return the problems that occurred during the backup process * @throws RepositoryException if the backup operation cannot be run */ public org.modeshape.jcr.api.Problems backupRepository( File backupDirectory, BackupOptions options ) throws RepositoryException { // Create the activity ... final BackupActivity backupActivity = createBackupActivity(backupDirectory, options); //suspend any existing transactions try { if (runningState.suspendExistingUserTransaction()) { LOGGER.debug("Suspended existing active user transaction before the backup operation starts"); } try { // Run the backup and return the problems ... return new JcrProblems(backupActivity.execute()); } finally { runningState.resumeExistingUserTransaction(); } } catch (SystemException e) { throw new RuntimeException(e); } }