issrg.pba.rbac.xmlpolicy
Class XMLPolicyParser.RoleHierarchyPolicyNode

java.lang.Object
  extended by issrg.pba.rbac.xmlpolicy.PolicyXMLNode
      extended by issrg.pba.rbac.xmlpolicy.XMLPolicyParser.RoleHierarchyPolicyNode
All Implemented Interfaces:
RoleHierarchyPolicy
Enclosing class:
XMLPolicyParser

public class XMLPolicyParser.RoleHierarchyPolicyNode
extends PolicyXMLNode
implements RoleHierarchyPolicy

This is the class that represents the RoleHierarchyPolicy node. It knows all the types and OIDs of all Role hierarchies declared in the policy.

Version:
1.0
Author:
A Otenko

Field Summary
protected  java.util.Map byOID
          This is a Map of Role hierarchies, indexed by their OID.
protected  java.util.Map byType
          This is a Map of Role hierarchies, indexed by their type.
protected  java.util.Map typeOid
           
 
Fields inherited from class issrg.pba.rbac.xmlpolicy.PolicyXMLNode
attributes, children, name, nodeStr
 
Constructor Summary
XMLPolicyParser.RoleHierarchyPolicyNode(org.xml.sax.Attributes attrs)
          This is the only constructor, and it simply creates a PolicyXMLNode of this type.
 
Method Summary
 void construct()
          This method looks through its children and rearranges them into maps of role hierarchies by type and by OID.
 XMLPolicyParser.RoleSpecNode getByOID(java.lang.String roleOID)
          This method returns a RoleSpecNode (a role hierarchy) of the given OID.
 XMLPolicyParser.RoleSpecNode getByType(java.lang.String roleType)
          This method returns a RoleSpecNode (a role hierarchy) of the given type.
 RoleHierarchyNode getRole(java.lang.String type, java.lang.String value)
          This method returns a reference to a hierarchy node for the role of the given type and value.
 java.lang.String getTypeByOID(java.lang.String roleOID)
          This method returns the role type defined for a specific OID.
 java.util.Map getTypeOid()
          This method returns a Map of types into OIDs.
 
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

byType

protected java.util.Map byType
This is a Map of Role hierarchies, indexed by their type.


byOID

protected java.util.Map byOID
This is a Map of Role hierarchies, indexed by their OID.


typeOid

protected java.util.Map typeOid
Constructor Detail

XMLPolicyParser.RoleHierarchyPolicyNode

public XMLPolicyParser.RoleHierarchyPolicyNode(org.xml.sax.Attributes attrs)
This is the only constructor, and it simply creates a PolicyXMLNode of this type.

Method Detail

construct

public void construct()
               throws PolicyParsingException
This method looks through its children and rearranges them into maps of role hierarchies by type and by OID.

Overrides:
construct in class PolicyXMLNode
Throws:
PolicyParsingException - if a semantic error is encountered (for example, two role hierarchies of the same type)

getByType

public XMLPolicyParser.RoleSpecNode getByType(java.lang.String roleType)
This method returns a RoleSpecNode (a role hierarchy) of the given type.

Parameters:
roleType - is the String name of the role type to return
Returns:
the RoleSpecNode representing the hierarchy of roles of the given type, or null, if no such type has been defined

getByOID

public XMLPolicyParser.RoleSpecNode getByOID(java.lang.String roleOID)
This method returns a RoleSpecNode (a role hierarchy) of the given OID.

Parameters:
roleOID - is the dotted representation of the OID of the role hierarchy to return
Returns:
the RoleSpecNode representing the hierarchy of roles of the given OID, or null, if no such type has been defined

getTypeByOID

public java.lang.String getTypeByOID(java.lang.String roleOID)
This method returns the role type defined for a specific OID.

Specified by:
getTypeByOID in interface RoleHierarchyPolicy
Parameters:
roleOID - - the OID in dotted form of the role type
Returns:
the role type, as declared in the policy, or null, if no role type for this OID has been declared

getRole

public RoleHierarchyNode getRole(java.lang.String type,
                                 java.lang.String value)
This method returns a reference to a hierarchy node for the role of the given type and value.

Specified by:
getRole in interface RoleHierarchyPolicy
Parameters:
type - - the type of the role, as declared in the policy
value - - the value of the role, as declared in the policy
Returns:
issrg.pba.rbac.RoleHierarchyNode that represents the role with the given value of the given type, or null, if no such type has been declared, or if there is no such value for the existing type

getTypeOid

public java.util.Map getTypeOid()
This method returns a Map of types into OIDs. The keys in the Map are the role types, as defined in the policy, and the values in the Map are the OIDs of these roles.

Specified by:
getTypeOid in interface RoleHierarchyPolicy
Returns:
a hashtable that map between type and corresponding OID