|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.neem.impl.Overlay
public class Overlay
Implementation of overlay management. This class combines a number of random walks upon initial join with periodic shuffling.
| Field Summary | |
|---|---|
int |
joins
|
int |
purged
|
int |
shuffleIn
|
int |
shuffleOut
|
| Constructor Summary | |
|---|---|
Overlay(java.util.Random rand,
java.net.InetSocketAddress id,
java.util.UUID myId,
Transport net,
short joinport,
short idport,
short shuffleport)
Creates a new instance of Overlay |
|
| Method Summary | |
|---|---|
void |
close(Connection info)
Notification of a connection being closed. |
Connection[] |
connections()
Get all connections that have been validated. |
int |
getFanout()
|
java.util.UUID |
getId()
Get globally unique ID in the overlay. |
java.net.InetSocketAddress |
getLocalSocketAddress()
|
java.net.InetSocketAddress[] |
getPeerAddresses()
Get all peer addresses. |
java.util.UUID[] |
getPeers()
Get all connected peers. |
int |
getShufflePeriod()
|
void |
open(Connection info)
Notification of a new connection. |
void |
receive(java.nio.ByteBuffer[] msg,
Connection info,
short port)
Receive a message from from a connection. |
void |
resetCounters()
|
void |
setFanout(int fanout)
|
void |
setShufflePeriod(int shufflePeriod)
|
void |
tradePeers(Connection target,
Connection arrow)
Connect two other peers by informing one of the other. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public int joins
public int purged
public int shuffleIn
public int shuffleOut
| Constructor Detail |
|---|
public Overlay(java.util.Random rand,
java.net.InetSocketAddress id,
java.util.UUID myId,
Transport net,
short joinport,
short idport,
short shuffleport)
| Method Detail |
|---|
public void receive(java.nio.ByteBuffer[] msg,
Connection info,
short port)
DataListener
receive in interface DataListenermsg - The incoming message.info - The source connection.port - Destination port.public void open(Connection info)
ConnectionListener
open in interface ConnectionListenerinfo - The connection to the new peer.public void close(Connection info)
ConnectionListener
close in interface ConnectionListenerinfo - The recently closed connection.
public void tradePeers(Connection target,
Connection arrow)
target - The connection peer.arrow - The accepting peer.public Connection[] connections()
public java.util.UUID[] getPeers()
public java.net.InetSocketAddress[] getPeerAddresses()
public java.util.UUID getId()
public java.net.InetSocketAddress getLocalSocketAddress()
public int getFanout()
public void setFanout(int fanout)
public int getShufflePeriod()
public void setShufflePeriod(int shufflePeriod)
public void resetCounters()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||