/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 2011, 2015 Oracle and/or its affiliates. All rights reserved.
*
*/
using System;
using System.Collections.Generic;
using System.Text;
namespace BerkeleyDB {
///
/// An interface that can optionally be used to override the default
/// behavior performed by the and
/// methods. Implementation
/// of this interface is required if the DatabaseEnvironment.backup or
/// DatabaseEnvironment.backupDatabase target parameter is null. You
/// configure the environment with this handler via
/// .
///
public interface IBackup {
///
/// Called when ending a backup and closing a backup target.
///
/// The name of the database that has been backed
/// up.
/// 0 on success, non-zero on error.
int Close(string dbname);
///
/// Called when a target location is opened during a backup. This method
/// should do whatever is necessary to prepare the backup destination
/// for writing the data.
///
/// The backup's directory destination.
/// The name of the database being backed up.
/// 0 on success, non-zero on error.
int Open(string dbname, string target);
///
/// Called when writing data during a backup.
///
/// Identifies the buffer which contains the data to
/// be backed up.
/// Identifies the position in the file where
/// bytes from buf should be written.
/// Identifies the number of bytes to write to the
/// file from the buffer.
/// 0 on success, non-zero on error.
int Write(byte[] data, long offset, int count);
}
}