org.wso2.balana.finder.impl
Class FileBasedPolicyFinderModule

java.lang.Object
  extended by org.wso2.balana.finder.PolicyFinderModule
      extended by org.wso2.balana.finder.impl.FileBasedPolicyFinderModule

public class FileBasedPolicyFinderModule
extends PolicyFinderModule

This is file based policy repository. Policies can be inside the directory in a file system. Then you can set directory location using "org.wso2.balana.PolicyDirectory" JAVA property


Field Summary
static String POLICY_DIR_PROPERTY
           
 
Constructor Summary
FileBasedPolicyFinderModule()
           
FileBasedPolicyFinderModule(Set<String> policyLocations)
           
 
Method Summary
 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).
 void loadPolicies()
          Re-sets the policies known to this module to those contained in the given files.
 
Methods inherited from class org.wso2.balana.finder.PolicyFinderModule
getIdentifier, invalidateCache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

POLICY_DIR_PROPERTY

public static final String POLICY_DIR_PROPERTY
See Also:
Constant Field Values
Constructor Detail

FileBasedPolicyFinderModule

public FileBasedPolicyFinderModule()

FileBasedPolicyFinderModule

public FileBasedPolicyFinderModule(Set<String> policyLocations)
Method Detail

init

public void init(PolicyFinder finder)
Description copied from class: PolicyFinderModule
Initializes this module for use by the given finder. Typically this is called when a PDP 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.

Specified by:
init in class PolicyFinderModule
Parameters:
finder - the PolicyFinder using this module

findPolicy

public PolicyFinderResult findPolicy(EvaluationCtx context)
Description copied from class: PolicyFinderModule
Tries to find one and only one matching policy given the request represented by the context data. If more than one policy is found, this is an error and must be reported as such. If no policies are found, then an empty result must be returned. By default this method returns an empty result. This method should never return null.

Overrides:
findPolicy in class PolicyFinderModule
Parameters:
context - the representation of the request
Returns:
the result of looking for a matching policy

findPolicy

public PolicyFinderResult findPolicy(URI idReference,
                                     int type,
                                     VersionConstraints constraints,
                                     PolicyMetaData parentMetaData)
Description copied from class: PolicyFinderModule
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. If no policies are found, then an empty result must be returned. By default this method returns an empty result. This method should never return null.

Overrides:
findPolicy in class PolicyFinderModule
Parameters:
idReference - an identifier specifying some policy
type - type of reference (policy or policySet) as identified by the fields in PolicyReference
constraints - 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.
Returns:
the result of looking for a matching policy

isIdReferenceSupported

public boolean isIdReferenceSupported()
Description copied from class: PolicyFinderModule
Returns true if the module supports finding policies based on an id reference (in a PolicySet). By default this method returns false.

Overrides:
isIdReferenceSupported in class PolicyFinderModule
Returns:
true if idReference retrieval is supported

isRequestSupported

public boolean isRequestSupported()
Description copied from class: PolicyFinderModule
Returns true if the module supports finding policies based on a request (ie, target matching). By default this method returns false.

Overrides:
isRequestSupported in class PolicyFinderModule
Returns:
true if request retrieval is supported

loadPolicies

public void loadPolicies()
Re-sets the policies known to this module to those contained in the given files.



Copyright © 2015 WSO2. All rights reserved.