public class AttributeDesignator extends Object implements Evaluatable
| Modifier and Type | Field and Description |
|---|---|
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
|
static int |
RESOURCE_TARGET
Tells designator to search in the resource section of the request
|
static 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
|
| Constructor and Description |
|---|
AttributeDesignator(int target,
URI type,
URI id,
boolean mustBePresent)
Creates a new
AttributeDesignator without the optional
issuer. |
AttributeDesignator(int target,
URI type,
URI id,
boolean mustBePresent,
URI issuer)
Creates a new
AttributeDesignator with the optional
issuer. |
| Modifier and Type | Method and Description |
|---|---|
void |
encode(OutputStream output)
Encodes this designator into its XML representation and
writes this encoding to the given
OutputStream with no
indentation. |
void |
encode(OutputStream output,
Indenter indenter)
Encodes this designator into its XML representation and
writes this encoding to the given
OutputStream with
indentation. |
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 subject category for this designator.
|
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.
|
URI |
getId()
Returns the AttributeId of the values resolved by this designator.
|
static AttributeDesignator |
getInstance(Node root,
int target)
Deprecated.
As of 2.0 you should avoid using this method and should
instead use the version that takes a
PolicyMetaData instance. This method will
only work for XACML 1.x policies. |
static AttributeDesignator |
getInstance(Node root,
int target,
PolicyMetaData metaData)
Creates a new
AttributeDesignator based on the DOM
root of the XML data. |
URI |
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.
|
void |
setSubjectCategory(URI category)
Sets the category if this is a SubjectAttributeDesignatorType
|
String |
toString() |
public static final int SUBJECT_TARGET
public static final int RESOURCE_TARGET
public static final int ACTION_TARGET
public static final int ENVIRONMENT_TARGET
public static final String SUBJECT_CATEGORY_DEFAULT
public AttributeDesignator(int target,
URI type,
URI id,
boolean mustBePresent)
AttributeDesignator without the optional
issuer.target - the type of designator as specified by the 4 member
*_TARGET fieldstype - the data type resolved by this designatorid - the attribute id looked for by this designatormustBePresent - whether resolution must find a valuepublic AttributeDesignator(int target,
URI type,
URI id,
boolean mustBePresent,
URI issuer)
throws IllegalArgumentException
AttributeDesignator with the optional
issuer.target - the type of designator as specified by the 4 member
*_TARGET fieldstype - the data type resolved by this designatorid - the attribute id looked for by this designatormustBePresent - whether resolution must find a valueissuer - the issuer of the values to search for or null if no
issuer is specifiedIllegalArgumentException - if the input target isn't a valid valuepublic void setSubjectCategory(URI category)
category - the subject categorypublic static AttributeDesignator getInstance(Node root, int target) throws ParsingException
PolicyMetaData instance. This method will
only work for XACML 1.x policies.AttributeDesignator based on the DOM
root of the XML data.root - the DOM root of the AttributeDesignatorType XML typetarget - the type of designator to create as specified in the
four member *_TARGET fieldsParsingException - if the AttributeDesignatorType was invalidpublic static AttributeDesignator getInstance(Node root, int target, PolicyMetaData metaData) throws ParsingException
AttributeDesignator based on the DOM
root of the XML data.root - the DOM root of the AttributeDesignatorType XML typetarget - the type of designator to create as specified in the
four member *_TARGET fieldsmetaData - the meta-data associated with the containing policyParsingException - if the AttributeDesignatorType was invalidpublic int getDesignatorType()
public URI getType()
getType in interface Expressionpublic URI getId()
public URI getCategory()
public URI getIssuer()
public boolean mustBePresent()
public boolean returnsBag()
returnsBag in interface Expressionpublic boolean evaluatesToBag()
returnsBag
method from the super-interface Expression.evaluatesToBag in interface Evaluatablepublic List getChildren()
getChildren in interface EvaluatableListpublic EvaluationResult evaluate(EvaluationCtx context)
evaluate in interface Evaluatablecontext - the representation of the requestpublic void encode(OutputStream output)
OutputStream with no
indentation.encode in interface Expressionoutput - a stream into which the XML-encoded data is writtenpublic void encode(OutputStream output, Indenter indenter)
OutputStream with
indentation.encode in interface Expressionoutput - a stream into which the XML-encoded data is writtenindenter - an object that creates indentation stringsCopyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.