org.wso2.balana.xacml3
Class AdviceExpression

java.lang.Object
  extended by org.wso2.balana.xacml3.AdviceExpression

public class AdviceExpression
extends Object

Represents the AdviceExpressionType XML type in XACML. Advice are introduced with XACML 3


Constructor Summary
AdviceExpression(URI adviceId, int appliesTo, List<AttributeAssignmentExpression> attributeAssignmentExpressions)
          Constructor that takes all the data associated with an AdviceExpression .
 
Method Summary
 void encode(StringBuilder builder)
          Encodes this ObligationExpression into its XML form and writes this out to the provided StringBuilder
 Advice evaluate(EvaluationCtx ctx)
          return evaluation result of the advice expression
 URI getAdviceId()
          returns advice id
 int getAppliesTo()
          returns whether this is applied for permit or deny
static AdviceExpression getInstance(Node root, PolicyMetaData metaData)
          Creates an instance of AdviceExpression based on the DOM root node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdviceExpression

public AdviceExpression(URI adviceId,
                        int appliesTo,
                        List<AttributeAssignmentExpression> attributeAssignmentExpressions)
Constructor that takes all the data associated with an AdviceExpression .

Parameters:
adviceId - the advice's id
appliesTo - the effect for which this advice must be provided
attributeAssignmentExpressions - a List of AttributeAssignmentExpressions
Method Detail

getInstance

public static AdviceExpression getInstance(Node root,
                                           PolicyMetaData metaData)
                                    throws ParsingException
Creates an instance of AdviceExpression based on the DOM root node.

Parameters:
root - the DOM root of the AdviceExpressionType XML type
metaData - policy meta data
Returns:
an instance of an AdviceExpression
Throws:
ParsingException - if the structure isn't valid

getAppliesTo

public int getAppliesTo()
returns whether this is applied for permit or deny

Returns:
permit/deny

getAdviceId

public URI getAdviceId()
returns advice id

Returns:
advice id

evaluate

public Advice evaluate(EvaluationCtx ctx)
return evaluation result of the advice expression

Parameters:
ctx - EvaluationCtx
Returns:
result as Advice Object

encode

public void encode(StringBuilder builder)
Encodes this ObligationExpression 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.