SunTM's XACML Implementation for JavaTM

com.sun.xacml
Class PolicySet

java.lang.Object
  extended bycom.sun.xacml.AbstractPolicy
      extended bycom.sun.xacml.PolicySet
All Implemented Interfaces:
PolicyTreeElement

public class PolicySet
extends AbstractPolicy

Represents one of the two top-level constructs in XACML, the PolicySetType. This can contain other policies and policy sets, and can also contain URIs that point to policies and policy sets.

Since:
1.0

Field Summary
 
Fields inherited from class com.sun.xacml.AbstractPolicy
XPATH_1_0_VERSION
 
Constructor Summary
PolicySet(URI id, PolicyCombiningAlgorithm combiningAlg, String description, Target target, List policies)
          Creates a new PolicySet with the required elements plus some policies and a String description.
PolicySet(URI id, PolicyCombiningAlgorithm combiningAlg, String description, Target target, List policies, String defaultVersion)
          Creates a new PolicySet with the required elements plus some policies, a String description, and policy defaults.
PolicySet(URI id, PolicyCombiningAlgorithm combiningAlg, String description, Target target, List policies, String defaultVersion, Set obligations)
          Creates a new PolicySet with the required elements plus some policies, a String description, policy defaults, and obligations.
PolicySet(URI id, PolicyCombiningAlgorithm combiningAlg, Target target)
          Creates a new PolicySet with only the required elements.
PolicySet(URI id, PolicyCombiningAlgorithm combiningAlg, Target target, List policies)
          Creates a new PolicySet with only the required elements, plus some policies.
PolicySet(URI id, PolicyCombiningAlgorithm combiningAlg, Target target, List policies, String defaultVersion)
          Creates a new PolicySet with the required elements plus some policies and policy defaults.
 
Method Summary
 void encode(OutputStream output)
          Encodes this PolicySet into its XML representation and writes this encoding to the given OutputStream with no indentation.
 void encode(OutputStream output, Indenter indenter)
          Encodes this PolicySet into its XML representation and writes this encoding to the given OutputStream with indentation.
static PolicySet getInstance(Node root)
          Creates an instance of a PolicySet object based on a DOM node.
static PolicySet getInstance(Node root, PolicyFinder finder)
          Creates an instance of a PolicySet object based on a DOM node.
 
Methods inherited from class com.sun.xacml.AbstractPolicy
encodeCommonElements, evaluate, getChildren, getCombiningAlg, getDefaultVersion, getDescription, getId, getObligations, getTarget, match, setChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolicySet

public PolicySet(URI id,
                 PolicyCombiningAlgorithm combiningAlg,
                 Target target)
Creates a new PolicySet with only the required elements.

Parameters:
id - the policy set identifier
combiningAlg - the CombiningAlgorithm used on the policies in this set
target - the Target for this set

PolicySet

public PolicySet(URI id,
                 PolicyCombiningAlgorithm combiningAlg,
                 Target target,
                 List policies)
Creates a new PolicySet with only the required elements, plus some policies.

Parameters:
id - the policy set identifier
combiningAlg - the CombiningAlgorithm used on the policies in this set
target - the Target for this set
policies - a list of AbstractPolicy objects
Throws:
IllegalArgumentException - if the List of policies contains an object that is not an AbstractPolicy

PolicySet

public PolicySet(URI id,
                 PolicyCombiningAlgorithm combiningAlg,
                 Target target,
                 List policies,
                 String defaultVersion)
Creates a new PolicySet with the required elements plus some policies and policy defaults.

Parameters:
id - the policy set identifier
combiningAlg - the CombiningAlgorithm used on the policies in this set
target - the Target for this set
policies - a list of AbstractPolicy objects
defaultVersion - the XPath version to use
Throws:
IllegalArgumentException - if the List of policies contains an object that is not an AbstractPolicy

PolicySet

public PolicySet(URI id,
                 PolicyCombiningAlgorithm combiningAlg,
                 String description,
                 Target target,
                 List policies)
Creates a new PolicySet with the required elements plus some policies and a String description.

Parameters:
id - the policy set identifier
combiningAlg - the CombiningAlgorithm used on the policies in this set
description - a String describing the policy
target - the Target for this set
policies - a list of AbstractPolicy objects
Throws:
IllegalArgumentException - if the List of policies contains an object that is not an AbstractPolicy

PolicySet

public PolicySet(URI id,
                 PolicyCombiningAlgorithm combiningAlg,
                 String description,
                 Target target,
                 List policies,
                 String defaultVersion)
Creates a new PolicySet with the required elements plus some policies, a String description, and policy defaults.

Parameters:
id - the policy set identifier
combiningAlg - the CombiningAlgorithm used on the policies in this set
description - a String describing the policy
target - the Target for this set
policies - a list of AbstractPolicy objects
defaultVersion - the XPath version to use
Throws:
IllegalArgumentException - if the List of policies contains an object that is not an AbstractPolicy

PolicySet

public PolicySet(URI id,
                 PolicyCombiningAlgorithm combiningAlg,
                 String description,
                 Target target,
                 List policies,
                 String defaultVersion,
                 Set obligations)
Creates a new PolicySet with the required elements plus some policies, a String description, policy defaults, and obligations.

Parameters:
id - the policy set identifier
combiningAlg - the CombiningAlgorithm used on the policies in this set
description - a String describing the policy
target - the Target for this set
policies - a list of AbstractPolicy objects
defaultVersion - the XPath version to use
obligations - a set of Obligation objects
Throws:
IllegalArgumentException - if the List of policies contains an object that is not an AbstractPolicy
Method Detail

getInstance

public static PolicySet getInstance(Node root)
                             throws ParsingException
Creates an instance of a PolicySet object based on a DOM node. The node must be the root of PolicySetType XML object, otherwise an exception is thrown. This PolicySet will not support references because it has no PolicyFinder.

Parameters:
root - the DOM root of a PolicySetType XML type
Throws:
ParsingException - if the PolicySetType is invalid

getInstance

public static PolicySet getInstance(Node root,
                                    PolicyFinder finder)
                             throws ParsingException
Creates an instance of a PolicySet object based on a DOM node. The node must be the root of PolicySetType XML object, otherwise an exception is thrown. The finder is used to handle policy references.

Parameters:
root - the DOM root of a PolicySetType XML type
finder - the PolicyFinder used to handle references
Throws:
ParsingException - if the PolicySetType is invalid

encode

public void encode(OutputStream output)
Encodes this PolicySet into its XML representation and writes this encoding to the given OutputStream with no indentation.

Parameters:
output - a stream into which the XML-encoded data is written

encode

public void encode(OutputStream output,
                   Indenter indenter)
Encodes this PolicySet into its XML representation and writes this encoding to the given OutputStream with indentation.

Parameters:
output - a stream into which the XML-encoded data is written
indenter - an object that creates indentation strings

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.