|
SunTM's XACML Implementation for JavaTM | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Manages the context of a single policy evaluation. Typically, an instance is instantiated whenever the PDP gets a request and needs to perform an evaluation as a result.
Note that this class does some optional caching for current date, time, and dateTime values (defined by a boolean flag to the constructors). The XACML specification requires that these values always be available, but it does not specify whether or not they must remain constant over the course of an evaluation if the values are being generated by the PDP (if the values are provided in the Request, then obviously they will remain constant). The default behavior is for these environment values to be cached, so that (for example) the current time remains constant over the course of an evaluation.
Field Summary | |
static String |
RESOURCE_ID
The standard URI for listing a resource's id |
static String |
RESOURCE_SCOPE
The standard URI for listing a resource's scope |
static int |
SCOPE_CHILDREN
Resource scope of Children (the given resource and its direct children) |
static int |
SCOPE_DESCENDANTS
Resource scope of Descendants (the given resource and all descendants at any depth or distance) |
static int |
SCOPE_IMMEDIATE
Resource scope of Immediate (only the given resource) |
Method Summary | |
EvaluationResult |
getActionAttribute(URI type,
URI id,
URI issuer)
Returns available action attribute value(s). |
EvaluationResult |
getAttribute(String contextPath,
Node namespaceNode,
URI type,
String xpathVersion)
Returns the attribute value(s) retrieved using the given XPath expression. |
AttributeFinder |
getAttributeFinder()
Deprecated. As of version 1.2, this method should not be used, as it provides access to a mutable interface. This method will be removed in the next major release. |
DateAttribute |
getCurrentDate()
Returns the cached value for the current date. |
DateTimeAttribute |
getCurrentDateTime()
Returns the cached value for the current dateTime. |
TimeAttribute |
getCurrentTime()
Returns the cached value for the current time. |
EvaluationResult |
getEnvironmentAttribute(URI type,
URI id,
URI issuer)
Returns available environment attribute value(s). |
Node |
getRequestRoot()
Returns the DOM root of the original RequestType XML document, if this context is backed by an XACML Request. |
EvaluationResult |
getResourceAttribute(URI type,
URI id,
URI issuer)
Returns available resource attribute value(s). |
AttributeValue |
getResourceId()
Returns the identifier for the resource being requested. |
int |
getScope()
Returns the resource scope, which will be one of the three fields denoting Immediate, Children, or Descendants. |
EvaluationResult |
getSubjectAttribute(URI type,
URI id,
URI category)
Returns available subject attribute value(s) ignoring the issuer. |
EvaluationResult |
getSubjectAttribute(URI type,
URI id,
URI issuer,
URI category)
Returns available subject attribute value(s). |
void |
setCurrentDate(DateAttribute currentDate)
Sets the current date for this evaluation. |
void |
setCurrentDateTime(DateTimeAttribute currentDateTime)
Sets the current dateTime for this evaluation. |
void |
setCurrentTime(TimeAttribute currentTime)
Sets the current time for this evaluation. |
void |
setResourceId(AttributeValue resourceId)
Changes the value of the resource-id attribute in this context. |
Field Detail |
public static final String RESOURCE_ID
public static final String RESOURCE_SCOPE
public static final int SCOPE_IMMEDIATE
public static final int SCOPE_CHILDREN
public static final int SCOPE_DESCENDANTS
Method Detail |
public AttributeFinder getAttributeFinder()
AttributeFinder
used by this context.
AttributeFinder
public Node getRequestRoot()
UnsupportedOperationException
- if the context is not backed
by an XML representationpublic AttributeValue getResourceId()
public int getScope()
public void setResourceId(AttributeValue resourceId)
resourceId
- the new resource-id valuepublic TimeAttribute getCurrentTime()
setCurrentTime
, or if caching is
not enabled in this instance, then this will return null.
public void setCurrentTime(TimeAttribute currentTime)
currentTime
- the dynamically resolved current timepublic DateAttribute getCurrentDate()
setCurrentDate
, or if caching is
not enabled in this instance, then this will return null.
public void setCurrentDate(DateAttribute currentDate)
currentDate
- the dynamically resolved current datepublic DateTimeAttribute getCurrentDateTime()
setCurrentDateTime
, or if
caching is not enabled in this instance, then this will return null.
public void setCurrentDateTime(DateTimeAttribute currentDateTime)
currentDateTime
- the dynamically resolved current dateTimepublic EvaluationResult getSubjectAttribute(URI type, URI id, URI category)
type
- the type of the attribute value(s) to findid
- the id of the attribute value(s) to findcategory
- the category the attribute value(s) must be in
public EvaluationResult getSubjectAttribute(URI type, URI id, URI issuer, URI category)
type
- the type of the attribute value(s) to findid
- the id of the attribute value(s) to findissuer
- the issuer of the attribute value(s) to find or nullcategory
- the category the attribute value(s) must be in
public EvaluationResult getResourceAttribute(URI type, URI id, URI issuer)
type
- the type of the attribute value(s) to findid
- the id of the attribute value(s) to findissuer
- the issuer of the attribute value(s) to find or null
public EvaluationResult getActionAttribute(URI type, URI id, URI issuer)
type
- the type of the attribute value(s) to findid
- the id of the attribute value(s) to findissuer
- the issuer of the attribute value(s) to find or null
public EvaluationResult getEnvironmentAttribute(URI type, URI id, URI issuer)
type
- the type of the attribute value(s) to findid
- the id of the attribute value(s) to findissuer
- the issuer of the attribute value(s) to find or null
public EvaluationResult getAttribute(String contextPath, Node namespaceNode, URI type, String xpathVersion)
contextPath
- the XPath expression to searchnamespaceNode
- the DOM node defining namespace mappings to use,
or null if mappings come from the context roottype
- the type of the attribute value(s) to findxpathVersion
- the version of XPath to use
|
Sun's XACML Implementation Version 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Sun, Sun Microsystems, the Sun Logo, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.