uk.ac.ic.doc.automed.p2p.overlay
Class OverlayController
java.lang.Object
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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
getInstance
public static OverlayController getInstance(int numHosts)
getInstance
public static OverlayController getInstance(int startNum,
int numHosts)
- Parameters:
startNum - starting host index numbernumHosts - 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 objectjoinHost - the existing DHT host to contact
can contain both host and port like so: localhost:8800selfHost - 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)