|
SunTM's XACML Implementation for JavaTM | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.xacml.BasicEvaluationCtx
A basic implementation of EvaluationCtx
that is created from
an XACML Request and falls back on an AttributeFinder if a requested
value isn't available in the Request.
Field Summary |
Fields inherited from interface com.sun.xacml.EvaluationCtx |
RESOURCE_ID, RESOURCE_SCOPE, SCOPE_CHILDREN, SCOPE_DESCENDANTS, SCOPE_IMMEDIATE |
Constructor Summary | |
BasicEvaluationCtx(RequestCtx request)
Constructs a new BasicEvaluationCtx based on the given
request. |
|
BasicEvaluationCtx(RequestCtx request,
AttributeFinder finder)
Constructs a new BasicEvaluationCtx based on the given
request, and supports looking outside the original request for attribute
values using the AttributeFinder . |
|
BasicEvaluationCtx(RequestCtx request,
AttributeFinder finder,
boolean cacheEnvValues)
Constructs a new BasicEvaluationCtx based on the given
request, and supports looking outside the original request for attribute
values using the AttributeFinder . |
|
BasicEvaluationCtx(RequestCtx request,
boolean cacheEnvValues)
Constructs a new BasicEvaluationCtx based on the given
request. |
Method Summary | |
EvaluationResult |
getActionAttribute(URI type,
URI id,
URI issuer)
Returns attribute value(s) from the action section of the request. |
EvaluationResult |
getAttribute(String contextPath,
Node namespaceNode,
URI type,
String xpathVersion)
Returns the attribute value(s) retrieved using the given XPath expression. |
AttributeFinder |
getAttributeFinder()
Returns the AttributeFinder used by this context. |
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 attribute value(s) from the environment section of the request. |
Node |
getRequestRoot()
Returns the DOM root of the original RequestType XML document. |
EvaluationResult |
getResourceAttribute(URI type,
URI id,
URI issuer)
Returns attribute value(s) from the resource section of the request. |
AttributeValue |
getResourceId()
Returns the resource named in the request as resource-id. |
int |
getScope()
Returns the resource scope of the request, which will be one of the three fields denoting Immediate, Children, or Descendants. |
EvaluationResult |
getSubjectAttribute(URI type,
URI id,
URI category)
Returns attribute value(s) from the subject section of the request that have no issuer. |
EvaluationResult |
getSubjectAttribute(URI type,
URI id,
URI issuer,
URI category)
Returns attribute value(s) from the subject section of the request. |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BasicEvaluationCtx(RequestCtx request) throws ParsingException
BasicEvaluationCtx
based on the given
request. The resulting context will cache current date, time, and
dateTime values so they remain constant for this evaluation.
request
- the request
ParsingException
- if a required attribute is missing, or if there
are any problems dealing with the request datapublic BasicEvaluationCtx(RequestCtx request, boolean cacheEnvValues) throws ParsingException
BasicEvaluationCtx
based on the given
request.
request
- the requestcacheEnvValues
- whether or not to cache the current time, date,
and dateTime so they are constant for the scope
of this evaluation
ParsingException
- if a required attribute is missing, or if there
are any problems dealing with the request datapublic BasicEvaluationCtx(RequestCtx request, AttributeFinder finder) throws ParsingException
BasicEvaluationCtx
based on the given
request, and supports looking outside the original request for attribute
values using the AttributeFinder
. The resulting context
will cache current date, time, and dateTime values so they remain
constant for this evaluation.
request
- the requestfinder
- an AttributeFinder
to use in looking for
attributes that aren't in the request
ParsingException
- if a required attribute is missing, or if there
are any problems dealing with the request datapublic BasicEvaluationCtx(RequestCtx request, AttributeFinder finder, boolean cacheEnvValues) throws ParsingException
BasicEvaluationCtx
based on the given
request, and supports looking outside the original request for attribute
values using the AttributeFinder
.
request
- the requestfinder
- an AttributeFinder
to use in looking for
attributes that aren't in the requestcacheEnvValues
- whether or not to cache the current time, date,
and dateTime so they are constant for the scope
of this evaluation
ParsingException
- if a required attribute is missing, or if there
are any problems dealing with the request dataMethod Detail |
public AttributeFinder getAttributeFinder()
AttributeFinder
used by this context. Note
that this is a deprecated method and will be removed in the next
major release.
getAttributeFinder
in interface EvaluationCtx
AttributeFinder
public Node getRequestRoot()
getRequestRoot
in interface EvaluationCtx
public AttributeValue getResourceId()
getResourceId
in interface EvaluationCtx
public int getScope()
getScope
in interface EvaluationCtx
public void setResourceId(AttributeValue resourceId)
setResourceId
in interface EvaluationCtx
resourceId
- the new resource-id valuepublic TimeAttribute getCurrentTime()
setCurrentTime
, or if caching is
not enabled in this instance, then this will return null. Note that this
only applies to dynamically resolved values, not those supplied in the
Request.
getCurrentTime
in interface EvaluationCtx
public void setCurrentTime(TimeAttribute currentTime)
setCurrentTime
in interface EvaluationCtx
currentTime
- the dynamically resolved current timepublic DateAttribute getCurrentDate()
setCurrentDate
, or if caching is
not enabled in this instance, then this will return null. Note that this
only applies to dynamically resolved values, not those supplied in the
Request.
getCurrentDate
in interface EvaluationCtx
public void setCurrentDate(DateAttribute currentDate)
setCurrentDate
in interface EvaluationCtx
currentDate
- the dynamically resolved current datepublic DateTimeAttribute getCurrentDateTime()
setCurrentDateTime
, or if
caching is not enabled in this instance, then this will return null.
Note that this only applies to dynamically resolved values, not those
supplied in the Request.
getCurrentDateTime
in interface EvaluationCtx
public void setCurrentDateTime(DateTimeAttribute currentDateTime)
setCurrentDateTime
in interface EvaluationCtx
currentDateTime
- the dynamically resolved current dateTimepublic EvaluationResult getSubjectAttribute(URI type, URI id, URI category)
getSubjectAttribute
in interface EvaluationCtx
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)
getSubjectAttribute
in interface EvaluationCtx
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)
getResourceAttribute
in interface EvaluationCtx
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)
getActionAttribute
in interface EvaluationCtx
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)
getEnvironmentAttribute
in interface EvaluationCtx
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)
getAttribute
in interface EvaluationCtx
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 | |||||||||
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.