p2ps.rendezvous
Interface RendezvousService

All Known Implementing Classes:
RendezvousServiceImp

public interface RendezvousService

A service for caching and forwarding messages

Version:
$Revision: 295 $
Author:
Ian Wang

Field Summary
static java.lang.String RENDEZVOUS_SERVICE
           
 
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.
 

Field Detail

RENDEZVOUS_SERVICE

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

init

public void init(java.net.URI[] localuri)
          throws InitializationException,
                 java.io.IOException
Initialises the rendezvous service

Parameters:
localuri - the local uri for the rendezvous service (null/empty if don't care)
Throws:
InitializationException
java.io.IOException

isRendezvous

public boolean isRendezvous()
Returns:
true if acting as a rendezvous

setRendezvous

public void setRendezvous(boolean state)
                   throws InitializationException,
                          java.io.IOException
Toggles between the rendezvous service acting as a rendezvous and just acting as a standard peer.

Throws:
InitializationException
java.io.IOException

getRendezvousAdvertisement

public RendezvousAdvertisement getRendezvousAdvertisement()
Returns:
an advert for the rendezvous service, or null if not acting as a rendezvous

getLocalURI

public java.net.URI[] getLocalURI()
Returns:
the local uri for the rendezvous

connectToRendezvous

public java.lang.String connectToRendezvous(java.net.URI uri)
                                     throws InitializationException,
                                            java.io.IOException
Connects to a rendezvous service. A rendezvous advert is created for this service using a dummy peer id.

Returns:
the dummy id assigned to the rendezvous
Throws:
InitializationException
java.io.IOException

connectToRendezvous

public void connectToRendezvous(RendezvousAdvertisement advert)
                         throws InitializationException,
                                java.io.IOException
Connects to a rendezvous service

Throws:
InitializationException
java.io.IOException

getConnectedRendezvous

public java.lang.String[] getConnectedRendezvous()
Returns:
the peer ids of all the connected rendezvous

send

public void send(Advertisement advert)
          throws java.io.IOException
Send an advertisement to all the rendezvous to which the peer is connected.

Throws:
java.io.IOException