JBoss port of sunxacml 2.0.5

org.jboss.security.xacml.sunxacml
Interface EvaluationCtx

All Known Implementing Classes:
BasicEvaluationCtx

public interface EvaluationCtx

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. The BasicEvaluationCtx class provides a basic implementation that is used by default.

Since:
1.0
Author:
Seth Proctor

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.
 DateAttribute getCurrentDate()
          Returns the value for the current date as known by the PDP (if this value was also supplied in the Request, this will generally be a different value).
 DateTimeAttribute getCurrentDateTime()
          Returns the value for the current dateTime as known by the PDP (if this value was also supplied in the Request, this will generally be a different value).
 TimeAttribute getCurrentTime()
          Returns the value for the current time as known by the PDP (if this value was also supplied in the Request, this will generally be a different value).
 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 setResourceId(AttributeValue resourceId)
          Changes the value of the resource-id attribute in this context.
 

Field Detail

RESOURCE_ID

static final String RESOURCE_ID
The standard URI for listing a resource's id

See Also:
Constant Field Values

RESOURCE_SCOPE

static final String RESOURCE_SCOPE
The standard URI for listing a resource's scope

See Also:
Constant Field Values

SCOPE_IMMEDIATE

static final int SCOPE_IMMEDIATE
Resource scope of Immediate (only the given resource)

See Also:
Constant Field Values

SCOPE_CHILDREN

static final int SCOPE_CHILDREN
Resource scope of Children (the given resource and its direct children)

See Also:
Constant Field Values

SCOPE_DESCENDANTS

static final int SCOPE_DESCENDANTS
Resource scope of Descendants (the given resource and all descendants at any depth or distance)

See Also:
Constant Field Values
Method Detail

getRequestRoot

Node getRequestRoot()
Returns the DOM root of the original RequestType XML document, if this context is backed by an XACML Request. If this context is not backed by an XML representation, then an exception is thrown.

Returns:
the DOM root node
Throws:
UnsupportedOperationException - if the context is not backed by an XML representation

getScope

int getScope()
Returns the resource scope, which will be one of the three fields denoting Immediate, Children, or Descendants.

Returns:
the scope of the resource

getResourceId

AttributeValue getResourceId()
Returns the identifier for the resource being requested.

Returns:
the resource

setResourceId

void setResourceId(AttributeValue resourceId)
Changes the value of the resource-id attribute in this context. This is useful when you have multiple resources (ie, a scope other than IMMEDIATE), and you need to keep changing only the resource-id to evaluate the different effective requests.

Parameters:
resourceId - the new resource-id value

getCurrentTime

TimeAttribute getCurrentTime()
Returns the value for the current time as known by the PDP (if this value was also supplied in the Request, this will generally be a different value). Details of caching or location-based resolution are left to the underlying implementation.

Returns:
the current time

getCurrentDate

DateAttribute getCurrentDate()
Returns the value for the current date as known by the PDP (if this value was also supplied in the Request, this will generally be a different value). Details of caching or location-based resolution are left to the underlying implementation.

Returns:
the current date

getCurrentDateTime

DateTimeAttribute getCurrentDateTime()
Returns the value for the current dateTime as known by the PDP (if this value was also supplied in the Request, this will generally be a different value). Details of caching or location-based resolution are left to the underlying implementation.

Returns:
the current date

getSubjectAttribute

EvaluationResult getSubjectAttribute(URI type,
                                     URI id,
                                     URI category)
Returns available subject attribute value(s) ignoring the issuer.

Parameters:
type - the type of the attribute value(s) to find
id - the id of the attribute value(s) to find
category - the category the attribute value(s) must be in
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

getSubjectAttribute

EvaluationResult getSubjectAttribute(URI type,
                                     URI id,
                                     URI issuer,
                                     URI category)
Returns available subject attribute value(s).

Parameters:
type - the type of the attribute value(s) to find
id - the id of the attribute value(s) to find
issuer - the issuer of the attribute value(s) to find or null
category - the category the attribute value(s) must be in
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

getResourceAttribute

EvaluationResult getResourceAttribute(URI type,
                                      URI id,
                                      URI issuer)
Returns available resource attribute value(s).

Parameters:
type - the type of the attribute value(s) to find
id - the id of the attribute value(s) to find
issuer - the issuer of the attribute value(s) to find or null
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

getActionAttribute

EvaluationResult getActionAttribute(URI type,
                                    URI id,
                                    URI issuer)
Returns available action attribute value(s).

Parameters:
type - the type of the attribute value(s) to find
id - the id of the attribute value(s) to find
issuer - the issuer of the attribute value(s) to find or null
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

getEnvironmentAttribute

EvaluationResult getEnvironmentAttribute(URI type,
                                         URI id,
                                         URI issuer)
Returns available environment attribute value(s).

Note that if you want to resolve the correct current date, time, or dateTime as seen from an evaluation point of view, you should use this method and supply the corresponding identifier.

Parameters:
type - the type of the attribute value(s) to find
id - the id of the attribute value(s) to find
issuer - the issuer of the attribute value(s) to find or null
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

getAttribute

EvaluationResult getAttribute(String contextPath,
                              Node namespaceNode,
                              URI type,
                              String xpathVersion)
Returns the attribute value(s) retrieved using the given XPath expression.

Parameters:
contextPath - the XPath expression to search
namespaceNode - the DOM node defining namespace mappings to use, or null if mappings come from the context root
type - the type of the attribute value(s) to find
xpathVersion - the version of XPath to use
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

JBoss port of sunxacml 2.0.5

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.