Package com.tailf.cdb

Enum Class CdbLockType

Object
Enum<CdbLockType>
com.tailf.cdb.CdbLockType
All Implemented Interfaces:
Serializable, Comparable<CdbLockType>, Constable

public enum CdbLockType extends Enum<CdbLockType>

DB lock type flag for Cdb Sessions which controls locking of sessions.

LOCK_SESSION or LOCK REQUESTS are mutually exclusive and controls if the lock should be held for the complete session or for each request respectively.

LOCK_WAIT can be combined with either LOCK_SESSION or LOCK_REQUEST to control if lock requests should block and wait for lock. Default behavior is to fail if lock cannot be obtained.

LOCK_PARTIAL can be combined with LOCK_REQUEST to control the lock to hold only for the subtree from the point of access for the request. Default behavior is that the complete CDB database is locked.

Locks are combined using EnumSet for example as


  EnumSet<CdbLockType> eSet = EnumSet.of(CdbLockType.LOCK_REQUEST,
                                         CdbLockType.LOCK_PARTIAL,
                                         CdbLockType.LOCK_WAIT);
 
  • Enum Constant Details

    • LOCK_WAIT

      public static final CdbLockType LOCK_WAIT
      Controls in combination with one of LOCK_SESSION or LOCK_REQUEST if the call should wait instead of fail if lock is not obtained. Combined using EnumSet
    • LOCK_SESSION

      public static final CdbLockType LOCK_SESSION
      Obtain read lock for the complete session
    • LOCK_REQUEST

      public static final CdbLockType LOCK_REQUEST
      Obtain read lock for each read request
    • LOCK_PARTIAL

      public static final CdbLockType LOCK_PARTIAL
      Controls if locks of type LOCK_REQUEST should be partial i.e. only lock subtree under the point of access
  • Method Details

    • values

      public static CdbLockType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CdbLockType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public int getValue()