gov.lanl.RAD
Class PolicyMgr

java.lang.Object
  |
  +--gov.lanl.RAD.PolicyMgr

public class PolicyMgr
extends java.lang.Object

Container for PolicyEvaluators and DecisionCombinator for both PolicyEvaluatorLocatorNameAdmin and PolicyEvaluatorLocatorBasicAdmin They are stored in a HashTable This class is a singleton because the same object serves both parent objects.

Version:
$Id: PolicyMgr.java,v 1.22 2002/04/19 19:17:30 dwforslund Exp $
Author:
$Author: dwforslund $

Method Summary
 boolean addEvaluators(org.omg.DfResourceAccessDecision.NamedPolicyEvaluator[] policy_evaluator_list, java.lang.String resourceName, java.lang.String domain)
          Add policyevaluators
 boolean addResourceName(java.lang.String resourceName, java.lang.String domain)
          Add resource Name without evaluators
 boolean checkDuplicate(org.omg.DfResourceAccessDecision.NamedPolicyEvaluator[] orig_npe, org.omg.DfResourceAccessDecision.NamedPolicyEvaluator[] policy_evaluator_list)
          Check for Duplicate Named Policy Evaluators by comparing only the evaluator_name of each
static PolicyMgr current()
          return the current PolicyMgr and create it if it doesn't exist.
 org.omg.DfResourceAccessDecision.NamedPolicyEvaluator[] deleteEvals(org.omg.DfResourceAccessDecision.NamedPolicyEvaluator[] orig_npe, org.omg.DfResourceAccessDecision.NamedPolicyEvaluator[] policy_evaluator_list)
          Delete the NamedPolicyEvalutors and return the new list
 void delEvaluators(org.omg.DfResourceAccessDecision.NamedPolicyEvaluator[] policy_evaluator_list, java.lang.String resourceName, java.lang.String domain)
          delete the evaluators from the resource
 boolean delResourceName(java.lang.String resourceName, java.lang.String domain)
          remove unused resource Name
 org.omg.DfResourceAccessDecision.DecisionCombinator getCombinator(java.lang.String resourceName, java.lang.String domain)
          Used to get reference to default DecisionCombinator.
 java.lang.String[] getDomains()
          Get a list of the domains
 org.omg.DfResourceAccessDecision.NamedPolicyEvaluator[] getEvaluators(java.lang.String resourceName, java.lang.String domain)
          Returns references to PolicyEvaluators that were stored persistently(?) Actually retrieves names from the database and gets corresponding references by calling resolve on the rootContext
static PolicyMgr getInstance(org.omg.CORBA.ORB orb, java.lang.String configFile)
          PolicyMgr is a singleton that supports PolicyEvaluatorLocatorNameAdmin, PolicyEvaluatorLocatorBasicAdmin, and PolicyEvaluatorLocatorPatternAdmin
static PolicyMgr getInstance(gov.lanl.SSLTools.ServiceInterface inService, java.lang.String configFile)
           
 java.lang.String[] getResourceNames(java.lang.String domain)
          Get list of ResourceNames stored within a given domain
static void main(java.lang.String[] argv)
          Main class to enable creation of various policy objects.
static boolean match(org.omg.DfResourceAccessDecision.ResourceNameComponent[] rnc, org.omg.DfResourceAccessDecision.ResourceNameComponent[] rncTemplate)
          compare to ResourceNameComponent[] objects using regexp with in the template expression this implements the algorithm specified in the Resource Access Decision Service specification Regexp is applied only the values, the names require an exact match
static boolean match(org.omg.DfResourceAccessDecision.ResourceName resourceInput, org.omg.DfResourceAccessDecision.ResourceName resourceTemplate)
          compare to ResourceName objects using regexp with in the template expression this implements the algorithm specified in the Resource Access Decision Service specification Regexp is applied only the values, the names require an exact match
 void populate()
          Populate the remote PolicyEvaluatorLocatorPatternAdmin object with the contents of this PolicyMgr This is useful to populate a remote RAD implementation with policy information
 void setCombinator(org.omg.DfResourceAccessDecision.DecisionCombinator decision_combinator, java.lang.String resourceName, java.lang.String domain)
          Stores reference to default DecisionCombinator persistently.
 void setEvaluators(org.omg.DfResourceAccessDecision.NamedPolicyEvaluator[] policy_evaluator_list, java.lang.String resourceName, java.lang.String domain)
          set the PolicyEvaluators attached to a resourceName in a domain
static void setNameService(gov.lanl.Utility.NameService inNs)
           
static void setOrb(org.omg.CORBA.ORB theOrb)
          set the Orb
static void setProperties(java.lang.String file)
          set the Properties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setOrb

public static void setOrb(org.omg.CORBA.ORB theOrb)
set the Orb

Parameters:
theOrb -

setProperties

public static void setProperties(java.lang.String file)
set the Properties

Parameters:
file - to read the properties from

setNameService

public static void setNameService(gov.lanl.Utility.NameService inNs)

getInstance

public static PolicyMgr getInstance(org.omg.CORBA.ORB orb,
                                    java.lang.String configFile)
PolicyMgr is a singleton that supports PolicyEvaluatorLocatorNameAdmin, PolicyEvaluatorLocatorBasicAdmin, and PolicyEvaluatorLocatorPatternAdmin


getInstance

public static PolicyMgr getInstance(gov.lanl.SSLTools.ServiceInterface inService,
                                    java.lang.String configFile)

current

public static PolicyMgr current()
return the current PolicyMgr and create it if it doesn't exist.


addResourceName

public boolean addResourceName(java.lang.String resourceName,
                               java.lang.String domain)
Add resource Name without evaluators

Parameters:
resourceName -
domain -
Returns:
boolean true if it succeeds in adding the resourceName or false if it exists already

delResourceName

public boolean delResourceName(java.lang.String resourceName,
                               java.lang.String domain)
remove unused resource Name

Parameters:
resourceName - to be removed
domain -
Returns:
boolean true if successfully removed.

setEvaluators

public void setEvaluators(org.omg.DfResourceAccessDecision.NamedPolicyEvaluator[] policy_evaluator_list,
                          java.lang.String resourceName,
                          java.lang.String domain)
set the PolicyEvaluators attached to a resourceName in a domain

Parameters:
policy_evaluator_list - the default list of PolicyEvaluators
resourceName - the ResourceName

addEvaluators

public boolean addEvaluators(org.omg.DfResourceAccessDecision.NamedPolicyEvaluator[] policy_evaluator_list,
                             java.lang.String resourceName,
                             java.lang.String domain)
                      throws org.omg.DfResourceAccessDecision.DuplicateEvaluatorName
Add policyevaluators

Parameters:
policy_evaluator_list - is list of NamedPolicyEvaluators
Returns:
boolean (true successfully added, false if not (duplicates))
org.omg.DfResourceAccessDecision.DuplicateEvaluatorName

getEvaluators

public org.omg.DfResourceAccessDecision.NamedPolicyEvaluator[] getEvaluators(java.lang.String resourceName,
                                                                             java.lang.String domain)
Returns references to PolicyEvaluators that were stored persistently(?) Actually retrieves names from the database and gets corresponding references by calling resolve on the rootContext

Parameters:
resourceName - String representation of Resource Name Component List
domain - contains resource_naming_authority
Returns:
returns a list of references to PolicyEvaluators

checkDuplicate

public boolean checkDuplicate(org.omg.DfResourceAccessDecision.NamedPolicyEvaluator[] orig_npe,
                              org.omg.DfResourceAccessDecision.NamedPolicyEvaluator[] policy_evaluator_list)
Check for Duplicate Named Policy Evaluators by comparing only the evaluator_name of each

Parameters:
orig_npe -
policy_evaluator_list -
Returns:
boolean
See Also:

delEvaluators

public void delEvaluators(org.omg.DfResourceAccessDecision.NamedPolicyEvaluator[] policy_evaluator_list,
                          java.lang.String resourceName,
                          java.lang.String domain)
delete the evaluators from the resource

Parameters:
policy_evaluator_list - of evaluators to be deleted
resourceName - containing the evaluators
domain - which the resourceName is defined

deleteEvals

public org.omg.DfResourceAccessDecision.NamedPolicyEvaluator[] deleteEvals(org.omg.DfResourceAccessDecision.NamedPolicyEvaluator[] orig_npe,
                                                                           org.omg.DfResourceAccessDecision.NamedPolicyEvaluator[] policy_evaluator_list)
Delete the NamedPolicyEvalutors and return the new list

Parameters:
orig_npe -
policy_evaluator_list -
Returns:
NamedPolicyEvaluator[] containing new list
See Also:

getCombinator

public org.omg.DfResourceAccessDecision.DecisionCombinator getCombinator(java.lang.String resourceName,
                                                                         java.lang.String domain)
Used to get reference to default DecisionCombinator. It retrieves the name stored in the hashtable and then gets corresponding reference by invoking resolve on rootContext

Parameters:
resourceName -
domain -
Returns:
DecisionCombinator for that resourceName and domain

setCombinator

public void setCombinator(org.omg.DfResourceAccessDecision.DecisionCombinator decision_combinator,
                          java.lang.String resourceName,
                          java.lang.String domain)
Stores reference to default DecisionCombinator persistently. Actually, it stores the corresponding name in Hashtable.

Parameters:
decision_combinator - the default DecisionCombinator
resourceName -
domain -

getResourceNames

public java.lang.String[] getResourceNames(java.lang.String domain)
Get list of ResourceNames stored within a given domain

Parameters:
domain -
Returns:
String[] of ResourceNames

getDomains

public java.lang.String[] getDomains()
Get a list of the domains

Returns:
String[] list of domains.

populate

public void populate()
Populate the remote PolicyEvaluatorLocatorPatternAdmin object with the contents of this PolicyMgr This is useful to populate a remote RAD implementation with policy information


match

public static boolean match(org.omg.DfResourceAccessDecision.ResourceName resourceInput,
                            org.omg.DfResourceAccessDecision.ResourceName resourceTemplate)
compare to ResourceName objects using regexp with in the template expression this implements the algorithm specified in the Resource Access Decision Service specification Regexp is applied only the values, the names require an exact match

Parameters:
resourceInput - resource to be compared to template
resourceTemplate - (contains the regexp)
Returns:
boolean result of the comparison

match

public static boolean match(org.omg.DfResourceAccessDecision.ResourceNameComponent[] rnc,
                            org.omg.DfResourceAccessDecision.ResourceNameComponent[] rncTemplate)
compare to ResourceNameComponent[] objects using regexp with in the template expression this implements the algorithm specified in the Resource Access Decision Service specification Regexp is applied only the values, the names require an exact match

Parameters:
rnc - resource to be compared to template
rncTemplate - (contains the regexp)
Returns:
boolean result of the comparison

main

public static void main(java.lang.String[] argv)
Main class to enable creation of various policy objects. Also, if specified, it will populate a remote PolicyEvaluatorLocatorPatternAdmin object.



Copyright © 2000 University of California. All Rights Reserved.