Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.sun.xacml.attr
Class AttributeDesignator  view AttributeDesignator download AttributeDesignator.java

java.lang.Object
  extended bycom.sun.xacml.attr.AttributeDesignator
All Implemented Interfaces:
com.sun.xacml.cond.Evaluatable

public class AttributeDesignator
extends java.lang.Object
implements com.sun.xacml.cond.Evaluatable

Represents all four kinds of Designators in XACML.

Since:
1.0

Field Summary
static int ACTION_TARGET
          Tells designator to search in the action section of the request
static int ENVIRONMENT_TARGET
          Tells designator to search in the environment section of the request
private  java.net.URI id
           
private  java.net.URI issuer
           
private static java.util.logging.Logger logger
           
private  boolean mustBePresent
           
static int RESOURCE_TARGET
          Tells designator to search in the resource section of the request
static java.lang.String SUBJECT_CATEGORY_DEFAULT
          The standard URI for the default subject category value
static int SUBJECT_TARGET
          Tells designator to search in the subject section of the request
private  java.net.URI subjectCategory
           
private  int target
           
private static java.lang.String[] targetTypes
           
private  java.net.URI type
           
 
Constructor Summary
AttributeDesignator(int target, java.net.URI type, java.net.URI id, boolean mustBePresent)
          Creates a new AttributeDesignator without the optional issuer.
AttributeDesignator(int target, java.net.URI type, java.net.URI id, boolean mustBePresent, java.net.URI issuer)
          Creates a new AttributeDesignator with the optional issuer.
 
Method Summary
 void encode(java.io.OutputStream output)
          Encodes this designator into its XML representation and writes this encoding to the given OutputStream with no indentation.
 void encode(java.io.OutputStream output, com.sun.xacml.Indenter indenter)
          Encodes this designator into its XML representation and writes this encoding to the given OutputStream with indentation.
 com.sun.xacml.cond.EvaluationResult evaluate(com.sun.xacml.EvaluationCtx context)
          Evaluates the pre-assigned meta-data against the given context, trying to find some matching values.
 boolean evaluatesToBag()
          Always returns true, since a designator always returns a bag of attribute values.
 java.net.URI getCategory()
          Returns the subject category for this designator.
 java.util.List getChildren()
          Always returns an empty list since designators never have children.
 int getDesignatorType()
          Returns the type of this designator as specified by the *_TARGET fields.
 java.net.URI getId()
          Returns the AttributeId of the values resolved by this designator.
static AttributeDesignator getInstance(org.w3c.dom.Node root, int target)
          Creates a new AttributeDesignator based on the DOM root of the XML data.
 java.net.URI getIssuer()
          Returns the issuer of the values resolved by this designator if specified.
 java.net.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.
 void setSubjectCategory(java.net.URI category)
          Sets the category if this is a SubjectAttributeDesignatorType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUBJECT_TARGET

public static final int SUBJECT_TARGET
Tells designator to search in the subject section of the request

See Also:
Constant Field Values

RESOURCE_TARGET

public static final int RESOURCE_TARGET
Tells designator to search in the resource section of the request

See Also:
Constant Field Values

ACTION_TARGET

public static final int ACTION_TARGET
Tells designator to search in the action section of the request

See Also:
Constant Field Values

ENVIRONMENT_TARGET

public static final int ENVIRONMENT_TARGET
Tells designator to search in the environment section of the request

See Also:
Constant Field Values

SUBJECT_CATEGORY_DEFAULT

public static final java.lang.String SUBJECT_CATEGORY_DEFAULT
The standard URI for the default subject category value

See Also:
Constant Field Values

targetTypes

private static final java.lang.String[] targetTypes

target

private int target

type

private java.net.URI type

id

private java.net.URI id

issuer

private java.net.URI issuer

mustBePresent

private boolean mustBePresent

subjectCategory

private java.net.URI subjectCategory

logger

private static final java.util.logging.Logger logger
Constructor Detail

AttributeDesignator

public AttributeDesignator(int target,
                           java.net.URI type,
                           java.net.URI id,
                           boolean mustBePresent)
Creates a new AttributeDesignator without the optional issuer.


AttributeDesignator

public AttributeDesignator(int target,
                           java.net.URI type,
                           java.net.URI id,
                           boolean mustBePresent,
                           java.net.URI issuer)
                    throws java.lang.IllegalArgumentException
Creates a new AttributeDesignator with the optional issuer.

Method Detail

setSubjectCategory

public void setSubjectCategory(java.net.URI category)
Sets the category if this is a SubjectAttributeDesignatorType


getInstance

public static AttributeDesignator getInstance(org.w3c.dom.Node root,
                                              int target)
                                       throws com.sun.xacml.ParsingException
Creates a new AttributeDesignator based on the DOM root of the XML data.


getDesignatorType

public int getDesignatorType()
Returns the type of this designator as specified by the *_TARGET fields.


getType

public java.net.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.

Specified by:
getType in interface com.sun.xacml.cond.Evaluatable

getId

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


getCategory

public java.net.URI getCategory()
Returns the subject category for this designator. If this is not a SubjectAttributeDesignator then this will always return null.


getIssuer

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


mustBePresent

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


evaluatesToBag

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

Specified by:
evaluatesToBag in interface com.sun.xacml.cond.Evaluatable

getChildren

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

Specified by:
getChildren in interface com.sun.xacml.cond.Evaluatable

evaluate

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

Specified by:
evaluate in interface com.sun.xacml.cond.Evaluatable

encode

public void encode(java.io.OutputStream output)
Encodes this designator into its XML representation and writes this encoding to the given OutputStream with no indentation.

Specified by:
encode in interface com.sun.xacml.cond.Evaluatable

encode

public void encode(java.io.OutputStream output,
                   com.sun.xacml.Indenter indenter)
Encodes this designator into its XML representation and writes this encoding to the given OutputStream with indentation.

Specified by:
encode in interface com.sun.xacml.cond.Evaluatable