org.wso2.balana.xacml2
Class Obligation

java.lang.Object
  extended by org.wso2.balana.AbstractObligation
      extended by org.wso2.balana.xacml2.Obligation
All Implemented Interfaces:
ObligationResult

public class Obligation
extends AbstractObligation
implements ObligationResult

Represents ObligationType in the XACML 2.0 policy schema. In XACML 2.0, this element represent both in policy and result. Therefore this has extends the AbstractObligation and implements the ObligationResult


Field Summary
 
Fields inherited from class org.wso2.balana.AbstractObligation
fulfillOn, obligationId
 
Constructor Summary
Obligation(URI obligationId, int fulfillOn, List<Attribute> assignments)
          Constructor that takes all the data associated with an obligation.
 
Method Summary
 String encode()
          Encodes this Obligation into its XML form
 void encode(StringBuilder builder)
          Encodes this Obligation into its XML form and writes this out to the provided StringBuilder
 ObligationResult evaluate(EvaluationCtx ctx)
          Evaluates obligation and creates the results
 List<Attribute> getAssignments()
          Returns the attribute assignment data in this obligation.
static Obligation getInstance(Node root)
          Creates an instance of Obligation based on the DOM root node.
 
Methods inherited from class org.wso2.balana.AbstractObligation
getFulfillOn, getId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Obligation

public Obligation(URI obligationId,
                  int fulfillOn,
                  List<Attribute> assignments)
Constructor that takes all the data associated with an obligation. The attribute assignment list contains Attribute objects, but only the fields used by the AttributeAssignmentType are used.

Parameters:
obligationId - the obligation's id
fulfillOn - the effect denoting when to fulfill this obligation
assignments - a List of Attributes
Method Detail

getInstance

public static Obligation getInstance(Node root)
                              throws ParsingException
Creates an instance of Obligation based on the DOM root node.

Parameters:
root - the DOM root of the ObligationType XML type
Returns:
an instance of an obligation
Throws:
ParsingException - if the structure isn't valid

evaluate

public ObligationResult evaluate(EvaluationCtx ctx)
Description copied from class: AbstractObligation
Evaluates obligation and creates the results

Specified by:
evaluate in class AbstractObligation
Parameters:
ctx - EvaluationCtx
Returns:
ObligationResult

getAssignments

public List<Attribute> getAssignments()
Returns the attribute assignment data in this obligation. The List contains objects of type Attribute with only the correct attribute fields being used.

Returns:
the assignments

encode

public String encode()
Encodes this Obligation into its XML form

Specified by:
encode in interface ObligationResult
Returns:
String

encode

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

Specified by:
encode in interface ObligationResult
Specified by:
encode in class AbstractObligation
Parameters:
builder - string stream into which the XML-encoded data is written


Copyright © 2015 WSO2. All rights reserved.