gov.lanl.RAD.Impl
Class RelationShipService

java.lang.Object
  |
  +--gov.lanl.RAD.Impl.RelationShipService

public class RelationShipService
extends java.lang.Object

Provide simple relationship service Define a set of roles for a user based on a ResourceName Reads in a XML file defining those relationships and initializes Hashtables for quick look up

 

Field Summary
 java.util.Hashtable users
          Hashtable that maintains patient-PCP pairs
 
Constructor Summary
RelationShipService(java.lang.String XMLFile)
          creates a new Hashtable that maintains patient-role pairs
 
Method Summary
 org.omg.Security.SecAttribute[] AddAttributes(org.omg.Security.SecAttribute[] attribute_list, org.omg.DfResourceAccessDecision.ResourceName resource)
          Updates user attributes by adding dynamic attributes which can be generated using the RelationShip data
 java.lang.String[] getResourceNames(java.lang.String user)
          Get the list of ResourceNames that have been stored
static void main(java.lang.String[] argv)
          used to test RelationShipService
 java.util.Vector matchResource(java.lang.String user, org.omg.DfResourceAccessDecision.ResourceName resource)
          Match the resource and user against the known resources for the user using regexp
 void readXML(java.lang.String fileName)
          Opens the XML file and and calls traverseTX to traverse the structure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

users

public java.util.Hashtable users
Hashtable that maintains patient-PCP pairs

Constructor Detail

RelationShipService

public RelationShipService(java.lang.String XMLFile)
creates a new Hashtable that maintains patient-role pairs

Method Detail

AddAttributes

public org.omg.Security.SecAttribute[] AddAttributes(org.omg.Security.SecAttribute[] attribute_list,
                                                     org.omg.DfResourceAccessDecision.ResourceName resource)
Updates user attributes by adding dynamic attributes which can be generated using the RelationShip data

Parameters:
attribute_list - the user's static attibutes
resource - is the ResourceName to be looked up
Returns:
returns updated attribute list

getResourceNames

public java.lang.String[] getResourceNames(java.lang.String user)
Get the list of ResourceNames that have been stored


matchResource

public java.util.Vector matchResource(java.lang.String user,
                                      org.omg.DfResourceAccessDecision.ResourceName resource)
Match the resource and user against the known resources for the user using regexp

Parameters:
user - to be looked up
resource - to be matched
Returns:
Vector of Roles connected with this Resource and User.

readXML

public void readXML(java.lang.String fileName)
Opens the XML file and and calls traverseTX to traverse the structure


main

public static void main(java.lang.String[] argv)
used to test RelationShipService