issrg.pba.rbac.xmlpolicy.ifstatement
Class ArgNode

java.lang.Object
  extended by issrg.pba.rbac.xmlpolicy.PolicyXMLNode
      extended by issrg.pba.rbac.xmlpolicy.ifstatement.TermNode
          extended by issrg.pba.rbac.xmlpolicy.ifstatement.NamedTermNode
              extended by issrg.pba.rbac.xmlpolicy.ifstatement.ArgNode
All Implemented Interfaces:
Term

public class ArgNode
extends NamedTermNode

This is the class that represents an Arg node and evaluates the arguments of an action at run-time.

If the policy contains the arguments of types for which there is no constructor provided by the AEF (not registered with the Types), or the AEF failed to provide the argument with the name stated in the policy, an EvaluationException will occur at run-time.

Note that if the evaluation does not reach the point where the argument is needed, no exception will be thrown.

Author:
A.Otenko

Field Summary
static java.lang.String ARG_NODE
          This is the name of the node that represents the Arg - a reference to an argument of the action being authorised.
 
Fields inherited from class issrg.pba.rbac.xmlpolicy.ifstatement.NamedTermNode
parameter_name, s_namedTerms, type
 
Fields inherited from class issrg.pba.rbac.xmlpolicy.ifstatement.TermNode
maxOperand, minOperand, terms
 
Fields inherited from class issrg.pba.rbac.xmlpolicy.PolicyXMLNode
attributes, children, name, nodeStr
 
Constructor Summary
protected ArgNode()
           
  ArgNode(XMLPolicyParser p, org.xml.sax.Attributes attr)
          This constructor builds an ArgNode, given a XMLPolicyParser and the set of attributes of this XML element.
 
Method Summary
 java.lang.Object evaluate(Environment env)
          This method returns the value of the action argument that this element refers to.
static void register()
          This method should be called to register the node with the XML Parser
 
Methods inherited from class issrg.pba.rbac.xmlpolicy.ifstatement.NamedTermNode
getAllNamedTerms, getName, getNamedTerms, getType, resetNamedTerms
 
Methods inherited from class issrg.pba.rbac.xmlpolicy.ifstatement.TermNode
construct, getInterpretersForNode, registerInterpreterForNode
 
Methods inherited from class issrg.pba.rbac.xmlpolicy.PolicyXMLNode
addChild, addString, getAttributes, getChildren, getString, toString, toXML, toXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ARG_NODE

public static final java.lang.String ARG_NODE
This is the name of the node that represents the Arg - a reference to an argument of the action being authorised.

See Also:
Constant Field Values
Constructor Detail

ArgNode

protected ArgNode()

ArgNode

public ArgNode(XMLPolicyParser p,
               org.xml.sax.Attributes attr)
        throws PolicyParsingException
This constructor builds an ArgNode, given a XMLPolicyParser and the set of attributes of this XML element. It expects that a issrg.pba.rbac.xmlpolicy.XMLTags.TYPE_ATTRIBUTE and issrg.pba.rbac.xmlpolicy.XMLTags.NAME_ATTRIBUTE ("Type" and "Name") are present in this XML element.

Parameters:
p - - the XMLPolicyParser that builds this ArgNode
attr - - the attributes of this XML element
Throws:
PolicyParsingException
Method Detail

register

public static void register()
This method should be called to register the node with the XML Parser


evaluate

public java.lang.Object evaluate(Environment env)
                          throws EvaluationException
This method returns the value of the action argument that this element refers to. Types.construct() method is used to convert the String representation of the argument value in the Environment into a Java object.

Parameters:
env - - the Environment of the evaluation, including the arguments of the Action
Returns:
the Object, constructed from the String representation of the argument value
Throws:
EvaluationException - if the term cannot be evaluated