@PublicAPI(stability=VOLATILE, mayInstantiate=true, mayExtend=false, mayInvoke=true) public final class BackupDirectory extends Object
Constructor and Description |
---|
BackupDirectory(String path,
org.forgerock.opendj.ldap.Dn configEntryDN)
Creates a new backup directory object with the provided information.
|
Modifier and Type | Method and Description |
---|---|
void |
addBackup(BackupInfo backupInfo)
Adds information about the provided backup to this backup directory.
|
BackupInfo |
getBackupInfo(String backupID)
Retrieves the backup info structure for the backup with the specified ID.
|
Map<String,BackupInfo> |
getBackups()
Retrieves the set of backups in this backup directory, as a mapping between
the backup ID and the associated backup info.
|
org.forgerock.opendj.ldap.Dn |
getConfigEntryDN()
Retrieves the DN of the configuration entry for the backend with which this
backup directory is associated.
|
String |
getDescriptorPath()
Retrieves a path to the backup descriptor file that should be used for this
backup directory.
|
BackupInfo |
getLatestBackup()
Retrieves the most recent backup for this backup directory, according to
the backup date.
|
String |
getPath()
Retrieves the path to the directory containing the backup file(s).
|
static BackupDirectory |
readBackupDirectoryDescriptor(String path)
Reads the backup descriptor file in the specified path and uses the
information it contains to create a new backup directory structure.
|
void |
removeBackup(String backupID)
Removes the backup with the specified backup ID from this backup directory.
|
void |
writeBackupDirectoryDescriptor()
Writes the descriptor with the information contained in this structure to
disk in the appropriate directory.
|
public BackupDirectory(String path, org.forgerock.opendj.ldap.Dn configEntryDN)
path
- The path to the directory containing the backup file(s).configEntryDN
- The DN of the configuration entry for the backend with which this
backup directory is associated.public String getPath()
public org.forgerock.opendj.ldap.Dn getConfigEntryDN()
public Map<String,BackupInfo> getBackups()
public BackupInfo getBackupInfo(String backupID)
backupID
- The backup ID for the structure to retrieve.null
if no such
structure exists.public BackupInfo getLatestBackup()
null
if there are no backups in the
backup directory.public void addBackup(BackupInfo backupInfo) throws org.forgerock.opendj.config.server.ConfigException
backupInfo
- The backup info structure for the backup to be added.org.forgerock.opendj.config.server.ConfigException
- If another backup already exists with the same backup ID.public void removeBackup(String backupID) throws org.forgerock.opendj.config.server.ConfigException
backupID
- The backup ID for the backup to remove from this backup directory.org.forgerock.opendj.config.server.ConfigException
- If it is not possible to remove the requested backup for some
reason (e.g., no such backup exists, or another backup is
dependent on it).public String getDescriptorPath()
public void writeBackupDirectoryDescriptor() throws IOException
IOException
- If a problem occurs while writing to disk.public static BackupDirectory readBackupDirectoryDescriptor(String path) throws IOException, org.forgerock.opendj.config.server.ConfigException
path
- The path to the directory containing the backup descriptor file to
read.IOException
- If a problem occurs while trying to read the contents of the
descriptor file.org.forgerock.opendj.config.server.ConfigException
- If the contents of the descriptor file cannot be parsed to create
a backup directory structure.Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.