com.cafesoft.cams.access
Class EvaluationException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--com.cafesoft.core.exception.NestedException
                    |
                    +--com.cafesoft.cams.access.EvaluationException
All Implemented Interfaces:
Serializable

public class EvaluationException
extends NestedException

EvaluationException represents an exceptional condition when attempting to evaluate an AccessControlRule. The condition may correspond with an unanticipated system error or a precondition to for evaluating the rule. An AccessControlRule may throw this exception as a way to immediately terminate evaluation of nested AccessControlRules. In this case, the EvaluationException conveys the status, reason, and a textual message than overrides any overall expression evaluation state. For example, an EvaluationExpression is thrown for the following AccessControlRule expression:

 
    
    
       
          employee
       
    
 
 

because the auth-rule should force authentication, not just return "false".

See Also:
Serialized Form

Field Summary
protected  int reason
          The reason the EvaluationException was thrown.
 
Constructor Summary
EvaluationException()
          Construct a new EvaluationException with no other information.
EvaluationException(String message)
          Construct a new EvaluationException for the specified message.
EvaluationException(String message, int reason)
          Construct a new EvaluationException for the specified message.
EvaluationException(String message, Throwable cause)
          Construct a new EvaluationException for the specified message and throwable.
EvaluationException(Throwable cause)
          Construct a new EvaluationException for the specified throwable.
 
Method Summary
 int getReason()
          Get the AccessControlResponse reason code.
 
Methods inherited from class com.cafesoft.core.exception.NestedException
getCause, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getStackTrace, initCause, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

reason

protected int reason
The reason the EvaluationException was thrown.

Constructor Detail

EvaluationException

public EvaluationException()
Construct a new EvaluationException with no other information.


EvaluationException

public EvaluationException(String message)
Construct a new EvaluationException for the specified message.

Parameters:
message - a message describing this exception

EvaluationException

public EvaluationException(String message,
                           int reason)
Construct a new EvaluationException for the specified message.

Parameters:
message - a message describing this exception
reason - the reason this EvaluationException is being thrown. The handler catching this Exception can inspect the reason and in most cases should report the reason within the corresponding AccessControlResponse.

EvaluationException

public EvaluationException(Throwable cause)
Construct a new EvaluationException for the specified throwable.

Parameters:
cause - throwable that caused this exception

EvaluationException

public EvaluationException(String message,
                           Throwable cause)
Construct a new EvaluationException for the specified message and throwable.

Parameters:
message - a message describing this exception
cause - throwable that caused this exception
Method Detail

getReason

public int getReason()
Get the AccessControlResponse reason code.

Returns:
the AccessControlResponse reason code. If the value is not: AccessControlResponse.RC_ACCESS_DENIED_EVALUATION_ERROR, then the AccessControlRule throwing this exception has interrupted evaluation.


Generated on 5:16:42 PM May 12, 2008, © 1996-2005 Cafésoft LLC. All rights reserved.