org.opends.server.backends.jeb
Class BackupManager

java.lang.Object
  extended by org.opends.server.backends.jeb.BackupManager

public class BackupManager
extends java.lang.Object

A backup manager for JE backends.


Field Summary
static java.lang.String BACKUP_BASE_FILENAME
          The common prefix for archive files.
static java.lang.String PROPERTY_LAST_LOGFILE_NAME
          The name of the property that holds the name of the latest log file at the time the backup was created.
static java.lang.String PROPERTY_LAST_LOGFILE_SIZE
          The name of the property that holds the size of the latest log file at the time the backup was created.
static java.lang.String ZIPENTRY_EMPTY_PLACEHOLDER
          The name of a dummy entry in the backup archive file that will act as a placeholder in case a backup is done on an empty backend.
static java.lang.String ZIPENTRY_UNCHANGED_LOGFILES
          The name of the entry in an incremental backup archive file containing a list of log files that are unchanged since the previous backup.
 
Constructor Summary
BackupManager(java.lang.String backendID)
          Construct a backup manager for a JE backend.
 
Method Summary
 void createBackup(java.io.File backendDir, BackupConfig backupConfig)
          Create a backup of the JE backend.
 void removeBackup(BackupDirectory backupDir, java.lang.String backupID)
          Removes the specified backup if it is possible to do so.
 void restoreBackup(java.io.File backendDir, RestoreConfig restoreConfig)
          Restore a JE backend from backup, or verify the backup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BACKUP_BASE_FILENAME

public static final java.lang.String BACKUP_BASE_FILENAME
The common prefix for archive files.

See Also:
Constant Field Values

PROPERTY_LAST_LOGFILE_NAME

public static final java.lang.String PROPERTY_LAST_LOGFILE_NAME
The name of the property that holds the name of the latest log file at the time the backup was created.

See Also:
Constant Field Values

PROPERTY_LAST_LOGFILE_SIZE

public static final java.lang.String PROPERTY_LAST_LOGFILE_SIZE
The name of the property that holds the size of the latest log file at the time the backup was created.

See Also:
Constant Field Values

ZIPENTRY_UNCHANGED_LOGFILES

public static final java.lang.String ZIPENTRY_UNCHANGED_LOGFILES
The name of the entry in an incremental backup archive file containing a list of log files that are unchanged since the previous backup.

See Also:
Constant Field Values

ZIPENTRY_EMPTY_PLACEHOLDER

public static final java.lang.String ZIPENTRY_EMPTY_PLACEHOLDER
The name of a dummy entry in the backup archive file that will act as a placeholder in case a backup is done on an empty backend.

See Also:
Constant Field Values
Constructor Detail

BackupManager

public BackupManager(java.lang.String backendID)
Construct a backup manager for a JE backend.

Parameters:
backendID - The ID of the backend instance for which a backup manager is required.
Method Detail

createBackup

public void createBackup(java.io.File backendDir,
                         BackupConfig backupConfig)
                  throws DirectoryException
Create a backup of the JE backend. The backup is stored in a single zip file in the backup directory. If the backup is incremental, then the first entry in the zip is a text file containing a list of all the JE log files that are unchanged since the previous backup. The remaining zip entries are the JE log files themselves, which, for an incremental, only include those files that have changed.

Parameters:
backendDir - The directory of the backend instance for which the backup is required.
backupConfig - The configuration to use when performing the backup.
Throws:
DirectoryException - If a Directory Server error occurs.

restoreBackup

public void restoreBackup(java.io.File backendDir,
                          RestoreConfig restoreConfig)
                   throws DirectoryException
Restore a JE backend from backup, or verify the backup.

Parameters:
backendDir - The configuration of the backend instance to be restored.
restoreConfig - The configuration to use when performing the restore.
Throws:
DirectoryException - If a Directory Server error occurs.

removeBackup

public void removeBackup(BackupDirectory backupDir,
                         java.lang.String backupID)
                  throws DirectoryException
Removes the specified backup if it is possible to do so.

Parameters:
backupDir - The backup directory structure with which the specified backup is associated.
backupID - The backup ID for the backup to be removed.
Throws:
DirectoryException - If it is not possible to remove the specified backup for some reason (e.g., no such backup exists or there are other backups that are dependent upon it).