|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.security.xacml.sunxacml.finder.PolicyFinderModule
org.jboss.security.xacml.sunxacml.support.finder.StaticRefPolicyFinderModule
public class StaticRefPolicyFinderModule
This is a simple implementation of PolicyFinderModule that
supports retrieval based on reference, and is designed for use with a
run-time configuration. Its constructor accepts a List of
Strings that represent URLs or files, and these are resolved
to policies when the module is initialized. Beyond this, there is no
modifying or re-loading the policies represented by this class. The
policy's identifiers are used for reference resolution.
Note that this class is designed to complement
StaticPolicyFinderModule. It would be easy to support both
kinds of policy retrieval in a single class, but the functionality is
instead split between two classes. The reason is that when you define a
configuration for your PDP, it's easier to specify the two sets of policies
by using two different finder modules. Typically, there aren't many
policies that exist in both sets, so loading the sets separately isn't
a problem. If this is a concern to you, simply create your own class and
merge the two existing classes.
This module is provided as an example, but is still fully functional, and
should be useful for many simple applications. This is provided in the
support package rather than the core codebase because it
implements non-standard behavior.
| Constructor Summary | |
|---|---|
StaticRefPolicyFinderModule(List policyList)
Creates a StaticRefPolicyFinderModule that provides
access to the given collection of policies. |
|
StaticRefPolicyFinderModule(List policyList,
String schemaFile)
Creates a StaticRefPolicyFinderModule that provides
access to the given collection of policyList. |
|
| Method Summary | |
|---|---|
PolicyFinderResult |
findPolicy(URI idReference,
int type,
VersionConstraints constraints,
PolicyMetaData parentMetaData)
Attempts to find a policy by reference, based on the provided parameters. |
void |
init(PolicyFinder finder)
Initialize this module. |
boolean |
isIdReferenceSupported()
Always returns true since this module does support
finding policies based on reference. |
| Methods inherited from class org.jboss.security.xacml.sunxacml.finder.PolicyFinderModule |
|---|
findPolicy, getIdentifier, invalidateCache, isRequestSupported |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StaticRefPolicyFinderModule(List policyList)
StaticRefPolicyFinderModule that provides
access to the given collection of policies. Any policy that cannot
be loaded will be noted in the log, but will not cause an error. The
schema file used to validate policies is defined by the property
PolicyReader.POLICY_SCHEMA_PROPERTY. If the retrieved
property is null, then no schema validation will occur.
policyList - a List of Strings that
represent URLs or files pointing to XACML policies
public StaticRefPolicyFinderModule(List policyList,
String schemaFile)
StaticRefPolicyFinderModule that provides
access to the given collection of policyList.
policyList - a List of Strings that
represent URLs or files pointing to XACML policiesschemaFile - the schema file to validate policies against,
or null if schema validation is not desired| Method Detail |
|---|
public boolean isIdReferenceSupported()
true since this module does support
finding policies based on reference.
isIdReferenceSupported in class PolicyFinderModulepublic void init(PolicyFinder finder)
PolicyFinder when a PDP is created. This method is
where the policies are actually loaded.
init in class PolicyFinderModulefinder - the PolicyFinder using this module
public PolicyFinderResult findPolicy(URI idReference,
int type,
VersionConstraints constraints,
PolicyMetaData parentMetaData)
findPolicy in class PolicyFinderModuleidReference - an identifier specifying some policytype - type of reference (policy or policySet) as identified by
the fields in PolicyReferenceconstraints - any optional constraints on the version of the
referenced policy (this will never be null, but
it may impose no constraints, and in fact will
never impose constraints when used from a pre-2.0
XACML policy)parentMetaData - the meta-data from the parent policy, which
provides XACML version, factories, etc.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||