springs.rns
Interface RegionNameServerInterface

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
RegionNameServer_RMIImpl

public interface RegionNameServerInterface
extends java.rmi.Remote

An interface to the Region Name Server.

Author:
Sergio Ilarri Artigas

Method Summary
 java.util.Vector addAgent(java.lang.String agentName, springs.context.ContextAddress ca)
          Adds a new agent to the region.
 java.util.Hashtable addContext(springs.context.ContextAddress ca)
          Adds a new context to the region.
 springs.rns.SearchingInformation getSearchingInformation(java.lang.String agentName, springs.context.ContextAddress ca)
          Obtains the searching information for an agent.
 void printAgents()
          Prints the agents registered.
 void printContexts()
          Prints the contexts registered.
 void printLocationServersFor(java.lang.String agentName)
          Prints the contexts that are location servers for the given agent.
 void removeAgent(java.lang.String agentName, springs.context.ContextAddress ca)
          Removes an agent from the region.
 void removeContext(java.lang.String cn, java.util.Collection localAgents)
          Removes a new context to the region.
 

Method Detail

addContext

public java.util.Hashtable addContext(springs.context.ContextAddress ca)
                               throws AlreadyExistingContextException,
                                      java.rmi.RemoteException
Adds a new context to the region.

Parameters:
ca - the address of the context to add.
Returns:
the contexts in the system.
Throws:
ContextAlreadyExistingException - if the context already exists.
AlreadyExistingContextException
java.rmi.RemoteException
See Also:
Hashtable, ContextAddress, AlreadyExistingContextException

removeContext

public void removeContext(java.lang.String cn,
                          java.util.Collection localAgents)
                   throws PermissionException,
                          java.rmi.RemoteException
Removes a new context to the region.

Parameters:
cn - the name of the context to remove.
localAgents - the agents executing on the given context.
Throws:
PermissionException - if the operation cannot be performed.
java.rmi.RemoteException
See Also:
String, PermissionException

addAgent

public java.util.Vector addAgent(java.lang.String agentName,
                                 springs.context.ContextAddress ca)
                          throws AlreadyExistingAgentException,
                                 PermissionException,
                                 java.rmi.RemoteException
Adds a new agent to the region.

Parameters:
agentName - the name of the agent.
ca - the address of the context where the agent is created.
Returns:
the vector with the contexts that are assigned for tracking the agent.
Throws:
AlreadyExistingAgentException - if the agent already exists.
PermissionException - if the operation cannot be performed.
java.rmi.RemoteException
See Also:
Vector, String, ContextAddress, AlreadyExistingAgentException, PermissionException

removeAgent

public void removeAgent(java.lang.String agentName,
                        springs.context.ContextAddress ca)
                 throws PermissionException,
                        java.rmi.RemoteException
Removes an agent from the region.

Parameters:
agentName - the name of the agent.
ca - the address of the context that requests the operation.
Throws:
PermissionException - if the operation cannot be performed.
java.rmi.RemoteException
See Also:
String, ContextAddress, PermissionException

getSearchingInformation

public springs.rns.SearchingInformation getSearchingInformation(java.lang.String agentName,
                                                                springs.context.ContextAddress ca)
                                                         throws AgentNotFoundException,
                                                                PermissionException,
                                                                java.rmi.RemoteException
Obtains the searching information for an agent.

Parameters:
agentName - the name of the agent.
ca - the address of the context that requests the operation.
Returns:
the searching information.
Throws:
PermissionException - if the operation cannot be performed.
AgentNotFoundException - if the agent cannot be found.
java.rmi.RemoteException
See Also:
SearchingInformation, String, ContextAddress, PermissionException, AgentNotFoundException

printLocationServersFor

public void printLocationServersFor(java.lang.String agentName)
                             throws java.rmi.RemoteException
Prints the contexts that are location servers for the given agent.

Parameters:
agentName - the name of the agent.
java.rmi.RemoteException
See Also:
String

printAgents

public void printAgents()
                 throws java.rmi.RemoteException
Prints the agents registered.

java.rmi.RemoteException

printContexts

public void printContexts()
                   throws java.rmi.RemoteException
Prints the contexts registered.

java.rmi.RemoteException