uk.ac.ic.doc.automed.p2p.overlay
Class OverlayController

java.lang.Object
  extended by uk.ac.ic.doc.automed.p2p.overlay.OverlayController

public class OverlayController
extends java.lang.Object

OverlayController.java

The main class reponsible for establishing a new [contacting an existing] overlay network.

Author:
Duc M Le dmle@doc.ic.ac.uk
Created on August 14, 2006
Department of Computing, Imperial College

Field Summary
static int DEF_NUM_HOSTS
           
static java.lang.String STAT_COLLECTOR_ADDRESS_AND_PORT
           
static long WAIT_BEFORE_ACCESS
           
 
Method Summary
static OverlayController getInstance(int numHosts)
           
static OverlayController getInstance(int startNum, int numHosts)
           
 int getNumHosts()
           
 java.lang.String[] getVirtualHosts()
           
 ow.dht.DHT startProcess(ow.id.ID key, java.lang.String joinHost, java.lang.String selfHost)
          Start a DHT host with a pre-configured ID
static void waitBeforeAccess()
          Wait a bit before access (call this method before each call to put() inside a loop)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEF_NUM_HOSTS

public static final int DEF_NUM_HOSTS
See Also:
Constant Field Values

WAIT_BEFORE_ACCESS

public static final long WAIT_BEFORE_ACCESS
See Also:
Constant Field Values

STAT_COLLECTOR_ADDRESS_AND_PORT

public static final java.lang.String STAT_COLLECTOR_ADDRESS_AND_PORT
See Also:
Constant Field Values
Method Detail

getInstance

public static OverlayController getInstance(int numHosts)

getInstance

public static OverlayController getInstance(int startNum,
                                            int numHosts)
Parameters:
startNum - starting host index number
numHosts - number of hosts to start

getVirtualHosts

public java.lang.String[] getVirtualHosts()

getNumHosts

public int getNumHosts()

startProcess

public ow.dht.DHT startProcess(ow.id.ID key,
                               java.lang.String joinHost,
                               java.lang.String selfHost)
                        throws OverlayException
Start a DHT host with a pre-configured ID

Parameters:
key - the ID object
joinHost - the existing DHT host to contact
can contain both host and port like so: localhost:8800
selfHost - for this DHT process, can contain both host and port
like so: localhost:8801
Returns:
the DHT process ID as generated by the overlay engine
Throws:
OverlayException

waitBeforeAccess

public static void waitBeforeAccess()
Wait a bit before access (call this method before each call to put() inside a loop)