|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectp2ps.imp.rendezvous.RendezvousServiceImp
An implementation of the rendezvous service interface. Actively attempts to create connections to rendezvous other services. The default number of connections required is defined in REQUIRED_RENDEZVOUS_CONNECTIONS.
If the rendezvous service is acting as a rendezvous itself, then it will accept connections from other rendezvous above the number it actively attempts to create. The defauly maximum number of connections (both those created and accepted) is defined in MAXIMUM_RENDEZVOUS_CONNECTIONS. Also, if acting as a rendezvous, the service will accept connections from standard peers. The default maximum of peer connections accepted is defined in MAXIMUM_PEER_CONNECTIONS.
| Field Summary | |
static int |
MAXIMUM_PEER_CONNECTIONS
|
static int |
MAXIMUM_RENDEZVOUS_CONNECTIONS
|
static int |
REQUIRED_RENDEZVOUS_CONNECTIONS
|
| Fields inherited from interface p2ps.rendezvous.RendezvousService |
RENDEZVOUS_SERVICE |
| Constructor Summary | |
RendezvousServiceImp(Peer peer)
|
|
| Method Summary | |
void |
connectToRendezvous(RendezvousAdvertisement advert)
Connects to a rendezvous service |
java.lang.String |
connectToRendezvous(java.net.URI uri)
Connects to a rendezvous service. |
java.lang.String[] |
getConnectedRendezvous()
|
java.net.URI[] |
getLocalURI()
|
RendezvousAdvertisement |
getRendezvousAdvertisement()
|
void |
init(java.net.URI[] localuri)
Initialises the rendezvous service |
boolean |
isRendezvous()
|
void |
send(Advertisement advert)
Send an advertisement to all the rendezvous to which the peer is connected. |
void |
setRendezvous(boolean state)
Toggles between the rendezvous service acting as a rendezvous and just acting as a standard peer. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static int REQUIRED_RENDEZVOUS_CONNECTIONS
public static int MAXIMUM_RENDEZVOUS_CONNECTIONS
public static int MAXIMUM_PEER_CONNECTIONS
| Constructor Detail |
public RendezvousServiceImp(Peer peer)
| Method Detail |
public void init(java.net.URI[] localuri)
throws InitializationException,
java.io.IOException
init in interface RendezvousServicelocaluri -
InitializationException
java.io.IOExceptionpublic boolean isRendezvous()
isRendezvous in interface RendezvousService
public void setRendezvous(boolean state)
throws InitializationException,
java.io.IOException
setRendezvous in interface RendezvousServiceInitializationException
java.io.IOExceptionpublic java.net.URI[] getLocalURI()
getLocalURI in interface RendezvousServicepublic RendezvousAdvertisement getRendezvousAdvertisement()
getRendezvousAdvertisement in interface RendezvousServicepublic java.lang.String[] getConnectedRendezvous()
getConnectedRendezvous in interface RendezvousService
public void connectToRendezvous(RendezvousAdvertisement advert)
throws InitializationException,
java.io.IOException
connectToRendezvous in interface RendezvousServiceInitializationException
java.io.IOException
public java.lang.String connectToRendezvous(java.net.URI uri)
throws InitializationException,
java.io.IOException
connectToRendezvous in interface RendezvousServiceInitializationException
java.io.IOException
public void send(Advertisement advert)
throws java.io.IOException
send in interface RendezvousServicejava.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||