SunTM's XACML Implementation for JavaTM

com.sun.xacml.cond
Class EvaluationResult

java.lang.Object
  extended bycom.sun.xacml.cond.EvaluationResult

public class EvaluationResult
extends Object

This is used in cases where a normal result is some AttributeValue, but if an attribute couldn't be resolved (or some other problem occurred), then a Status object needs to be returned instead. This is used instead of throwing an exception for performance, but mainly because failure to resolve an attribute is not an error case for the code, merely for the evaluation, and represents normal operation. Separate exception types will be added later to represent errors in pdp operation.

Since:
1.0

Constructor Summary
EvaluationResult(AttributeValue value)
          Constructor that creates an EvaluationResult containing a single AttributeValue
EvaluationResult(Status status)
          Constructor that creates an EvaluationResult of Indeterminate, including Status data.
 
Method Summary
 AttributeValue getAttributeValue()
          Returns the attribute value, or null if there was an error
static EvaluationResult getFalseInstance()
          Returns an EvaluationResult that represents a false value.
static EvaluationResult getInstance(boolean value)
          Returns an EvaluationResult that represents the boolean value provided.
 Status getStatus()
          Returns the status if there was an error, or null it no error occurred
static EvaluationResult getTrueInstance()
          Returns an EvaluationResult that represents a true value.
 boolean indeterminate()
          Returns true if the result was indeterminate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EvaluationResult

public EvaluationResult(AttributeValue value)
Constructor that creates an EvaluationResult containing a single AttributeValue

Parameters:
value - the attribute value

EvaluationResult

public EvaluationResult(Status status)
Constructor that creates an EvaluationResult of Indeterminate, including Status data.

Parameters:
status - the error information
Method Detail

indeterminate

public boolean indeterminate()
Returns true if the result was indeterminate

Returns:
true if there was an error

getAttributeValue

public AttributeValue getAttributeValue()
Returns the attribute value, or null if there was an error

Returns:
the attribute value or null

getStatus

public Status getStatus()
Returns the status if there was an error, or null it no error occurred

Returns:
the status or null

getInstance

public static EvaluationResult getInstance(boolean value)
Returns an EvaluationResult that represents the boolean value provided.

Parameters:
value - a boolean representing the desired value
Returns:
an EvaluationResult representing the appropriate value

getFalseInstance

public static EvaluationResult getFalseInstance()
Returns an EvaluationResult that represents a false value.

Returns:
an EvaluationResult representing a false value

getTrueInstance

public static EvaluationResult getTrueInstance()
Returns an EvaluationResult that represents a true value.

Returns:
an EvaluationResult representing a true value

Sun's XACML Implementation Version 1.2

Copyright 2003-2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

Sun, Sun Microsystems, the Sun Logo, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.