public class FileBasedPolicyFinderModule extends PolicyFinderModule
| Modifier and Type | Field and Description |
|---|---|
static String |
POLICY_DIR_PROPERTY |
| Constructor and Description |
|---|
FileBasedPolicyFinderModule() |
FileBasedPolicyFinderModule(Set<String> policyLocations) |
| Modifier and Type | Method and Description |
|---|---|
PolicyFinderResult |
findPolicy(EvaluationCtx context)
Tries to find one and only one matching policy given the request represented by the context
data.
|
PolicyFinderResult |
findPolicy(URI idReference,
int type,
VersionConstraints constraints,
PolicyMetaData parentMetaData)
Tries to find one and only one matching policy given the idReference If more than one policy
is found, this is an error and must be reported as such.
|
void |
init(PolicyFinder finder)
Initializes this module for use by the given finder.
|
boolean |
isIdReferenceSupported()
Returns true if the module supports finding policies based on an id reference (in a
PolicySet).
|
boolean |
isRequestSupported()
Returns true if the module supports finding policies based on a request (ie, target
matching).
|
protected void |
loadPolicies()
Re-sets the policies known to this module to those contained in the
given files.
|
protected Element |
loadPolicy(String policyFile,
PolicyFinder finder)
Private helper that tries to load the given file-based policy, and
returns null if any error occurs.
|
getIdentifier, invalidateCachepublic static final String POLICY_DIR_PROPERTY
public void init(PolicyFinder finder)
PolicyFinderModulePDP is initialized with a PDPConfig containing the given
PolicyFinder. Because PolicyFinderModules usually need to parse
policies, and this requires knowing their PolicyFinder,
parsing is usually done at or after this point in the lifetime
of this module. This might also be a good time to reset any internal
caches or temporary data. Note that this method may be called more
than once in the lifetime of a module.init in class PolicyFinderModulefinder - the PolicyFinder using this modulepublic PolicyFinderResult findPolicy(EvaluationCtx context)
PolicyFinderModulefindPolicy in class PolicyFinderModulecontext - the representation of the requestpublic PolicyFinderResult findPolicy(URI idReference, int type, VersionConstraints constraints, PolicyMetaData parentMetaData)
PolicyFinderModulefindPolicy 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.public boolean isIdReferenceSupported()
PolicyFinderModuleisIdReferenceSupported in class PolicyFinderModulepublic boolean isRequestSupported()
PolicyFinderModuleisRequestSupported in class PolicyFinderModuleprotected void loadPolicies()
protected Element loadPolicy(String policyFile, PolicyFinder finder)
policyFile - file path to policyfinder - policy finderCopyright © 2019 WSO2. All rights reserved.