edu.uwf.kaos.coabsgrid
Class GridEnforcerFactory

java.lang.Object
  extended by edu.uwf.kaos.coabsgrid.GridEnforcerFactory
All Implemented Interfaces:
EnforcerFactory

public final class GridEnforcerFactory
extends java.lang.Object
implements EnforcerFactory


Constructor Summary
GridEnforcerFactory()
           
 
Method Summary
static EnforcerFactory getFactory()
           
 Enforcer getInstance(java.lang.String actionType, java.lang.Object initPlatformContext, java.lang.Object initAgentContext)
          Instantiate an enforcer for the specified action type.
 Enforcer getInstanceForActionForAgent(java.lang.String actionType, java.lang.String agentID)
          Instantiate an enforcer for the specified action type and agentID.
protected  void printDebugString(java.lang.String msg, int loggerDisplayLevel)
          Print debug messages.
static void setEnforcer(java.lang.String actionType, Enforcer enforcer, java.lang.String agentGUID)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridEnforcerFactory

public GridEnforcerFactory()
Method Detail

getFactory

public static EnforcerFactory getFactory()

setEnforcer

public static void setEnforcer(java.lang.String actionType,
                               Enforcer enforcer,
                               java.lang.String agentGUID)

getInstance

public Enforcer getInstance(java.lang.String actionType,
                            java.lang.Object initPlatformContext,
                            java.lang.Object initAgentContext)
                     throws EnforcerInstantiationException
Instantiate an enforcer for the specified action type. In addition to the action type, two other parameters are passed that can be used in the enforcer-creation process. The parameters describe the agent-platform and the agent-instance specific execution context.

Specified by:
getInstance in interface EnforcerFactory
Parameters:
actionType - The String specifying the action type, for which an enforcer is requested.
initPlatformContext - Not needed in this implementation.
initAgentContext - A hashtable containing the GUID of the agent associated with the requested Enforcer.
Returns:
Enforcer an instance of the requested enforcer type.
Throws:
EnforcerInstantiationException - is thrown if the instantiation of the enforcer was not successful, details will be provided in the exception's message.

getInstanceForActionForAgent

public Enforcer getInstanceForActionForAgent(java.lang.String actionType,
                                             java.lang.String agentID)
                                      throws EnforcerInstantiationException
Instantiate an enforcer for the specified action type and agentID.

Specified by:
getInstanceForActionForAgent in interface EnforcerFactory
Parameters:
actionType - The String specifying the action type, for which an enforcer is requested.
agentID - The String specifying the ID of the subject, for which the enforcer is enforcing policies.
Returns:
Enforcer an instance of the requested enforcer type, or null, if the EnforcerFactory did not have enough data to try to instantiate one.
Throws:
EnforcerInstantiationException - is thrown if the instantiation of the enforcer was not successful, details will be provided in the exception's message.

printDebugString

protected void printDebugString(java.lang.String msg,
                                int loggerDisplayLevel)
Print debug messages.