issrg.pba.rbac.xmlpolicy.ifstatement
Class PresentNode

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.OperationNode
              extended by issrg.pba.rbac.xmlpolicy.ifstatement.PresentNode
All Implemented Interfaces:
Term

public class PresentNode
extends OperationNode

This is the class for Present node of the IF-statement. Its functionality is very much determined by OperationNode and PresentInterpreter, which are configured to deliver the following semantics:

This operation expects one and only one Term, which must either be an ArgNode or EnvironmentNode and returns a value of type Types.BOOLEAN_TYPE. The evaluation result is "true", if and only if the Term refers to an argument or environmental variable that is present in the current Environment.

Author:
A.Otenko

Field Summary
static java.lang.String PRESENT_NODE
           
 
Fields inherited from class issrg.pba.rbac.xmlpolicy.ifstatement.OperationNode
interpreter, 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 PresentNode()
           
  PresentNode(XMLPolicyParser p, org.xml.sax.Attributes attrs)
          This constructor builds a PresentNode given the XMLPolicyParser and the set of attributes of this XML element.
 
Method Summary
 void construct()
          This method checks that there is only one child element in XML, and that it is of type ArgNode or EnvironmentNode to ensure the semantic correctness of XML policy.
static void register()
          Call this method to register the PresentNode with the XMLPolicyParser.
 
Methods inherited from class issrg.pba.rbac.xmlpolicy.ifstatement.OperationNode
evaluate, getType
 
Methods inherited from class issrg.pba.rbac.xmlpolicy.ifstatement.TermNode
getInterpretersForNode, registerInterpreterForNode
 
Methods inherited from class issrg.pba.rbac.xmlpolicy.PolicyXMLNode
addChild, addString, getAttributes, getChildren, getName, getString, toString, toXML, toXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PRESENT_NODE

public static final java.lang.String PRESENT_NODE
See Also:
Constant Field Values
Constructor Detail

PresentNode

protected PresentNode()

PresentNode

public PresentNode(XMLPolicyParser p,
                   org.xml.sax.Attributes attrs)
This constructor builds a PresentNode given the XMLPolicyParser and the set of attributes of this XML element. It expects that there is one and only one child node.

Parameters:
p - - the XMLPolicyParser that builds this PresentNode
attrs - - the attributes of this XML element
Method Detail

register

public static void register()
Call this method to register the PresentNode with the XMLPolicyParser. It also registers the default PresentInterpreter.


construct

public void construct()
               throws PolicyParsingException
This method checks that there is only one child element in XML, and that it is of type ArgNode or EnvironmentNode to ensure the semantic correctness of XML policy.

Overrides:
construct in class OperationNode
Throws:
PolicyParsingException - if one of the above-stated conditions is violated