SunTM's XACML Implementation for JavaTM

com.sun.xacml.finder
Class PolicyFinder

java.lang.Object
  extended bycom.sun.xacml.finder.PolicyFinder

public class PolicyFinder
extends Object

This class is used by the PDP to find all policies used in evaluation. A PDP is given a pre-configured 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.

Since:
1.0

Constructor Summary
PolicyFinder()
           
 
Method Summary
 PolicyFinderResult findPolicy(EvaluationCtx context)
          Finds a policy based on a request's context.
 PolicyFinderResult findPolicy(URI idReference, int type)
          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()
           
 void setModules(Set modules)
          Sets the unordered Set of modules used by this class to find policies.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolicyFinder

public PolicyFinder()
Method Detail

getModules

public Set getModules()
Returns the unordered Set of modules used by this class to find policies.

Returns:
the set of modules used by this class

setModules

public void setModules(Set modules)
Sets the unordered Set of modules used by this class to find policies.

Parameters:
modules - the modules this class will use

init

public void init()

findPolicy

public PolicyFinderResult findPolicy(EvaluationCtx context)
Finds a policy based on a request's context. This may involve using the request data as indexing data to lookup a policy. This will always do a Target match to make sure that the given policy applies. If more than one applicable policy is found, this will return an error.

Parameters:
context - the representation of the request data
Returns:
the result of trying to find an applicable policy

findPolicy

public PolicyFinderResult findPolicy(URI idReference,
                                     int type)
                              throws IllegalArgumentException
Finds a policy based on an id reference. This may involve using the reference as indexing data to lookup a policy. This will always do a Target match to make sure that the given policy applies. If more than one applicable policy is found, this will return an error.

Parameters:
idReference - the identifier used to resolve a policy
type - type of reference (policy or policySet) as identified by the fields in PolicyReference
Returns:
the result of trying to find an applicable policy
Throws:
IllegalArgumentException - if type is invalid

Sun's XACML Implementation Version 1.2

Copyright 2003-2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

Sun, Sun Microsystems, the Sun Logo, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.