/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 2009, 2015 Oracle and/or its affiliates. All rights reserved.
*
*/
using BerkeleyDB.Internal;
namespace BerkeleyDB {
///
/// The policy for how to handle database creation.
///
public enum CreatePolicy : uint {
///
/// Never create the database.
///
NEVER = 0,
///
/// Create the database if it does not already exist.
///
IF_NEEDED = DbConstants.DB_CREATE,
///
/// Do not open the database and return an error if it already exists.
///
ALWAYS = DbConstants.DB_CREATE | DbConstants.DB_EXCL
};
///
/// Specifies the database operation whose progress is being reported
///
public enum DatabaseFeedbackEvent : uint {
///
/// The underlying database is being upgraded.
///
UPGRADE = DbConstants.DB_UPGRADE,
///
/// The underlying database is being verified.
///
VERIFY = DbConstants.DB_VERIFY
};
///
/// Policy for duplicate data items in the database. Allows a key/data
/// pair to be inserted into the database even if the key already exists.
///
public enum DuplicatesPolicy : uint {
///
/// Does not allow a key/data pair to be inserted into the database even
/// if the key already exists
///
NONE = 0,
///
/// Duplicates are allowed and mainted in sorted order, as determined by the
/// duplicate comparison function.
///
SORTED = DbConstants.DB_DUPSORT,
///
/// Duplicates are allowed and ordered in the database by the order of
/// insertion, unless the ordering is otherwise specified by use of a cursor
/// operation or a duplicate sort function.
///
UNSORTED = DbConstants.DB_DUP
};
///
/// Specifies an algorithm used for encryption and decryption
///
public enum EncryptionAlgorithm : uint {
///
/// The default algorithm, or the algorithm previously used in an
/// existing environment
///
DEFAULT = 0,
///
/// The Rijndael/AES algorithm
///
///
/// Also known as the Advanced Encryption Standard and Federal
/// Information Processing Standard (FIPS) 197
///
AES = DbConstants.DB_ENCRYPT_AES
};
///
/// Specifies the environment operation whose progress is being reported
///
public enum EnvironmentFeedbackEvent : uint {
///
/// The environment is being recovered.
///
RECOVERY = DbConstants.DB_RECOVER,
};
///
/// Special environment IDs.
///
public enum EnvironmentID : int {
///
/// A message should be broadcast to every environment in the
/// replication group, whose eid in
/// is set to be
/// this ID.
///
EID_BROADCAST = DbConstants.DB_EID_BROADCAST,
///
/// An invalid environment ID.
///
EID_INVALID = DbConstants.DB_EID_INVALID,
///
/// Messages sent on the channel created by
/// with this ID
/// would be sent only to the master site.
///
EID_MASTER = DbConstants.DB_EID_MASTER,
};
///
/// Specifies the action to take when deleting a foreign key
///
public enum ForeignKeyDeleteAction : uint {
///
/// Abort the deletion.
///
ABORT = DbConstants.DB_FOREIGN_ABORT,
///
/// Delete records that refer to the foreign key
///
CASCADE = DbConstants.DB_FOREIGN_CASCADE,
///
/// Nullify records that refer to the foreign key
///
NULLIFY = DbConstants.DB_FOREIGN_NULLIFY
};
///
/// Specify the degree of isolation for transactional operations
///
public enum Isolation {
///
/// Read operations on the database may request the return of modified
/// but not yet committed data.
///
DEGREE_ONE,
///
/// Provide for cursor stability but not repeatable reads. Data items
/// which have been previously read by a transaction may be deleted or
/// modified by other transactions before the original transaction
/// completes.
///
DEGREE_TWO,
///
/// For the life of the transaction, every time a thread of control
/// reads a data item, it is unchanged from its previous value
/// (assuming, of course, the thread of control does not itself modify
/// the item). This is Berkeley DB's default degree of isolation.
///
DEGREE_THREE
};
///
/// Specify a Berkeley DB event
///
public enum NotificationEvent : uint {
///
/// The database environment has failed.
///
///
/// All threads of control in the database environment should exit the
/// environment, and recovery should be run.
///
PANIC = DbConstants.DB_EVENT_PANIC,
///
/// The replication manager subordinate process was unable to take over
/// as the replication process.
///
REP_AUTOTAKEOVER_FAILED = DbConstants.DB_EVENT_REP_AUTOTAKEOVER_FAILED,
///
/// The local site is now a replication client.
///
REP_CLIENT = DbConstants.DB_EVENT_REP_CLIENT,
///
/// A previously established connection has been broken.
///
REP_CONNECT_BROKEN = DbConstants.DB_EVENT_REP_CONNECT_BROKEN,
///
/// A connection with a remote site has been established.
///
REP_CONNECT_ESTD = DbConstants.DB_EVENT_REP_CONNECT_ESTD,
///
/// An attempt to establish a new connection to a known remote site failed.
///
REP_CONNECT_TRY_FAILED = DbConstants.DB_EVENT_REP_CONNECT_TRY_FAILED,
///
/// A duplicate master site has been discovered in the replication
/// group.
///
REP_DUPMASTER = DbConstants.DB_EVENT_REP_DUPMASTER,
///
/// The local replication site has just won an election.
///
///
///
/// An application using the Base replication API should arrange for a
/// call to
/// after
/// receiving this event, to reconfigure the local environment as a
/// replication master.
///
///
/// Replication Manager applications may safely ignore this event. The
/// Replication Manager calls
///
/// automatically on behalf of the application when appropriate
/// (resulting in firing of the event).
///
///
REP_ELECTED = DbConstants.DB_EVENT_REP_ELECTED,
///
/// The local site's attempt to initiate or participate in a
/// replication master election failed, due to the lack of timely
/// message response from a sufficient number of remote sites.
///
REP_ELECTION_FAILED = DbConstants.DB_EVENT_REP_ELECTION_FAILED,
///
/// The internal initialization has been completed.
///
REP_INIT_DONE = DbConstants.DB_EVENT_REP_INIT_DONE,
///
/// Incoming messages have been dropped because the Replication Mananger
/// incoming queue has reached its maximum threshold.
///
REP_INQUEUE_FULL = DbConstants.DB_EVENT_REP_INQUEUE_FULL,
///
/// The local site could not synchronize with the master because an
/// internal initialization was required, but internal initialization
/// has been turned off by .
///
REP_JOIN_FAILURE = DbConstants.DB_EVENT_REP_JOIN_FAILURE,
///
/// The local site has been removed from the group.
///
REP_LOCAL_SITE_REMOVED = DbConstants.DB_EVENT_REP_LOCAL_SITE_REMOVED,
///
/// The local site is now the master site of its replication group. It
/// is the application's responsibility to begin acting as the master
/// environment.
///
REP_MASTER = DbConstants.DB_EVENT_REP_MASTER,
///
/// The connection to the remote master replication site has failed.
///
REP_MASTER_FAILURE = DbConstants.DB_EVENT_REP_MASTER_FAILURE,
///
/// The replication group of which this site is a member has just
/// established a new master; the local site is not the new master. The
/// event_info parameter to the
/// stores an integer containing the environment ID of the new master.
///
REP_NEWMASTER = DbConstants.DB_EVENT_REP_NEWMASTER,
///
/// The replication manager did not receive enough acknowledgements
/// (based on the acknowledgement policy configured with
/// ) to ensure a
/// transaction's durability within the replication group. The
/// transaction will be flushed to the master's local disk storage for
/// durability.
///
///
/// This event is provided only to applications configured for the
/// replication manager.
///
REP_PERM_FAILED = DbConstants.DB_EVENT_REP_PERM_FAILED,
///
/// The client has completed startup synchronization and is now
/// processing live log records received from the master.
///
REP_STARTUPDONE = DbConstants.DB_EVENT_REP_STARTUPDONE,
///
/// A new site has joined the group.
///
REP_SITE_ADDED = DbConstants.DB_EVENT_REP_SITE_ADDED,
///
/// An existing remote site has been removed from the group.
///
REP_SITE_REMOVED = DbConstants.DB_EVENT_REP_SITE_REMOVED,
///
/// A Berkeley DB write to stable storage failed.
///
WRITE_FAILED = DbConstants.DB_EVENT_WRITE_FAILED
};
///
/// Status values from transaction application checking operations.
///
public enum TransactionAppliedStatus : int
{
///
/// The transaction has been applied on the current replica node.
///
APPLIED = 0,
///
/// The transaction has not yet been applied on this replica node.
///
TIMEOUT = DbConstants.DB_TIMEOUT,
///
/// The transaction did not update the database.
///
EMPTY_TRANSACTION = DbConstants.DB_KEYEMPTY,
///
/// No such transaction found in the replication group.
///
NOTFOUND = DbConstants.DB_NOTFOUND
};
}