kaos.policy.enforcement
Interface EnforcerFactory

All Known Implementing Classes:
GridEnforcerFactory

public interface EnforcerFactory

This interface defines a factory method for obtaining enforcers of the specified action type. $Revision: 1.3 $


Method Summary
 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.
 

Method Detail

getInstance

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.

Parameters:
actionType - The String specifying the action type, for which an enforcer is requested.
initPlatformContext - The Object containing platform-specific parameters/objects.
initAgentContext - The Object associated with the specific instance of an agent, for which the created 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.

getInstanceForActionForAgent

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

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.