issrg.pba.rbac.xmlpolicy
Class XMLPolicyParser.DomainSpecNode

java.lang.Object
  extended by issrg.pba.rbac.xmlpolicy.PolicyXMLNode
      extended by issrg.pba.rbac.xmlpolicy.XMLPolicyParser.DomainSpecNode
Direct Known Subclasses:
XMLPolicyParser.SubjectDomainSpecNode, XMLPolicyParser.TargetDomainSpecNode
Enclosing class:
XMLPolicyParser

public class XMLPolicyParser.DomainSpecNode
extends PolicyXMLNode

This class represents the abstract DomainSpec, of which there are two extensions: SubjectDomainSpec and TargetDomainSpec. It simply creates a ComplexSubtree object and gives it a name.

Version:
1.0
Author:
A Otenko

Field Summary
static java.lang.String NODE_NAME
          This is the end of the name of the DomainSpec node.
 
Fields inherited from class issrg.pba.rbac.xmlpolicy.PolicyXMLNode
attributes, children, name, nodeStr
 
Constructor Summary
XMLPolicyParser.DomainSpecNode(java.lang.String prefix, boolean objClass, org.xml.sax.Attributes attrs)
          This constructor builds a DomainSpecNode, given the prefix in the node name ("Subject" or "Target"), the flag whether Object Classes should be expected, and the other attributes of the XML element.
 
Method Summary
 void construct()
          This method uses gatherSubtrees method to construct a ComplexSubtree representing the Domain Specification.
protected  java.util.Vector gatherSubtrees(java.util.Vector children, boolean includes)
          This method gathers all subtrees defined by the vector of nodes.
 java.lang.String getID()
          Returns the ID of the Domain.
 Subtree getSubtree()
          Returns the Subtree of this Domain specification.
 
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

NODE_NAME

public static final java.lang.String NODE_NAME
This is the end of the name of the DomainSpec node.

See Also:
Constant Field Values
Constructor Detail

XMLPolicyParser.DomainSpecNode

public XMLPolicyParser.DomainSpecNode(java.lang.String prefix,
                                      boolean objClass,
                                      org.xml.sax.Attributes attrs)
This constructor builds a DomainSpecNode, given the prefix in the node name ("Subject" or "Target"), the flag whether Object Classes should be expected, and the other attributes of the XML element.

Parameters:
prefix - - the prefix of the DomainSpec XML elements; the only meaningful values are "Subject" and "Target", but this is not checked
objClass - - the flag indicating whether ObjectClass elements are allowed in this DomainSpec; if true, they are allowed; otherwise a signal error is signaled, when such elements are encountered in XML
attrs - - the attributes of the XML element
Method Detail

construct

public void construct()
               throws PolicyParsingException
This method uses gatherSubtrees method to construct a ComplexSubtree representing the Domain Specification.

Overrides:
construct in class PolicyXMLNode
Throws:
PolicyParsingException - if any syntax or semantics error occurred

gatherSubtrees

protected java.util.Vector gatherSubtrees(java.util.Vector children,
                                          boolean includes)
                                   throws PolicyParsingException,
                                          RFC2253ParsingException,
                                          BadURLException
This method gathers all subtrees defined by the vector of nodes. It supports both nested Excludes and sequences of Include and Exclude nodes. As the result, the following construct is supported: <Include ...><Exclude .../>..</Include><Exclude .../>, where both Excludes are excluded from the same Include. The nested Excludes is the preferred method, whilst the other is kept for historic reasons.

Parameters:
children - the Vector of Include and Exclude nodes
includes - the boolean value telling whether Includes should be expected; if true, it is the first level of nodes and Includes are allowed (as well as the Excludes); otherwise, it is the second level of nodes (inside the Includes) and Includes are not allowed (whilst the Excludes are still allowed)
Throws:
PolicyParsingException
RFC2253ParsingException
BadURLException

getID

public java.lang.String getID()
Returns the ID of the Domain.


getSubtree

public Subtree getSubtree()
Returns the Subtree of this Domain specification.