org.dbe.eve.net
Class NetworkManagerImpl

java.lang.Object
  extended by org.dbe.eve.net.NetworkManagerImpl
All Implemented Interfaces:
NetworkManager

public class NetworkManagerImpl
extends java.lang.Object
implements NetworkManager

Author:
cmasuch

Field Summary
 org.apache.log4j.Logger logger
           
 
Constructor Summary
NetworkManagerImpl(HabitatService habitat)
           
 
Method Summary
 void configureNetwork(java.lang.String homeDir)
           
 HabitatService connect(java.lang.String nodeId)
           
 void findNewHabitats()
           
 ConnectionPool getConnectionPool()
          Returns the connectionPool of this habitat
 ServicePool getImportedPool()
           
 int getNumberOfConnections()
           
 SMHandler getSMHandler()
           
 void importEvEServicePool(java.lang.String smid)
          This method is to import the while ServicePool of a given HabitatService
 ServicePool importServicesFromSR(java.lang.String srAdress)
           
 void init()
           
 void migrate(EvEService service, java.lang.String targetHabitatId)
          Method for targeted migration.
 java.lang.String readFile(java.lang.String filename)
           
 void receive(EvEService service)
          This method is usually called by the HabitatService.
 void send(EvEService service)
          Triggers the random migration of the provided service to all connected habitats.
 void setImportedPool(ServicePool importedPool)
           
 void writeFile(java.lang.String filename, java.lang.String data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public org.apache.log4j.Logger logger
Constructor Detail

NetworkManagerImpl

public NetworkManagerImpl(HabitatService habitat)
Method Detail

init

public void init()

connect

public HabitatService connect(java.lang.String nodeId)

send

public void send(EvEService service)
Description copied from interface: NetworkManager
Triggers the random migration of the provided service to all connected habitats.

Specified by:
send in interface NetworkManager
Parameters:
service - The service to migrate to connect habitats

receive

public void receive(EvEService service)
Description copied from interface: NetworkManager
This method is usually called by the HabitatService. Here, a "gatekeeper" function to "test" a service before it is added to the service pool can be envisioned.

Specified by:
receive in interface NetworkManager
Parameters:
service - The service to be added to the pool

findNewHabitats

public void findNewHabitats()

importEvEServicePool

public void importEvEServicePool(java.lang.String smid)
This method is to import the while ServicePool of a given HabitatService

Parameters:
smid - ID of the habitat to import the pool from

importServicesFromSR

public ServicePool importServicesFromSR(java.lang.String srAdress)

configureNetwork

public void configureNetwork(java.lang.String homeDir)

readFile

public java.lang.String readFile(java.lang.String filename)

writeFile

public void writeFile(java.lang.String filename,
                      java.lang.String data)

getNumberOfConnections

public int getNumberOfConnections()

getConnectionPool

public ConnectionPool getConnectionPool()
Description copied from interface: NetworkManager
Returns the connectionPool of this habitat

Specified by:
getConnectionPool in interface NetworkManager
Returns:
ConnectionPool

getSMHandler

public SMHandler getSMHandler()

getImportedPool

public ServicePool getImportedPool()

setImportedPool

public void setImportedPool(ServicePool importedPool)

migrate

public void migrate(EvEService service,
                    java.lang.String targetHabitatId)
Description copied from interface: NetworkManager
Method for targeted migration. To be called from sub-components like the DIS, etc. The target habitat does not have to be known (see ConnectionPool). However, after a successful migration the target habitat is added to the ConnectionPool.

Specified by:
migrate in interface NetworkManager
Parameters:
service - The Service to be migrated
targetHabitatId - The habitat where it goes to.