/** * 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); } }
/** * 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); } }