Package org.opends.server.types
Class BackupInfo
- java.lang.Object
-
- org.opends.server.types.BackupInfo
-
@PublicAPI(stability=VOLATILE, mayInstantiate=false, mayExtend=false, mayInvoke=true) public final class BackupInfo extends Object
This class defines a data structure for holding information about a backup that is available in a backup directory.
-
-
Constructor Summary
Constructors Constructor Description BackupInfo(BackupDirectory backupDirectory, String backupID, Date backupDate, boolean isIncremental, boolean isCompressed, boolean isEncrypted, byte[] unsignedHash, byte[] signedHash, HashSet<String> dependencies, HashMap<String,String> backupProperties)Creates a new backup info structure with the provided information.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BackupInfodecode(BackupDirectory backupDirectory, List<String> encodedInfo)Decodes the provided list of strings as the representation of a backup info structure.booleandependsOn(String backupID)Indicates whether this backup has a dependency on the backup with the provided ID.List<String>encode()Encodes this backup info structure to a multi-line string representation.DategetBackupDate()Retrieves the date that this backup was created.BackupDirectorygetBackupDirectory()Retrieves the reference to the backup directory in which this backup is stored.StringgetBackupID()Retrieves the unique ID for this backup.Map<String,String>getBackupProperties()Retrieves a set of additional properties that should be associated with this backup.Set<String>getDependencies()Retrieves the set of the backup IDs for the backups on which this backup is dependent.byte[]getSignedHash()Retrieves the data for the signed hash for this backup, if appropriate.byte[]getUnsignedHash()Retrieves the data for the unsigned hash for this backup, if appropriate.booleanisCompressed()Indicates whether this backup is compressed.booleanisEncrypted()Indicates whether this backup is encrypted.booleanisIncremental()Indicates whether this is an incremental or a full backup.StringtoString()Retrieves a multi-line string representation of this backup info structure.
-
-
-
Constructor Detail
-
BackupInfo
public BackupInfo(BackupDirectory backupDirectory, String backupID, Date backupDate, boolean isIncremental, boolean isCompressed, boolean isEncrypted, byte[] unsignedHash, byte[] signedHash, HashSet<String> dependencies, HashMap<String,String> backupProperties)
Creates a new backup info structure with the provided information.- Parameters:
backupDirectory- A reference to the backup directory in which this backup is stored.backupID- The unique ID for this backup.backupDate- The time that this backup was created.isIncremental- Indicates whether this is an incremental or a full backup.isCompressed- Indicates whether the backup is compressed.isEncrypted- Indicates whether the backup is encrypted.unsignedHash- The unsigned hash for this backup, if appropriate.signedHash- The signed hash for this backup, if appropriate.dependencies- The backup IDs of the previous backups on which this backup is dependent.backupProperties- The set of additional backend-specific properties that should be stored with this backup information. It should be a mapping between property names and values, where the names do not contain any equal signs and neither the names nor the values contain line breaks.
-
-
Method Detail
-
getBackupDirectory
public BackupDirectory getBackupDirectory()
Retrieves the reference to the backup directory in which this backup is stored.- Returns:
- A reference to the backup directory in which this backup is stored.
-
getBackupID
public String getBackupID()
Retrieves the unique ID for this backup.- Returns:
- The unique ID for this backup.
-
getBackupDate
public Date getBackupDate()
Retrieves the date that this backup was created.- Returns:
- The date that this backup was created.
-
isIncremental
public boolean isIncremental()
Indicates whether this is an incremental or a full backup.- Returns:
trueif this is an incremental backup, orfalseif it is a full backup.
-
isCompressed
public boolean isCompressed()
Indicates whether this backup is compressed.- Returns:
trueif this backup is compressed, orfalseif it is not.
-
isEncrypted
public boolean isEncrypted()
Indicates whether this backup is encrypted.- Returns:
trueif this backup is encrypted, orfalseif it is not.
-
getUnsignedHash
public byte[] getUnsignedHash()
Retrieves the data for the unsigned hash for this backup, if appropriate.- Returns:
- The data for the unsigned hash for this backup, or
nullif there is none.
-
getSignedHash
public byte[] getSignedHash()
Retrieves the data for the signed hash for this backup, if appropriate.- Returns:
- The data for the signed hash for this backup, or
nullif there is none.
-
getDependencies
public Set<String> getDependencies()
Retrieves the set of the backup IDs for the backups on which this backup is dependent. This is primarily intended for use with incremental backups (which should be dependent on at least a full backup and possibly one or more other incremental backups). The contents of this hash should not be directly updated by the caller.- Returns:
- The set of the backup IDs for the backups on which this backup is dependent.
-
dependsOn
public boolean dependsOn(String backupID)
Indicates whether this backup has a dependency on the backup with the provided ID.- Parameters:
backupID- The backup ID for which to make the determination.- Returns:
trueif this backup has a dependency on the backup with the provided ID, orfalseif not.
-
getBackupProperties
public Map<String,String> getBackupProperties()
Retrieves a set of additional properties that should be associated with this backup. This may be used by the backend to store arbitrary information that may be needed later to restore the backup or perform an incremental backup based on this backup. The mapping will be between property names and values, where the names are not allowed to contain equal signs, and neither the names nor the values may have line breaks. The contents of the mapping should not be altered by the caller.- Returns:
- A set of additional properties that should be associated with this backup.
-
encode
public List<String> encode()
Encodes this backup info structure to a multi-line string representation. This representation may be parsed by thedecodemethod to reconstruct the structure.- Returns:
- A multi-line string representation of this backup info structure.
-
decode
public static BackupInfo decode(BackupDirectory backupDirectory, List<String> encodedInfo) throws ConfigException
Decodes the provided list of strings as the representation of a backup info structure.- Parameters:
backupDirectory- The reference to the backup directory with which the backup info is associated.encodedInfo- The list of strings that comprise the string representation of the backup info structure.- Returns:
- The decoded backup info structure.
- Throws:
ConfigException- If a problem occurs while attempting to decode the backup info data.
-
-