ModeShape Distribution 3.0.0.Beta4

org.modeshape.jcr
Class BackupService

java.lang.Object
  extended by org.modeshape.jcr.BackupService

public class BackupService
extends Object

A service used to generate backups from content and restore repository content from backups.


Nested Class Summary
static class BackupService.Activity
          An abstract activity used for the various backup and restore operations.
static class BackupService.BackupActivity
          The BackupService.Activity subclass that performs content backup operations.
protected static class BackupService.FieldName
           
static class BackupService.RestoreActivity
          The BackupService.Activity subclass that performs content restore operations.
 
Field Summary
protected static String BINARY_AREA_DIR_NAME
           
protected static String BINARY_EXTENSION
           
protected static String CHANGED_AREA_DIR_NAME
           
static boolean DEFAULT_COMPRESS
           
static long DEFAULT_NUMBER_OF_DOCUMENTS_IN_BACKUP_FILES
          By default, 100K nodes will be exported to a single backup file.
protected static String DOCUMENTS_FILENAME_PREFIX
           
protected static Logger LOGGER
           
protected static int NUM_CHARS_IN_FILENAME_SUFFIX
           
protected static String SUMMARY_FILE_NAME
           
 
Constructor Summary
protected BackupService(JcrRepository.RunningState runningState)
           
 
Method Summary
 Problems backupRepository(File backupDirectory)
          Start asynchronously backing up the repository.
 Problems backupRepository(File backupDirectory, long documentsPerFile, boolean compress)
          Start asynchronously backing up the repository.
 BackupService.BackupActivity createBackupActivity(File backupDirectory, long documentsPerFile, boolean compress)
          Create a new activity instance that can back up the content of the repository as it exists at the time the activity is executed.
 BackupService.RestoreActivity createRestoreActivity(File backupDirectory)
          Create a new activity instance that can restore the content of the repository to the state as it exists in the specified backup directory.
 Problems restoreRepository(JcrRepository repository, File backupDirectory)
          Start asynchronously backing up the repository.
protected  void shutdown()
          Shut down this service and immediately terminate all currently-running backup operations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected static final Logger LOGGER

CHANGED_AREA_DIR_NAME

protected static final String CHANGED_AREA_DIR_NAME
See Also:
Constant Field Values

BINARY_AREA_DIR_NAME

protected static final String BINARY_AREA_DIR_NAME
See Also:
Constant Field Values

DOCUMENTS_FILENAME_PREFIX

protected static final String DOCUMENTS_FILENAME_PREFIX
See Also:
Constant Field Values

SUMMARY_FILE_NAME

protected static final String SUMMARY_FILE_NAME
See Also:
Constant Field Values

BINARY_EXTENSION

protected static final String BINARY_EXTENSION
See Also:
Constant Field Values

NUM_CHARS_IN_FILENAME_SUFFIX

protected static final int NUM_CHARS_IN_FILENAME_SUFFIX
See Also:
Constant Field Values

DEFAULT_NUMBER_OF_DOCUMENTS_IN_BACKUP_FILES

public static final long DEFAULT_NUMBER_OF_DOCUMENTS_IN_BACKUP_FILES
By default, 100K nodes will be exported to a single backup file. So, if each node requied about 200 bytes (compressed), the resulting files will be about 19 MB in size.

See Also:
Constant Field Values

DEFAULT_COMPRESS

public static final boolean DEFAULT_COMPRESS
See Also:
Constant Field Values
Constructor Detail

BackupService

protected BackupService(JcrRepository.RunningState runningState)
Method Detail

shutdown

protected void shutdown()
Shut down this service and immediately terminate all currently-running backup operations.


backupRepository

public Problems backupRepository(File backupDirectory)
                          throws RepositoryException
Start asynchronously backing up the repository.

Parameters:
backupDirectory - the directory on the file system into which the backup should be placed; this directory should typically not exist
Returns:
the problems that occurred during the backup process
Throws:
RepositoryException - if the backup operation cannot be run

backupRepository

public Problems backupRepository(File backupDirectory,
                                 long documentsPerFile,
                                 boolean compress)
                          throws RepositoryException
Start asynchronously backing up the repository.

Parameters:
backupDirectory - the directory on the file system into which the backup should be placed; this directory should typically not exist
documentsPerFile - the maximum number of documents to place within a single backup file; must be positive
compress - true if the backup files should be compressed, or false otherwise
Returns:
the problems that occurred during the backup process
Throws:
RepositoryException - if the backup operation cannot be run

restoreRepository

public Problems restoreRepository(JcrRepository repository,
                                  File backupDirectory)
                           throws RepositoryException
Start asynchronously backing up the repository.

Parameters:
repository - the JCR repository to be backed up; may not be null
backupDirectory - the directory on the file system that contains the backup; this directory obviously must exist
Returns:
the problems that occurred during the restore process
Throws:
RepositoryException - if the restoration operation cannot be run

createBackupActivity

public BackupService.BackupActivity createBackupActivity(File backupDirectory,
                                                         long documentsPerFile,
                                                         boolean compress)
Create a new activity instance that can back up the content of the repository as it exists at the time the activity is executed.

Parameters:
backupDirectory - the directory on the file system into which the backup should be placed; this directory should typically not exist
documentsPerFile - the maximum number of documents to place within a single backup file; must be positive
compress - true if the backup files should be compressed, or false otherwise
Returns:
the backup activity; never null

createRestoreActivity

public BackupService.RestoreActivity createRestoreActivity(File backupDirectory)
Create a new activity instance that can restore the content of the repository to the state as it exists in the specified backup directory.

Parameters:
backupDirectory - the directory on the file system that contains the backup; this directory obviously must exist
Returns:
the restore activity; never null

ModeShape Distribution 3.0.0.Beta4

Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.