issrg.pba.rbac.xmlpolicy
Class XMLPolicyParser.ActionPolicyNode

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

public class XMLPolicyParser.ActionPolicyNode
extends PolicyXMLNode

The class representing an ActionPolicy XML node. It holds a collection of action definitions, indexed by the action name. The definitions include parameter names and order, and the return type name.

Version:
1.0
Author:
A Otenko
See Also:
getActionDefinition(String)

Field Summary
static java.lang.String ARGS_SEPARATORS
          This is the string, containing all the delimiter characters between arguments in NMTOKENS.
 
Fields inherited from class issrg.pba.rbac.xmlpolicy.PolicyXMLNode
attributes, children, name, nodeStr
 
Constructor Summary
XMLPolicyParser.ActionPolicyNode(org.xml.sax.Attributes attrs)
          This is the default constructor used by the XMLPolicyParser.
 
Method Summary
 void construct()
          This method gets information from the child nodes and sticks them in the actions map.
 java.lang.String[] getActionDefinition(java.lang.String name)
          Returns the action definition as an array of strings.
 java.lang.String[] getApplyToTargets(java.lang.String name)
          Returns an array of String of the targets this action applies to.
 java.lang.String getNameFromID(java.lang.String actionID)
          Returns the Name attribute corresponding to a given ID attribute.
 
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

ARGS_SEPARATORS

public static final java.lang.String ARGS_SEPARATORS
This is the string, containing all the delimiter characters between arguments in NMTOKENS.

See Also:
Constant Field Values
Constructor Detail

XMLPolicyParser.ActionPolicyNode

public XMLPolicyParser.ActionPolicyNode(org.xml.sax.Attributes attrs)
This is the default constructor used by the XMLPolicyParser.

Method Detail

construct

public void construct()
This method gets information from the child nodes and sticks them in the actions map. The definitions are created as specified in getActionDefinition

Overrides:
construct in class PolicyXMLNode

getActionDefinition

public java.lang.String[] getActionDefinition(java.lang.String name)
Returns the action definition as an array of strings. Can be null, if no such method has been defined. The definition is as follows: the 0-th element is the return type name, or null, if no return type has been specified; the rest of the array elements name the parameters in the order they appeared in the XML. TODO: check for duplicate parameter identifiers, when constructing?

Parameters:
name - - the action name
Returns:
an array of String, where the 0-th element is the return type and the others are types of the action parameters

getApplyToTargets

public java.lang.String[] getApplyToTargets(java.lang.String name)
Returns an array of String of the targets this action applies to.

Parameters:
name - - the action name
Returns:
an array of String target names

getNameFromID

public java.lang.String getNameFromID(java.lang.String actionID)
Returns the Name attribute corresponding to a given ID attribute.

Parameters:
actionID - the ID attribute to get the Action Name for.
Returns:
the Action Name attribute, null if the actionID is not valid