issrg.pba.rbac.xmlpolicy
Class XMLPolicyParser.DomainPolicyNode

java.lang.Object
  extended by issrg.pba.rbac.xmlpolicy.PolicyXMLNode
      extended by issrg.pba.rbac.xmlpolicy.XMLPolicyParser.DomainPolicyNode
Direct Known Subclasses:
XMLPolicyParser.SubjectDomainPolicyNode, XMLPolicyParser.TargetDomainPolicyNode
Enclosing class:
XMLPolicyParser

public class XMLPolicyParser.DomainPolicyNode
extends PolicyXMLNode

This class represents the object that can store many Subject or Target Domain specifications. As part of its operation it also constructs a collective domain of all Subjects or all Targets, so that it will be easy to determine whether an arbitrary entity is part of any domain declared in the policy.

Version:
1.0
Author:
A Otenko

Field Summary
protected  Subtree coverageDomain
           
protected  java.util.Map domains
           
static java.lang.String NODE_NAME
          This is the end of the name of a Policy XML node.
 
Fields inherited from class issrg.pba.rbac.xmlpolicy.PolicyXMLNode
attributes, children, name, nodeStr
 
Constructor Summary
XMLPolicyParser.DomainPolicyNode(java.lang.String prefix, org.xml.sax.Attributes attrs)
          This constructor builds a DomainPolicyNode given the prefix of nodes to look for ("Subject" or "Target") and the set of attributes.
 
Method Summary
 void construct()
          This method constructs a table of domains indexed by their ID and an aggregated domain that is a union of all domains.
 Subtree getCoverageDomain()
          Returns the domain covering all domains declared in this policy.
 Subtree getDomain(java.lang.String id)
          Returns the given domain; can be null, if no such domain has been specified.
 
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 a Policy XML node.

See Also:
Constant Field Values

domains

protected java.util.Map domains

coverageDomain

protected Subtree coverageDomain
Constructor Detail

XMLPolicyParser.DomainPolicyNode

public XMLPolicyParser.DomainPolicyNode(java.lang.String prefix,
                                        org.xml.sax.Attributes attrs)
This constructor builds a DomainPolicyNode given the prefix of nodes to look for ("Subject" or "Target") and the set of attributes.

Parameters:
prefix - - the prefix to use before "Policy"; meaningful values are "Subject" and "Target"
attrs - - the attributes of the XML element
Method Detail

construct

public void construct()
This method constructs a table of domains indexed by their ID and an aggregated domain that is a union of all domains. The latter is used to see if a particular entity matches any of the domains in the policy (to tell if the policy is applicable at all).

Overrides:
construct in class PolicyXMLNode

getDomain

public Subtree getDomain(java.lang.String id)
Returns the given domain; can be null, if no such domain has been specified.

Parameters:
id - is the domain id
Returns:
the Subtree object with this ID; can be null, if no such domain has been defined

getCoverageDomain

public Subtree getCoverageDomain()
Returns the domain covering all domains declared in this policy. Subject and Target domains are treated separately, so there are two coverage domains available: one for Subjects, one for Targets (query the corresponding policies).