org.wso2.balana.attr.xacml3
Class AttributeDesignator

java.lang.Object
  extended by org.wso2.balana.attr.AbstractDesignator
      extended by org.wso2.balana.attr.xacml3.AttributeDesignator
All Implemented Interfaces:
Evaluatable, Expression

public class AttributeDesignator
extends AbstractDesignator


Constructor Summary
AttributeDesignator(URI type, URI id, boolean mustBePresent, String issuer, URI category)
          Creates a new AttributeDesignator with the optional issuer.
AttributeDesignator(URI type, URI id, boolean mustBePresent, URI category)
          Creates a new AttributeDesignator without the optional issuer.
 
Method Summary
 void encode(StringBuilder builder)
          Encodes this AttributeDesignator into its XML form and writes this out to the provided StringBuilder
 EvaluationResult evaluate(EvaluationCtx context)
          Evaluates the pre-assigned meta-data against the given context, trying to find some matching values.
 boolean evaluatesToBag()
          Deprecated. As of 2.0, you should use the returnsBag method from the super-interface Expression.
 URI getCategory()
          Returns the category for this designator.
 List getChildren()
          Always returns an empty list since designators never have children.
 URI getId()
          Returns the AttributeId of the values resolved by this designator.
static AttributeDesignator getInstance(Node root)
          Creates a new AttributeDesignator based on the DOM root of the XML data.
 String getIssuer()
          Returns the issuer of the values resolved by this designator if specified.
 URI getType()
          Returns the type of attribute that is resolved by this designator.
 boolean mustBePresent()
          Returns whether or not a value is required to be resolved by this designator.
 boolean returnsBag()
          Always returns true, since a designator always returns a bag of attribute values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeDesignator

public AttributeDesignator(URI type,
                           URI id,
                           boolean mustBePresent,
                           URI category)
Creates a new AttributeDesignator without the optional issuer.

Parameters:
type - the data type resolved by this designator
id - the attribute id looked for by this designator
mustBePresent - whether resolution must find a value
category -

AttributeDesignator

public AttributeDesignator(URI type,
                           URI id,
                           boolean mustBePresent,
                           String issuer,
                           URI category)
                    throws IllegalArgumentException
Creates a new AttributeDesignator with the optional issuer.

Parameters:
type - the data type resolved by this designator
id - the attribute id looked for by this designator
mustBePresent - whether resolution must find a value
issuer - the issuer of the values to search for or null if no issuer is specified
category -
Throws:
IllegalArgumentException - if the input target isn't a valid value
Method Detail

getInstance

public static AttributeDesignator getInstance(Node root)
                                       throws ParsingException
Creates a new AttributeDesignator based on the DOM root of the XML data.

Parameters:
root - the DOM root of the AttributeDesignatorType XML type
Returns:
the designator
Throws:
ParsingException - if the AttributeDesignatorType was invalid

getType

public URI getType()
Returns the type of attribute that is resolved by this designator. While an AD will always return a bag, this method will always return the type that is stored in the bag.

Returns:
the attribute type

getId

public URI getId()
Returns the AttributeId of the values resolved by this designator.

Specified by:
getId in class AbstractDesignator
Returns:
identifier for the values to resolve

getCategory

public URI getCategory()
Returns the category for this designator.

Returns:
the category

getIssuer

public String getIssuer()
Returns the issuer of the values resolved by this designator if specified.

Returns:
the attribute issuer or null if unspecified

mustBePresent

public boolean mustBePresent()
Returns whether or not a value is required to be resolved by this designator.

Returns:
true if a value is required, false otherwise

returnsBag

public boolean returnsBag()
Always returns true, since a designator always returns a bag of attribute values.

Returns:
true

evaluatesToBag

public boolean evaluatesToBag()
Deprecated. As of 2.0, you should use the returnsBag method from the super-interface Expression.

Always returns true, since a designator always returns a bag of attribute values.

Returns:
true

getChildren

public List getChildren()
Always returns an empty list since designators never have children.

Returns:
an empty List

evaluate

public EvaluationResult evaluate(EvaluationCtx context)
Evaluates the pre-assigned meta-data against the given context, trying to find some matching values.

Parameters:
context - the representation of the request
Returns:
a result containing a bag either empty because no values were found or containing at least one value, or status associated with an Indeterminate result

encode

public void encode(StringBuilder builder)
Encodes this AttributeDesignator into its XML form and writes this out to the provided StringBuilder

Parameters:
builder - string stream into which the XML-encoded data is written


Copyright © 2015 WSO2. All rights reserved.