com.agentfactory.platform.service
Class SecurityModule

java.lang.Object
  extended by com.agentfactory.platform.service.SecurityModule

public class SecurityModule
extends java.lang.Object

This class implements a security model for the platform services. It associates each service with a unique policy that is specified via the AFPolicy class.


Constructor Summary
SecurityModule(java.util.Vector policies)
          Creates a new instance of SecurityModule
 
Method Summary
 void addGlobalPolicy(java.lang.String service, int right)
           
 void addPolicy(Agent agent, java.lang.String service, int right)
          Adds an agent right to a service policy.
 void addPolicy(java.lang.String name, java.lang.String service, int right)
          Adds an agent right to a service policy.
 boolean hasAccess(java.lang.String agent, java.lang.String service)
          This method checks whether or not an agent has access to a service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityModule

public SecurityModule(java.util.Vector policies)
Creates a new instance of SecurityModule

Method Detail

hasAccess

public boolean hasAccess(java.lang.String agent,
                         java.lang.String service)
This method checks whether or not an agent has access to a service. To achieve this, it locates the relevant security policy and checks that policy. If no policy exists, then the default response is that the agent has access to the service.

Parameters:
agent - the name of the agent that is requesting the service
service - the service being requested

addPolicy

public void addPolicy(Agent agent,
                      java.lang.String service,
                      int right)
Adds an agent right to a service policy. If no policy currently exists for the service, then the agent creates a new policy whose global right is DENY. Here the agent is specified by a reference to the underlying agent object. This should be used only for the creation of the System Agents.

Parameters:
agent - the agent that will be given the right
service - the service they associated with the right.
right - the right they are given

addPolicy

public void addPolicy(java.lang.String name,
                      java.lang.String service,
                      int right)
Adds an agent right to a service policy. If no policy currently exists for the service, then the agent creates a new policy whose global right is DENY. Here the agent is specified by the name of the agent.

Parameters:
name - the agent that will be given the right
service - the service they associated with the right.
right - the right they are given

addGlobalPolicy

public void addGlobalPolicy(java.lang.String service,
                            int right)