org.wso2.balana
Interface PolicyTreeElement

All Known Implementing Classes:
AbstractPolicy, Policy, PolicyReference, PolicySet, 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
Author:
seth proctor

Method Summary
 String encode()
          Encodes this PolicyTreeElement into its XML form
 void encode(StringBuilder builder)
          Encodes this PolicyTreeElement into its XML form and writes this out to the provided StringBuilder
 AbstractResult 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
 AbstractTarget 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

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

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

Returns:
the description or null

getId

URI getId()
Returns the id of this element

Returns:
the element's identifier

getTarget

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

Returns:
the element's target

match

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

AbstractResult 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

String encode()
Encodes this PolicyTreeElement into its XML form

Returns:
String

encode

void encode(StringBuilder builder)
Encodes this PolicyTreeElement into its XML form and writes this out to the provided StringBuilder

Parameters:
builder - string stream into which the XML-encoded data is written


Copyright © 2015 WSO2. All rights reserved.