p2ps.imp.rendezvous
Interface ConnectionManager

All Known Implementing Classes:
PeerConnectionManager

public interface ConnectionManager

An interface implemented by classes that maintain connections between peer and rendezvous.

Version:
$Revision: 295 $
Author:
Ian Wang

Method Summary
 void dispose()
          Dispose the connection manager
 java.lang.String[] getConnectedRendezvous()
           
 int getCurrentRendezvousConnections()
           
 RendezvousAdvertisement getRendezvousAdvertisement()
           
 int getRequiredRendezvousConnections()
           
 void init()
          Initializes the connection manager
 void initConnection(RendezvousAdvertisement advert)
          Initialize a connection to the specified rendezvous
 boolean isRendezvousConnectionRequired()
           
 void send(Advertisement advert)
          Send an advertisement to all the rendezvous to which the peer is connected, and adds the advertisement to the rendezvous cache (if applicable)
 

Method Detail

init

public void init()
          throws java.io.IOException
Initializes the connection manager

Throws:
java.io.IOException

getRendezvousAdvertisement

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

isRendezvousConnectionRequired

public boolean isRendezvousConnectionRequired()
Returns:
true if a new rendezvous connections is required

getRequiredRendezvousConnections

public int getRequiredRendezvousConnections()
Returns:
the desired rendezvous connectivity

getCurrentRendezvousConnections

public int getCurrentRendezvousConnections()
Returns:
the current rendezvous connectivity

getConnectedRendezvous

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

initConnection

public void initConnection(RendezvousAdvertisement advert)
                    throws InitializationException,
                           java.io.IOException
Initialize a connection to the specified rendezvous

Throws:
InitializationException
java.io.IOException

send

public void send(Advertisement advert)
          throws java.io.IOException
Send an advertisement to all the rendezvous to which the peer is connected, and adds the advertisement to the rendezvous cache (if applicable)

Throws:
java.io.IOException

dispose

public void dispose()
Dispose the connection manager