com.cafesoft.cams.attr
Class StandardAttributeDesignator

java.lang.Object
  |
  +--com.cafesoft.cams.attr.StandardAttributeDesignator
All Implemented Interfaces:
AttributeDesignator, Evaluatable

public class StandardAttributeDesignator
extends Object
implements AttributeDesignator

StandardAttributeDesignator implements the standard AttributeDesignator, which selects a bag AttributeValues for a named attribute within an AccessControlContext.

Since:
4/27/2004

Constructor Summary
StandardAttributeDesignator(URI attrCategory, URI attrType, URI attrId, boolean mustBePresent)
          Create a new StandardAttributeDesignator instance.
 
Method Summary
 EvaluationResult evaluate(EvaluationContext evalContext)
          Evaluates the object using the given context, and either returns an error or a resulting value.
 boolean evaluatesToBag()
          Indicates whether evaluation will return a bag or a single value.
 URI getAttributeCategory()
          Get the AttributeCategory.
 URI getAttributeId()
          Returns the identifier of the attribute selected by this designator.
 URI getType()
          Get the type of this object.
 boolean mustBePresent()
          Returns whether or not a value is required to be resolved by this designator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardAttributeDesignator

public StandardAttributeDesignator(URI attrCategory,
                                   URI attrType,
                                   URI attrId,
                                   boolean mustBePresent)
                            throws IllegalArgumentException
Create a new StandardAttributeDesignator instance.

Parameters:
attrCategory - the category (e.g. subject, resource, action, environment, etc.) of attribute associated with this designator.
attrType - a URI representing the attribute value type. On successful evaluation a bag of attribute values of this type will be returned.
attrId - a URI identifying the designated attribute.
mustBePresent - indicates whether evaluation of this designator returns an empty bag or "indeterminate" if the specified attribute is absent from the AccessControlContext. If mustBePresent is true and the named attribute absent, then indeterminate is returnd. If mustBePresent is false and the named attribute is absent, then an empty bag is returned.
Method Detail

getAttributeId

public URI getAttributeId()
Returns the identifier of the attribute selected by this designator.

Specified by:
getAttributeId in interface AttributeDesignator
Returns:
the identifier for the attribute to be selected.

getAttributeCategory

public URI getAttributeCategory()
Get the AttributeCategory.

Specified by:
getAttributeCategory in interface AttributeDesignator
Returns:
the AttributeCategory associated with this AttributeDesignator.

mustBePresent

public boolean mustBePresent()
Returns whether or not a value is required to be resolved by this designator. If true and the value is not present, then

Specified by:
mustBePresent in interface AttributeDesignator
Returns:
true if an attribute with the specified category and identifier must be present in the AccessControlContext. If true and the attribute is not present, then EvaluationStatus "indeterminate" will be returned on evaluation. If false and the attribute is not present, then an empty bag will be returned.

evaluate

public EvaluationResult evaluate(EvaluationContext evalContext)
Evaluates the object using the given context, and either returns an error or a resulting value.

Specified by:
evaluate in interface Evaluatable
Parameters:
evalContext - the representation of the request
Returns:
the evaluation result

getType

public URI getType()
Get the type of this object. This may be the data type of an Attribute or the return type of an AttributeDesignator, etc.

Specified by:
getType in interface Evaluatable
Returns:
the type of data represented by this object

evaluatesToBag

public boolean evaluatesToBag()
Indicates whether evaluation will return a bag or a single value.

Specified by:
evaluatesToBag in interface Evaluatable
Returns:
true, AttributeDesignator always evaluates to a bag.


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