issrg.pba.rbac.xmlpolicy
Class XMLPolicyParser.RoleSpecNode

java.lang.Object
  extended by issrg.pba.rbac.xmlpolicy.PolicyXMLNode
      extended by issrg.pba.rbac.xmlpolicy.XMLPolicyParser.RoleSpecNode
Enclosing class:
XMLPolicyParser

public class XMLPolicyParser.RoleSpecNode
extends PolicyXMLNode

This class is the implementation of the RoleSpec XML node. It encapsulates one directed graph, which is a hierarchy of roles of the same type.

It knows the RoleType it represents and the OID of the Role it represents. It also knows all the roles that are defined in the SupRole nodes embedded.

Version:
1.0
Author:
A Otenko

Field Summary
protected  java.lang.String oid
           
protected  java.util.Map roles
          This is where the roles are mapped.
protected  java.lang.String type
          The following two characterise this Role Hierarchy.
 
Fields inherited from class issrg.pba.rbac.xmlpolicy.PolicyXMLNode
attributes, children, name, nodeStr
 
Constructor Summary
XMLPolicyParser.RoleSpecNode(org.xml.sax.Attributes attrs)
          This constructor builds a RoleSpecNode given a set of attributes of the XML element.
 
Method Summary
 void construct()
          This method creates the map of roles, derived from the collection of children of this node; it assumes all of them are RoleHierarchyNodes.
 java.lang.String getOID()
          Apparently, this method returns the Role OID value.
 XMLPolicyParser.RoleHierarchyNode getRole(java.lang.String value)
          This method returns a RoleHierarchy node of the needed Value.
 java.lang.String getType()
          This method returns the RoleType value.
 
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

type

protected java.lang.String type
The following two characterise this Role Hierarchy.


oid

protected java.lang.String oid

roles

protected java.util.Map roles
This is where the roles are mapped.

Constructor Detail

XMLPolicyParser.RoleSpecNode

public XMLPolicyParser.RoleSpecNode(org.xml.sax.Attributes attrs)
This constructor builds a RoleSpecNode given a set of attributes of the XML element.

Method Detail

construct

public void construct()
               throws PolicyParsingException
This method creates the map of roles, derived from the collection of children of this node; it assumes all of them are RoleHierarchyNodes.

This method also triggers the hierarchy optimisation algorithm, which will detect loops in the role hierarchy and assign levels to the Role Hierarchy nodes so that in some cases it will be easy to tell if two roles are hierarchically related.

Overrides:
construct in class PolicyXMLNode
Throws:
PolicyParsingException, - if a semantics error has been encountered; for example, two roles with the same ID have been defined
PolicyParsingException - if any syntax or semantics error occurred

getRole

public XMLPolicyParser.RoleHierarchyNode getRole(java.lang.String value)
This method returns a RoleHierarchy node of the needed Value.

Parameters:
value - - the value of the role, as defined in the policy
Returns:
RoleHierarchyNode corresponding to the role, or null, if no such role exists

getType

public java.lang.String getType()
This method returns the RoleType value.


getOID

public java.lang.String getOID()
Apparently, this method returns the Role OID value. The value is in dotted form.