0N/A/*
0N/A * CDDL HEADER START
0N/A *
0N/A * The contents of this file are subject to the terms of the
0N/A * Common Development and Distribution License, Version 1.0 only
0N/A * (the "License"). You may not use this file except in compliance
0N/A * with the License.
0N/A *
0N/A * You can obtain a copy of the license at
0N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE
0N/A * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
0N/A * See the License for the specific language governing permissions
0N/A * and limitations under the License.
0N/A *
0N/A * When distributing Covered Code, include this CDDL HEADER in each
0N/A * file and include the License file at
0N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
0N/A * add the following below this CDDL HEADER, with the fields enclosed
873N/A * by brackets "[]" replaced with your own identifying information:
0N/A * Portions Copyright [yyyy] [name of copyright owner]
0N/A *
0N/A * CDDL HEADER END
0N/A *
0N/A *
3215N/A * Copyright 2006-2008 Sun Microsystems, Inc.
0N/A */
0N/Apackage org.opends.server.types;
0N/A
0N/A
0N/A/**
0N/A * This class defines a data structure for holding configuration
0N/A * information to use when performing a backup of a Directory Server
0N/A * backend. This configuration may specify a full backup (in which
0N/A * the entire contents of the backend repository is to be archived),
0N/A * or incremental (in which only a small set of data containing
0N/A * changes since the last incremental or full backup need be
0N/A * preserved). Note that some backends may not support incremental
0N/A * backups, and those that do may require that incremental backups use
0N/A * the same settings as the full backup with regard to compression,
0N/A * encryption, hashing, signing, etc. Also note that if the
0N/A * incremental backups are supported, it must be possible to restore
0N/A * the original full backup or any individual incremental backup taken
0N/A * since that full backup (i.e., an incremental backup must not
0N/A * prevent restoring an earlier incremental backup or the original
0N/A * full backup with which the incremental backups are associated).
0N/A */
2095N/A@org.opends.server.types.PublicAPI(
2095N/A stability=org.opends.server.types.StabilityLevel.VOLATILE,
2095N/A mayInstantiate=true,
2095N/A mayExtend=false,
2095N/A mayInvoke=true)
2728N/Apublic final class BackupConfig extends OperationConfig
0N/A{
0N/A // The path to the directory in which the backup file(s) should be
0N/A // created.
0N/A private BackupDirectory backupDirectory;
0N/A
0N/A // Indicates whether the data should be compressed as it is written.
0N/A private boolean compressData;
0N/A
0N/A // Indicates whether the data should be encrypted as it is written.
0N/A private boolean encryptData;
0N/A
0N/A // Indicates whether to generate a cryptographic hash of the data as
0N/A // it is written.
0N/A private boolean hashData;
0N/A
0N/A // Indicates whether to attempt an incremental backup.
0N/A private boolean isIncremental;
0N/A
0N/A // Indicates whether to digitally sign the hash when the backup is
0N/A // complete.
0N/A private boolean signHash;
0N/A
0N/A // The unique identifier assigned to this backup operation (which
0N/A // may be used to indicate which version to restore if multiple
0N/A // backups are in the same directory).
0N/A private String backupID;
0N/A
0N/A // The unique ID for the existing full or incremental backup against
0N/A // which the incremental backup should be based.
0N/A private String incrementalBaseID;
0N/A
0N/A
0N/A
0N/A /**
0N/A * Creates a new backup configuration that will create a full or
0N/A * incremental backup of a backend using the provided information.
0N/A *
0N/A * @param backupDirectory The backup directory structure that
0N/A * indicates where the files should be
0N/A * written.
0N/A * @param backupID The unique identifier assigned to this
0N/A * backup.
0N/A * @param isIncremental Indicates whether this is to be an
0N/A * incremental or a full backup.
0N/A */
0N/A public BackupConfig(BackupDirectory backupDirectory,
0N/A String backupID, boolean isIncremental)
0N/A {
0N/A this.backupDirectory = backupDirectory;
0N/A this.backupID = backupID;
0N/A this.isIncremental = isIncremental;
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Retrieves the backup directory structure for this backup
0N/A * configuration.
0N/A *
0N/A * @return The backup directory structure for this backup
0N/A * configuration.
0N/A */
0N/A public BackupDirectory getBackupDirectory()
0N/A {
0N/A return backupDirectory;
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Retrieves the identifier associated with this backup
0N/A * configuration, which can be used later to indicate which backup
0N/A * should be restored if multiple backups are stored in the same
0N/A * location.
0N/A *
0N/A * @return The identifier associated with this backup
0N/A * configuration.
0N/A */
0N/A public String getBackupID()
0N/A {
0N/A return backupID;
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Indicates whether the backend should attempt to perform an
0N/A * incremental backup containing only the changes since the last
0N/A * incremental or full backup.
0N/A *
0N/A * @return <CODE>true</CODE> if this should be an incremental
0N/A * backup, or <CODE>false</CODE> if it should be a full
0N/A * backup.
0N/A */
0N/A public boolean isIncremental()
0N/A {
0N/A return isIncremental;
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Retrieves the backup ID for the backup on which this incremental
0N/A * backup should be based. If it is <CODE>null</CODE>, then the
0N/A * backend is free to choose the appropriate existing backup on
0N/A * which to base this incremental backup.
0N/A *
0N/A * @return The backup ID for the backup on which this incremental
0N/A * backup should be based, or <CODE>null</CODE> if none was
0N/A * specified.
0N/A */
0N/A public String getIncrementalBaseID()
0N/A {
0N/A return incrementalBaseID;
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Specifies the backup ID for the backup on which this incremental
0N/A * backup should be based.
0N/A *
0N/A * @param incrementalBaseID The backup ID for the backup on which
0N/A * this incremental backup should be
0N/A * based.
0N/A */
0N/A public void setIncrementalBaseID(String incrementalBaseID)
0N/A {
0N/A this.incrementalBaseID = incrementalBaseID;
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Indicates whether the backup process should compress the data as
0N/A * it is archived.
0N/A *
0N/A * @return <CODE>true</CODE> if the backup process should compress
0N/A * the data as it is archived, or <CODE>false</CODE> if
0N/A * not.
0N/A */
0N/A public boolean compressData()
0N/A {
0N/A return compressData;
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Specifies whether the backup process should compress the data as
0N/A * it is archived.
0N/A *
0N/A * @param compressData Specifies whether the backup process should
0N/A * compress the data as it is archived.
0N/A */
0N/A public void setCompressData(boolean compressData)
0N/A {
0N/A this.compressData = compressData;
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Indicates whether the backup process should encrypt the data as
0N/A * it is archived.
0N/A *
0N/A * @return <CODE>true</CODE> if the backup process should encrypt
0N/A * the data as it is archived, or <CODE>false</CODE> if
0N/A * not.
0N/A */
0N/A public boolean encryptData()
0N/A {
0N/A return encryptData;
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Specifies whether the backup process should encrypt the data as
0N/A * it is archived.
0N/A *
0N/A * @param encryptData Specifies whether the backup process should
0N/A * encrypt the data as it is archived.
0N/A */
0N/A public void setEncryptData(boolean encryptData)
0N/A {
0N/A this.encryptData = encryptData;
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Indicates whether the backup process should generate a hash of
0N/A * the data as it is archived that may be validated as part of the
0N/A * restore process.
0N/A *
0N/A * @return <CODE>true</CODE> if the backup process should generate
0N/A * a hash of the data as it is archived, or
0N/A * <CODE>false</CODE> if not.
0N/A */
0N/A public boolean hashData()
0N/A {
0N/A return hashData;
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Specifies whether the backup process should generate a hash of
0N/A * the data as it is archived.
0N/A *
0N/A * @param hashData Specifies whether the backup process should
0N/A * generate a hash of the data as it is archived.
0N/A */
0N/A public void setHashData(boolean hashData)
0N/A {
0N/A this.hashData = hashData;
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Indicates whether the backup process should digitally sign the
0N/A * hash of the data when it is archived. Signing the hash offers a
0N/A * means of protection against tampering by an unauthorized party.
0N/A * Note that this option is only applicable if the backup is to
0N/A * include a hash of the archived data.
0N/A *
0N/A * @return <CODE>true</CODE> if the backup process should digitally
0N/A * sign the generated hash, or <CODE>false</CODE> if not.
0N/A */
0N/A public boolean signHash()
0N/A {
0N/A return signHash;
0N/A }
0N/A
0N/A
0N/A
0N/A /**
0N/A * Specifies whether the backup process should digitally sign the
0N/A * hash of the data when it is archived.
0N/A *
0N/A * @param signHash Specifies whether the backup process should
0N/A * digitally sign the data when it is archived.
0N/A */
0N/A public void setSignHash(boolean signHash)
0N/A {
0N/A this.signHash = signHash;
0N/A }
0N/A}
0N/A