nbi.xmlsec.xacml.profile.rbac.finder
Class RBACPolicyFinderModule

java.lang.Object
  extended bycom.sun.xacml.finder.PolicyFinderModule
      extended bynbi.xmlsec.xacml.profile.rbac.finder.RBACPolicyFinderModule
Direct Known Subclasses:
PDPPolicyFinderModule, REAPolicyFinderModule

public class RBACPolicyFinderModule
extends PolicyFinderModule

Implementation of the standard policy finder module for the RBAC profile.

Since:
Version:
$Revision: 1.7 $
Author:
Lutz Suhrbier

Field Summary
protected  Configuration configuration
          Configuration part PolicyFinderModule for this module
private static Logger logger
           
protected  Set policies
          The policy store of this policy Finder
protected  PolicyFinder policyFinder
          PolicyFinder initialised with this module
 
Constructor Summary
RBACPolicyFinderModule(Configuration config)
           
 
Method Summary
protected  PolicyFinderResult createErrorResult(String code, String message)
          Creates a PolicyFinderResultinstance with a single code and message.
 PolicyFinderResult findPolicy(EvaluationCtx context)
          Simply copied from FilePolicyModule.findPolicy(EvaluationCtx).
 PolicyFinderResult findPolicy(URI idReference, int type)
          Tries to find a policy based on the Identifierbuilt from the idReference parameter.
 String getDomain()
          Retrieves the domain from the current configuration.
static IOFileFilter getFileFilter(Configuration config, IOFileFilter defaultFilter)
          Retrieves a FileFilter bases on the file suffixes in the configuration.
 String getPolicyBaseDir()
          Retrieves the policy base directory from the current configuration.
 IOFileFilter getPolicyFileFilter()
          Retrieves a FileFilter bases on the file suffixes of the configuration.
 void init(PolicyFinder finder)
          Inits this PolicyFinder loading all policy files with the given file suffixes from all subdirectories of the policy base dir.
 boolean isIdReferenceSupported()
          Signals that this policy finder module supports policy references.
 boolean isRequestSupported()
          Signals that this policy finder module supports request.
static List loadPolicies(File policyDir, IOFileFilter filter, PolicyFinder finder)
          Loads policies from a given directory.
 void setDomain(String domain)
          Sets the domain in the current configuration.
 void setPolicyBaseDir(String policyBaseDir)
          Sets the policy base directory in the current configuration.
 
Methods inherited from class com.sun.xacml.finder.PolicyFinderModule
getIdentifier, invalidateCache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final Logger logger

policyFinder

protected PolicyFinder policyFinder
PolicyFinder initialised with this module


configuration

protected Configuration configuration
Configuration part PolicyFinderModule for this module


policies

protected Set policies
The policy store of this policy Finder

Constructor Detail

RBACPolicyFinderModule

public RBACPolicyFinderModule(Configuration config)
Parameters:
config - Configuration of the type PolicyFinderModule for this module.
Method Detail

loadPolicies

public static List loadPolicies(File policyDir,
                                IOFileFilter filter,
                                PolicyFinder finder)
Loads policies from a given directory. This method misses out policies, where loadPolicy(String, PolicyFinder) returns null.

Parameters:
policyDir - The directory to search for policies.
filter - The IOFileFilterto select policy files.
finder - The PolicyFinderto find policies.
Returns:
Set with all policies retrieved, which may be empty.

getFileFilter

public static IOFileFilter getFileFilter(Configuration config,
                                         IOFileFilter defaultFilter)
Retrieves a FileFilter bases on the file suffixes in the configuration. TODO: Add further FileFilter types, if needed.

Returns:
SuffixFileFilter, if suffixes are configured, otherwise TrueFileFilter.

init

public void init(PolicyFinder finder)
Inits this PolicyFinder loading all policy files with the given file suffixes from all subdirectories of the policy base dir.

See Also:
PolicyFinderModule.init(PolicyFinder)

findPolicy

public PolicyFinderResult findPolicy(EvaluationCtx context)
Simply copied from FilePolicyModule.findPolicy(EvaluationCtx).

See Also:
FilePolicyModule.findPolicy(EvaluationCtx)

isRequestSupported

public boolean isRequestSupported()
Signals that this policy finder module supports request.

See Also:
PolicyFinderModule.isIdReferenceSupported()

createErrorResult

protected PolicyFinderResult createErrorResult(String code,
                                               String message)
Creates a PolicyFinderResultinstance with a single code and message.

Parameters:
code - The status code string (see Status.
message - The error message.
Returns:
PolicyFinderResultwith Status.

findPolicy

public PolicyFinderResult findPolicy(URI idReference,
                                     int type)
Tries to find a policy based on the Identifierbuilt from the idReference parameter. Errors are documentated in the Status of the PolicyFinderResultreturn value.

See Also:
PolicyFinderModule.findPolicy(URI, int)

isIdReferenceSupported

public boolean isIdReferenceSupported()
Signals that this policy finder module supports policy references.

See Also:
PolicyFinderModule.isIdReferenceSupported()

getPolicyBaseDir

public String getPolicyBaseDir()
Retrieves the policy base directory from the current configuration.

Returns:
The base directory for all policies.

setPolicyBaseDir

public void setPolicyBaseDir(String policyBaseDir)
Sets the policy base directory in the current configuration.

Parameters:
policyBaseDir - The base directory for all policies.

getDomain

public String getDomain()
Retrieves the domain from the current configuration.

Returns:
The domain label for all policies to find.

setDomain

public void setDomain(String domain)
Sets the domain in the current configuration.

Parameters:
domain - The domain label for all policies to find.

getPolicyFileFilter

public IOFileFilter getPolicyFileFilter()
Retrieves a FileFilter bases on the file suffixes of the configuration.

Returns:
SuffixFileFilter, if suffixes are configured, otherwise TrueFileFilter.


Copyright © 2006 Lutz Suhrbier, Freie Universität Berlin. All Rights Reserved.