SunTM's XACML Implementation for JavaTM

com.sun.xacml
Interface PolicyTreeElement

All Known Implementing Classes:
AbstractPolicy, Rule

public interface PolicyTreeElement

This represents a single node in a policy tree. A node is either a policy set, a policy, or a rule. This interface is used to interact with these node types in a general way. Note that rules are leaf nodes in a policy tree as they never contain children.

Since:
1.1

Method Summary
 void encode(OutputStream output)
          Encodes this element into its XML representation and writes this encoding to the given OutputStream with no indentation.
 void encode(OutputStream output, Indenter indenter)
          Encodes this element into its XML representation and writes this encoding to the given OutputStream with indentation.
 Result evaluate(EvaluationCtx context)
          Evaluates this element in the policy tree, and therefore all elements underneath this element.
 List getChildren()
          Returns the List of PolicyTreeElement objects that are the children of this node.
 String getDescription()
          Returns the given description of this element or null if there is no description
 URI getId()
          Returns the id of this element
 Target getTarget()
          Returns the target for this element or null if there is no target
 MatchResult match(EvaluationCtx context)
          Given the input context sees whether or not the request matches this element's target.
 

Method Detail

getChildren

public List getChildren()
Returns the List of PolicyTreeElement objects that are the children of this node. If this node has no children then this list is empty. The children are returned as a List instead of some unordered collection because in cases like combining or evaluation the order is often important.

Returns:
the non-null List of children of this node

getDescription

public String getDescription()
Returns the given description of this element or null if there is no description

Returns:
the description or null

getId

public URI getId()
Returns the id of this element

Returns:
the element's identifier

getTarget

public Target getTarget()
Returns the target for this element or null if there is no target

Returns:
the element's target

match

public MatchResult match(EvaluationCtx context)
Given the input context sees whether or not the request matches this element's target. The rules for matching are different depending on the type of element being matched.

Parameters:
context - the representation of the request
Returns:
the result of trying to match this element and the request

evaluate

public Result evaluate(EvaluationCtx context)
Evaluates this element in the policy tree, and therefore all elements underneath this element. The rules for evaluation are different depending on the type of element being evaluated.

Parameters:
context - the representation of the request we're evaluating
Returns:
the result of the evaluation

encode

public void encode(OutputStream output)
Encodes this element 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 element 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.