org.opends.server.authorization.dseecompat
Enum EnumEvalResult

java.lang.Object
  extended by java.lang.Enum<EnumEvalResult>
      extended by org.opends.server.authorization.dseecompat.EnumEvalResult
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<EnumEvalResult>

public enum EnumEvalResult
extends java.lang.Enum<EnumEvalResult>

This class provides an enumeration of evaluation results returned by the bind rule evaluation methods.


Enum Constant Summary
ERR
          This is an internal enumeration used during evaluation of bind rule when internal processing of the evaluation is undefined.
FAIL
          This enumeration is returned when the result of the evaluation is FAIL.
FALSE
          This enumeration is returned when the result of the evaluation is FALSE.
TRUE
          This enumeration is returned when the result of the evaluation is TRUE.
 
Method Summary
 boolean getBoolVal()
          Helper method that converts this enumeration to a boolean.
 EnumEvalResult getRet(EnumBindRuleType type, boolean undefined)
          The method tries to determine if the result was undefined, and if so it returns an FAIL enumeration.
static EnumEvalResult negateIfNeeded(EnumEvalResult v, boolean n)
          This method is used to possibly negate the result of a simple bind rule evaluation.
static EnumEvalResult valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static EnumEvalResult[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

TRUE

public static final EnumEvalResult TRUE
This enumeration is returned when the result of the evaluation is TRUE.


FALSE

public static final EnumEvalResult FALSE
This enumeration is returned when the result of the evaluation is FALSE.


FAIL

public static final EnumEvalResult FAIL
This enumeration is returned when the result of the evaluation is FAIL. This should only be returned when a system failure occurred.


ERR

public static final EnumEvalResult ERR
This is an internal enumeration used during evaluation of bind rule when internal processing of the evaluation is undefined. It is never returned back as a result of the evaluation.

Method Detail

values

public static EnumEvalResult[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (EnumEvalResult c : EnumEvalResult.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static EnumEvalResult valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getRet

public EnumEvalResult getRet(EnumBindRuleType type,
                             boolean undefined)
The method tries to determine if the result was undefined, and if so it returns an FAIL enumeration. If the result was not undefined (the common case for all of the bind rule evaluations), then the bind rule type is examined to see if the result needs to be flipped (type equals NOT_EQUAL_BINDRULE_TYPE).

Parameters:
type - The bind rule type enumeration of the bind rule.
undefined - A flag that signals the the result was undefined.
Returns:
An enumeration containing the correct result after processing the undefined field and the bind rule type enumeration.

negateIfNeeded

public static EnumEvalResult negateIfNeeded(EnumEvalResult v,
                                            boolean n)
This method is used to possibly negate the result of a simple bind rule evaluation. If the boolean is true than the result is negated.

Parameters:
v - The enumeration result of the simple bind rule evaluation.
n - If true the result should be negated (TRUE->FALSE, FALSE->TRUE).
Returns:
A possibly negated enumeration result.

getBoolVal

public boolean getBoolVal()
Helper method that converts this enumeration to a boolean. Usually the FAIL enumeration has been handled before this is called.

Returns:
True if the enumeration is TRUE, else false.