public class PolicyFinder extends Object
PolicyFinder on construction.
The PolicyFinder provides the functionality both to find
policies based on a request (ie, retrieve policies and match against the
target) and based on an idReference (as can be included in a PolicySet).
While this class is typically used by the PDP, it is intentionally
designed to support stand-alone use, so it could be the base for a
distributed service, or for some application that needs just this
functionality. There is nothing in the PolicyFinder
Note that it is an error to have more than one top-level policy (as
explained in the OnlyOneApplicable combining algorithm), so any module
that is added to this finder will be evaluated each time a policy is
requested. This means that you should think carefully about how many
modules you include, and how they can cache policy data.
| Constructor and Description |
|---|
PolicyFinder() |
| Modifier and Type | Method and Description |
|---|---|
PolicyFinderResult |
findPolicy(EvaluationCtx context)
Finds a policy based on a request's context.
|
PolicyFinderResult |
findPolicy(URI idReference,
int type,
VersionConstraints constraints,
PolicyMetaData parentMetaData)
Finds a policy based on an id reference.
|
Set |
getModules()
Returns the unordered
Set of modules used by this class
to find policies. |
void |
init()
Initializes all modules in this finder.
|
void |
setModules(Set modules)
Sets the unordered
Set of modules used by this class
to find policies. |
public Set getModules()
Set of modules used by this class
to find policies.public void setModules(Set modules)
Set of modules used by this class
to find policies.modules - the modules this class will usepublic void init()
public PolicyFinderResult findPolicy(EvaluationCtx context)
context - the representation of the request datapublic PolicyFinderResult findPolicy(URI idReference, int type, VersionConstraints constraints, PolicyMetaData parentMetaData) throws IllegalArgumentException
idReference - the identifier used to resolve a policytype - type of reference (policy or policySet) as identified by
the fields in PolicyReferenceconstraints - any optional constraints on the version of the
referenced policyparentMetaData - the meta-data from the parent policy, which
provides XACML version, factories, etc.IllegalArgumentException - if type is invalidCopyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.