issrg.pba.rbac.xmlpolicy
Class XMLPolicyParser.RoleAssignmentPolicyNode

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

public class XMLPolicyParser.RoleAssignmentPolicyNode
extends PolicyXMLNode

This node implements the RoleAssignmentPolicy XML node. It is intelligent enough to walk through its children and retrieve all the information to build an index of AssignmentRule vectors by SOA DNs.

Version:
1.0
Author:
A Otenko

Field Summary
static int ABSOLUTE_VALIDITY_NODE_SEQUENCE
           
static int AGE_VALIDITY_NODE_SEQUENCE
           
static int DELEGATE_NODE_SEQUENCE
           
static int MAXIMUM_VALIDITY_NODE_SEQUENCE
           
static int MINIMUM_VALIDITY_NODE_SEQUENCE
           
static int ROLE_LIST_NODE_SEQUENCE
           
protected  java.util.Map rules
          This is where the final rules are stored, indexed by SOA DN.
static int SOA_NODE_SEQUENCE
           
static int SUBJECT_DOMAIN_NODE_SEQUENCE
          These numbers are the position of the nodes under the RoleAssignment node.
static int VALIDITY_NODE_SEQUENCE
           
 
Fields inherited from class issrg.pba.rbac.xmlpolicy.PolicyXMLNode
attributes, children, name, nodeStr
 
Constructor Summary
XMLPolicyParser.RoleAssignmentPolicyNode(org.xml.sax.Attributes attrs)
          This constructor builds a RoleAssingmentPolicyNode, given the attributes of the XML element.
XMLPolicyParser.RoleAssignmentPolicyNode(XMLPolicyParser.DomainPolicyNode subjectPolicy, XMLPolicyParser.SOAPolicyNode soaPolicy, org.xml.sax.Attributes attrs)
          This constructor builds the object from explicitly specified Subject Policy, SOA Policy and the attributes of the XML element.
 
Method Summary
 void construct()
          This method finishes the construction of the Role Assignment Policy.
 java.util.Map getRules()
          This method returns the rules defined by the appropriate XML node.
protected  RelativeDate parseDateTime(java.lang.String s)
          This routine parses the string in format ccyy-mm-ddThh:mm:ss and separates it into the integers.
 
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

SUBJECT_DOMAIN_NODE_SEQUENCE

public static final int SUBJECT_DOMAIN_NODE_SEQUENCE
These numbers are the position of the nodes under the RoleAssignment node.

See Also:
Constant Field Values

ROLE_LIST_NODE_SEQUENCE

public static final int ROLE_LIST_NODE_SEQUENCE
See Also:
Constant Field Values

DELEGATE_NODE_SEQUENCE

public static final int DELEGATE_NODE_SEQUENCE
See Also:
Constant Field Values

SOA_NODE_SEQUENCE

public static final int SOA_NODE_SEQUENCE
See Also:
Constant Field Values

VALIDITY_NODE_SEQUENCE

public static final int VALIDITY_NODE_SEQUENCE
See Also:
Constant Field Values

ABSOLUTE_VALIDITY_NODE_SEQUENCE

public static final int ABSOLUTE_VALIDITY_NODE_SEQUENCE
See Also:
Constant Field Values

AGE_VALIDITY_NODE_SEQUENCE

public static final int AGE_VALIDITY_NODE_SEQUENCE
See Also:
Constant Field Values

MAXIMUM_VALIDITY_NODE_SEQUENCE

public static final int MAXIMUM_VALIDITY_NODE_SEQUENCE
See Also:
Constant Field Values

MINIMUM_VALIDITY_NODE_SEQUENCE

public static final int MINIMUM_VALIDITY_NODE_SEQUENCE
See Also:
Constant Field Values

rules

protected java.util.Map rules
This is where the final rules are stored, indexed by SOA DN.

Constructor Detail

XMLPolicyParser.RoleAssignmentPolicyNode

public XMLPolicyParser.RoleAssignmentPolicyNode(org.xml.sax.Attributes attrs)
This constructor builds a RoleAssingmentPolicyNode, given the attributes of the XML element. It uses the Subject Policy and SOA Policy constructed by XMLPolicyParser, so these must already be known at the time of constructing the object.

Parameters:
attrs - - the attributes of this XML element

XMLPolicyParser.RoleAssignmentPolicyNode

public XMLPolicyParser.RoleAssignmentPolicyNode(XMLPolicyParser.DomainPolicyNode subjectPolicy,
                                                XMLPolicyParser.SOAPolicyNode soaPolicy,
                                                org.xml.sax.Attributes attrs)
This constructor builds the object from explicitly specified Subject Policy, SOA Policy and the attributes of the XML element.

Parameters:
subjectPolicy - - the Subject Policy to be used
soaPolicy - - the SOA Policy to be used
attrs - - the attributes of this XML element
Method Detail

construct

public void construct()
               throws PolicyParsingException
This method finishes the construction of the Role Assignment Policy. During this process it checks that the right XML statements appear in the policy and in the correct sequence. It checks that the SOA and the Subject domain with the specified IDs have been declared in the corresponding policies.

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

getRules

public java.util.Map getRules()
This method returns the rules defined by the appropriate XML node. The rules contain Vectors of issrg.pba.rbac.policies.AssignmentRule objects, indexed by the SOA name. There also is a special entry with the key issrg.pba.rbac.policies.Subtree.class: its value is a issrg.pba.rbac.policies.Subtree of the coverage domain of the Subject Policy.


parseDateTime

protected RelativeDate parseDateTime(java.lang.String s)
This routine parses the string in format ccyy-mm-ddThh:mm:ss and separates it into the integers. The syntax is not strict, so any nymber of subsequent digits is allowed, and any non-digit characters can be used as separators (the parser does not ensure the separators are "-", "T", ":", and that they are used in that order).

Examples:

"00000002~73|1" is parsed as year 2, month 73, day 1. Note that the actual meaning depends on where this statement is used. If it is the Absolute date specification, then it is equal to "8-1-1" (73 months is the same as 6 more years and 1 month).

"2002-12-31T12:00:21:567" - the last term ":567" is ignored.

Parameters:
s - is the string of format "ccyy-mm-ddThh:mm:ss" to parse
Returns:
a RelativeDate object with appropriate integers assigned