com.agentfactory.cldc.p2pmig
Class P2PMigrationManager

java.lang.Object
  extended by com.agentfactory.cldc.Service
      extended by com.agentfactory.cldc.p2pmig.P2PMigrationManager
All Implemented Interfaces:
java.lang.Runnable

public class P2PMigrationManager
extends Service
implements java.lang.Runnable

The peer to peer migration manager is a service that is responsible for controlling the migration process in a peer to peer manner. The original migration manner was designed for use in 3G and GPRS environments, whereby service providers operate firewalls. With the peer to peer migration service, agents migrate directly from platform to platform, not via an intermediary server.

Author:
Conor Muldoon

Constructor Summary
P2PMigrationManager(java.lang.String[] s, AgentName[] an, Scheduler scheduler, MigrationPlatform platform)
          Creates a new instance of P2PMigrationService.
 
Method Summary
 void modifyBinding(java.lang.Object oldName, java.lang.Object newName)
          Changes the name of an agent in the service's registry if one exists.
 FOS processAction(AgentName agentName, int actionID, FOS data)
          Add the agent with the specified name to the outgoing list.
 FOS processPer(AgentName agentName, int perceptionID)
          Perceives information from within the service.
 void run()
          Sends outgoing agents to their target platforms.
 
Methods inherited from class com.agentfactory.cldc.Service
register
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

P2PMigrationManager

public P2PMigrationManager(java.lang.String[] s,
                           AgentName[] an,
                           Scheduler scheduler,
                           MigrationPlatform platform)
Creates a new instance of P2PMigrationService.

Parameters:
s - arguments to the migration service.
an - the names of the agents on the platform.
scheduler - the schduler periodically executes the run method of the MigrationManager.
platform - the local migration platform, on which the agents reside.
Method Detail

modifyBinding

public void modifyBinding(java.lang.Object oldName,
                          java.lang.Object newName)
Description copied from class: Service
Changes the name of an agent in the service's registry if one exists.

Specified by:
modifyBinding in class Service
Parameters:
oldName - the old name of the agent.
newName - the new name of the agent.

processPer

public FOS processPer(AgentName agentName,
                      int perceptionID)
Description copied from class: Service
Perceives information from within the service.

Specified by:
processPer in class Service
Parameters:
agentName - the agent that wishes to perceive the information.
perceptionID - the ID of the information that is to be perceived.
Returns:
a first order structure that represents the information that has been perceived in the service.

processAction

public FOS processAction(AgentName agentName,
                         int actionID,
                         FOS data)
Add the agent with the specified name to the outgoing list.

Specified by:
processAction in class Service
Parameters:
agentName - the name of the agent to be added to the outgoing list.
actionID - the actionID is not used in this instance of processAction.
data - represents the destination and design URL of the agent.
Returns:
true if the action was performed successfully, false otherwise.

run

public void run()
Sends outgoing agents to their target platforms.

Specified by:
run in interface java.lang.Runnable