Enum Class GrouperTransactionType

java.lang.Object
java.lang.Enum<GrouperTransactionType>
edu.internet2.middleware.grouper.hibernate.GrouperTransactionType
All Implemented Interfaces:
Serializable, Comparable<GrouperTransactionType>, Constable

public enum GrouperTransactionType extends Enum<GrouperTransactionType>
enum of possible transaction types
  • Enum Constant Details

    • READONLY_OR_USE_EXISTING

      public static final GrouperTransactionType READONLY_OR_USE_EXISTING
      use the current transaction if one exists, if not, create a new readonly tx. Note, the enclosing transaction could be readonly or readwrite, and no error will be thrown. However, no matter what, this code cannot commit or rollback...
    • NONE

      public static final GrouperTransactionType NONE
      even if in a current tx, do not use transactions
    • READONLY_NEW

      public static final GrouperTransactionType READONLY_NEW
      even if in the middle of a transaction, create a new readonly autonomous nested transaction. Code in this state cannot commit or rollback.
    • READ_WRITE_OR_USE_EXISTING

      public static final GrouperTransactionType READ_WRITE_OR_USE_EXISTING
      use the current transaction if one exists. If there is a current transaction, it MUST be read/write or there will be an exception. If there isnt a transaction in scope, then create a new read/write one. If you do not commit at the end, and there is a normal return (no exception), then the transaction will be committed if new, and not if reusing an existing one. If there is an exception, and the tx is new, it will be rolledback. If there is an exception and the tx is reused, the tx will not be touched, and the exception will propagate.
    • READ_WRITE_NEW

      public static final GrouperTransactionType READ_WRITE_NEW
      even if in the middle of a transaction, create a new read/write autonomous nested transaction. If this block is exited normally it will always commit. If exception is thrown, it will always rollback.
  • Method Details

    • values

      public static GrouperTransactionType[] 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 GrouperTransactionType 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
    • valueOfIgnoreCase

      public static GrouperTransactionType valueOfIgnoreCase(String string)
      do a case-insensitive matching
      Parameters:
      string -
      Returns:
      the enum or null or exception if not found
    • isReadonly

      public abstract boolean isReadonly()
      return if readonly. note if readonly_if_not_exist it will throw exception since it doesnt know if readonly or not...
      Returns:
      true if known readonly, false, if known read_write
    • isNewAutonomous

      public abstract boolean isNewAutonomous()
      return if new autonomous transaction
      Returns:
      true if new, false if not
    • isTransactional

      public abstract boolean isTransactional()
      if there is a transaction (e.g. not NONE)
      Returns:
      the transaction type
    • checkCompatibility

      public abstract void checkCompatibility(GrouperTransactionType existingGrouperTransactionType) throws GrouperDAOException
      return if readonly. note if readonly_if_not_exist it will throw exception since it doesnt know if readonly or not...
      Parameters:
      existingGrouperTransactionType - if null, no parent, if not, then this is the enclosing type
      Throws:
      GrouperDAOException - if there is a compatibility problem
    • grouperTransactionTypeToUse

      public abstract GrouperTransactionType grouperTransactionTypeToUse()
      convert the declared tx type to one that is not "if exists"...
      Returns:
      the type to use (e.g. not an if exists one)