Project JXTA

net.jxta.impl.rendezvous
Class RendezVousInterface

java.lang.Object
  |
  +--net.jxta.impl.rendezvous.RendezVousInterface

public class RendezVousInterface
extends java.lang.Object
implements net.jxta.rendezvous.RendezVous

This class implements the RendezVous interface.


Constructor Summary
RendezVousInterface(RendezVousImpl theRealThing)
          The only authorized constructor.
 
Method Summary
 void connectRendezVous(net.jxta.endpoint.EndpointAddress addr)
          Add a peer as a new RendezVous point.
 void connectRendezVous(net.jxta.protocol.PeerGroupAdvertisement adv)
          Add a peer as a new RendezVous point.
 net.jxta.document.Advertisement getAdvertisement()
          Returns the advertisment for that service.
 java.util.Enumeration getConnectedPeers()
          Returns an Enumeration of PeerID of the peers that are currentely connected.
 net.jxta.service.Service getInterface()
          returns an interface object that permits to use this service without having access to the real object.
 void init(net.jxta.peergroup.PeerGroup pg, net.jxta.document.Advertisement a)
          Initialize the application FIXME: This is meaningless for the interface object; it is there only to satisfy the requirements of the interface that we implement.
 java.util.Enumeration listRemovedRendezVous()
          Returns an Enumeration of the PeerID all the RendezVous on which this Peer failed to connect to.
 java.util.Enumeration listRendezVous()
          Returns an Enumeration of the PeerID all the RendezVous on which this Peer is currentely connected.
 void removeRendezVous(net.jxta.peer.PeerID rendezVous)
          Remove a RendezVous point.
 void sendRendezVousAdv(net.jxta.protocol.PeerAdvertisement destPeer, net.jxta.protocol.PeerAdvertisement rendezVous)
          Sends advertisement about other RendezVous to a given peer
 net.jxta.rendezvous.RendezVousMonitor setMonitor(net.jxta.rendezvous.RendezVousMonitor handler)
          Register a notification handler that is called each time a RendezVous peer is not reachable anymore.
 int startApp(java.lang.String[] arg)
          This is here for temporary class hierarchy reasons.
 void startRendezVous(net.jxta.rendezvous.RendezVousManager handler)
          Start the local peer as a RendezVous peer.
 void stopApp()
          This is here for temporary class hierarchy reasons.
 void stopRendezVous()
          Stop the RendezVous function on the local Peer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RendezVousInterface

public RendezVousInterface(RendezVousImpl theRealThing)
The only authorized constructor.
Method Detail

getInterface

public net.jxta.service.Service getInterface()
returns an interface object that permits to use this service without having access to the real object. Since THIS is already such an object, it returns itself. FIXME: it is kind of absurd to have this method part of the interface but we do not want to define two levels of Service interface just for that.
Returns:
Resolver An interface object that implements this service and nothing more.

getAdvertisement

public net.jxta.document.Advertisement getAdvertisement()
Returns the advertisment for that service.
Returns:
Advertisement the advertisement.
Since:
JXTA 1.0

init

public void init(net.jxta.peergroup.PeerGroup pg,
                 net.jxta.document.Advertisement a)
Initialize the application FIXME: This is meaningless for the interface object; it is there only to satisfy the requirements of the interface that we implement. Ultimately, the API should define two levels of interfaces: one for the real service implementation and one for the interface object. Right now it feels a bit heavy to so that since the only different between the two would be init() and may-be getName().
Parameters:
g - PeerGroup this application is started from
Since:
JXTA 1.0

startApp

public int startApp(java.lang.String[] arg)
This is here for temporary class hierarchy reasons. it is ALWAYS ignored. By definition, the interface object protects the real object's start/stop methods from being called
Parameters:
arg - A table of strings arguments.
Returns:
int status indication.

stopApp

public void stopApp()
This is here for temporary class hierarchy reasons. it is ALWAYS ignored. By definition, the interface object protects the real object's start/stop methods from being called This request is currently ignored.

connectRendezVous

public void connectRendezVous(net.jxta.protocol.PeerGroupAdvertisement adv)
                       throws java.io.IOException
Add a peer as a new RendezVous point. If/When the RendezVous accepts the connection, the RendezVous service will invoke the RendezVousMonitor.
Specified by:
connectRendezVous in interface net.jxta.rendezvous.RendezVous
Parameters:
adv - the advertisement of the RendezVous peer
Throws:
java.io.IOException - when the RendezVous peer is not reachable

connectRendezVous

public void connectRendezVous(net.jxta.endpoint.EndpointAddress addr)
                       throws java.io.IOException
Add a peer as a new RendezVous point. If/When the RendezVous accepts the connection, the RendezVous service will invoke the RendezVousMonitor.
Specified by:
connectRendezVous in interface net.jxta.rendezvous.RendezVous
Parameters:
addr - EndpointAddress of the rendezvous peer
Throws:
java.io.IOException - when the RendezVous peer is not reachable

removeRendezVous

public void removeRendezVous(net.jxta.peer.PeerID rendezVous)
Remove a RendezVous point.
Specified by:
removeRendezVous in interface net.jxta.rendezvous.RendezVous
Parameters:
rendezVous - the PeerId of the RendezVous point to remove

setMonitor

public net.jxta.rendezvous.RendezVousMonitor setMonitor(net.jxta.rendezvous.RendezVousMonitor handler)
Register a notification handler that is called each time a RendezVous peer is not reachable anymore.
Specified by:
setMonitor in interface net.jxta.rendezvous.RendezVous
Parameters:
handler - a handler that is called each time a RendezVous peer is is not reachable anymore.
Returns:
RendezVousMonitor returns, if any, the current RendezVousMonitor

listRendezVous

public java.util.Enumeration listRendezVous()
Returns an Enumeration of the PeerID all the RendezVous on which this Peer is currentely connected.
Specified by:
listRendezVous in interface net.jxta.rendezvous.RendezVous
Returns:
Enumeration enumeration of RendezVous

listRemovedRendezVous

public java.util.Enumeration listRemovedRendezVous()
Returns an Enumeration of the PeerID all the RendezVous on which this Peer failed to connect to.
Specified by:
listRemovedRendezVous in interface net.jxta.rendezvous.RendezVous
Returns:
Enumeration enumeration of RendezVous

startRendezVous

public void startRendezVous(net.jxta.rendezvous.RendezVousManager handler)
                     throws java.io.IOException
Start the local peer as a RendezVous peer. The caller must provide a handler to an authorization manager.
Specified by:
startRendezVous in interface net.jxta.rendezvous.RendezVous
Parameters:
handler - is the RendezVousManager that will be invoked each time a new Peer request to be connected.
Throws:
java.io.IOException - when a handler has already been connected

stopRendezVous

public void stopRendezVous()
Stop the RendezVous function on the local Peer. All connected Peer are disconnected.
Specified by:
stopRendezVous in interface net.jxta.rendezvous.RendezVous

getConnectedPeers

public java.util.Enumeration getConnectedPeers()
Returns an Enumeration of PeerID of the peers that are currentely connected.
Specified by:
getConnectedPeers in interface net.jxta.rendezvous.RendezVous
Returns:
Enumeration enumeration of peers connected to that rendezvous

sendRendezVousAdv

public void sendRendezVousAdv(net.jxta.protocol.PeerAdvertisement destPeer,
                              net.jxta.protocol.PeerAdvertisement rendezVous)
Sends advertisement about other RendezVous to a given peer
Specified by:
sendRendezVousAdv in interface net.jxta.rendezvous.RendezVous
Parameters:
destPeer - is the advertisement of the peer to which to send the RendezVous advertisement.
rendezVous - is the advertisment of a RendezVous peer

Project JXTA