示例#1
0
//-----------------------------------------------------------------------------
// backup
//-----------------------------------------------------------------------------

        /// <summary>
        /// Performs the backup operation. The <paramref name="sBackupPath"/> and
        /// <paramref name="backupClient"/> parameters are mutually exclusive.  If
        /// backupClient is null, then the backup will be created on disk in the
        /// location specified by sBackupPath.  If backupClient is non-null, the
        /// sBackupPath parameter is ignored.
        /// </summary>
        /// <param name="sBackupPath">
        /// The full pathname where the backup set is to be created.  This parameter
        /// is ignored if the backupClient parameter is non-null.
        /// </param>
        /// <param name="sPassword">
        /// Password to be used for the backup.  A non-empty password allows the backup
        /// to be restored on a machine other than the one where the database exists.  The
        /// database's encryption key (if encryption is enabled) will be wrapped in the
        /// specified password so that the backup can be restored to a different machine.
        /// </param>
        /// <param name="backupClient">
        /// If non-null, the backupClient is an object the provides interfaces for storing
        /// backup data to disk, tape, or other media.  If null, the backup data is stored
        /// to a file set specified by the sBackupPath parameter.
        /// </param>
        /// <param name="backupStatus">
        /// If non-null, the backupStatus object provides an interface that this method
        /// calls to report backup progress.
        /// </param>
        /// <returns>
        /// Returns a sequence number for this backup.  This is for informational
        /// purposes only.  For instance, users can use it to label their backup tapes.
        /// </returns>
        public uint backup(
            string sBackupPath,
            string sPassword,
            BackupClient backupClient,
            BackupStatus backupStatus)
        {
            RCODE rc;
            uint  uiSeqNum;
            BackupClientDelegate backupClientDelegate = null;
            BackupClientCallback fnBackupClient       = null;
            BackupStatusDelegate backupStatusDelegate = null;
            BackupStatusCallback fnBackupStatus       = null;

            if (backupClient != null)
            {
                backupClientDelegate = new BackupClientDelegate(backupClient);
                fnBackupClient       = new BackupClientCallback(backupClientDelegate.funcBackupClient);
            }
            if (backupStatus != null)
            {
                backupStatusDelegate = new BackupStatusDelegate(backupStatus);
                fnBackupStatus       = new BackupStatusCallback(backupStatusDelegate.funcBackupStatus);
            }

            if ((rc = xflaim_Backup_backup(m_pBackup, sBackupPath, sPassword, out uiSeqNum,
                                           fnBackupClient, fnBackupStatus)) != 0)
            {
                throw new XFlaimException(rc);
            }
            return(uiSeqNum);
        }
示例#2
0
        //-----------------------------------------------------------------------------
        // backup
        //-----------------------------------------------------------------------------
        /// <summary>
        /// Performs the backup operation. The <paramref name="sBackupPath"/> and
        /// <paramref name="backupClient"/> parameters are mutually exclusive.  If
        /// backupClient is null, then the backup will be created on disk in the
        /// location specified by sBackupPath.  If backupClient is non-null, the
        /// sBackupPath parameter is ignored.
        /// </summary>
        /// <param name="sBackupPath">
        /// The full pathname where the backup set is to be created.  This parameter
        /// is ignored if the backupClient parameter is non-null.
        /// </param>
        /// <param name="sPassword">
        /// Password to be used for the backup.  A non-empty password allows the backup
        /// to be restored on a machine other than the one where the database exists.  The
        /// database's encryption key (if encryption is enabled) will be wrapped in the
        /// specified password so that the backup can be restored to a different machine.
        /// </param>
        /// <param name="backupClient">
        /// If non-null, the backupClient is an object the provides interfaces for storing
        /// backup data to disk, tape, or other media.  If null, the backup data is stored
        /// to a file set specified by the sBackupPath parameter.
        /// </param>
        /// <param name="backupStatus">
        /// If non-null, the backupStatus object provides an interface that this method
        /// calls to report backup progress.
        /// </param>
        /// <returns>
        /// Returns a sequence number for this backup.  This is for informational
        /// purposes only.  For instance, users can use it to label their backup tapes.
        /// </returns>
        public uint backup(
			string				sBackupPath,
			string				sPassword,
			BackupClient		backupClient,
			BackupStatus		backupStatus)
        {
            RCODE						rc;
            uint						uiSeqNum;
            BackupClientDelegate	backupClientDelegate = null;
            BackupClientCallback	fnBackupClient = null;
            BackupStatusDelegate	backupStatusDelegate = null;
            BackupStatusCallback	fnBackupStatus = null;

            if (backupClient != null)
            {
                backupClientDelegate = new BackupClientDelegate( backupClient);
                fnBackupClient = new BackupClientCallback( backupClientDelegate.funcBackupClient);
            }
            if (backupStatus != null)
            {
                backupStatusDelegate = new BackupStatusDelegate( backupStatus);
                fnBackupStatus = new BackupStatusCallback( backupStatusDelegate.funcBackupStatus);
            }

            if ((rc = xflaim_Backup_backup( m_pBackup, sBackupPath, sPassword, out uiSeqNum,
                fnBackupClient, fnBackupStatus)) != 0)
            {
                throw new XFlaimException( rc);
            }
            return( uiSeqNum);
        }