|
Project JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RendezVousService
This interface provides an API to the Jxta RendezVous Service.
The RendezVous Service is responsible for propagating messages within a JXTA PeerGroup. While the internal protcol of diffusion is left to the implementation of the service, the JXTA RendezVous Service defines a subscribe mechanism allowing JXTA peers to receive propagated messages (clients of the service) or become a repeater of the service (rendezvous peers). At least one peer in a given PeerGroup must be a rendezvous. However, rendezvous peers can dynamically join or leave the PeerGroup. When a peers becomes a rendezvous, it publishes a special advertisement, aRdvAdvertisement
that can be found by other peers which are
looking for a rendezvous in the PeerGroup.
net.jxta.rendezvous.RendezVousManager
,
net.jxta.rendezvous.RendezVousMonitor
,
RdvAdvertisement
,
PeerAdvertisement
,
JXTA Protocols Specification : RendezvousField Summary | |
---|---|
static int |
DEFAULT_TTL
Perform propagate() or walk() using the most
appropriate TTL value for the implementation and configuration. |
Fields inherited from interface net.jxta.platform.Module |
---|
START_AGAIN_PROGRESS, START_AGAIN_STALLED, START_OK |
Method Summary | |
---|---|
void |
addListener(RendezvousListener listener)
Add a listener for RendezVousEvents |
boolean |
addPropagateListener(String name,
EndpointListener listener)
Deprecated. The naming convention is contrary to the more recent usage of specifying listeners with separate serviceName and serviceParam. Prefer addPropagateListener(String, String, EndpointListener) . |
boolean |
addPropagateListener(String serviceName,
String serviceParam,
EndpointListener listener)
Registers the given listener under the given serviceName and serviceParam to receive messages propagated by the rendezvous service. |
void |
challengeRendezVous(ID peer,
long timeout)
Set a new deadline for the rendezvous to be proven alive. |
void |
connectToRendezVous(EndpointAddress addr)
Attempt connection to the specified peer as a new RendezVous point. |
void |
connectToRendezVous(PeerAdvertisement adv)
Add a peer as a new RendezVousService point. |
void |
disconnectFromRendezVous(ID peerID)
Disconnect from the specified rendezvous |
Vector |
getConnectedPeerIDs()
Returns a Vector of PeerID of the peers that are currentely connected. |
Enumeration |
getConnectedPeers()
Returns an Enumeration of PeerID of the peers that are currentely connected. |
Enumeration |
getConnectedRendezVous()
Returns an Enumeration of the PeerID all the RendezVous on which this Peer is currentely connected. |
Enumeration |
getDisconnectedRendezVous()
Returns an Enumeration of the PeerID all the RendezVous on which this Peer failed to connect to. |
Vector |
getLocalWalkView()
Returns a vector of RdvAdvertisement of the local view of rendezvous peers. |
RendezVousStatus |
getRendezVousStatus()
Returns the current status of this peer within the current group. |
boolean |
isConnectedToRendezVous()
Return true if connected to a rendezvous. |
boolean |
isRendezVous()
tells whether this rendezvous service currently acts as a "super-node" "rendezvous", knowlege hub, influence broker, or whichever higher status applies to the implementation. |
void |
propagate(Enumeration destPeerIds,
Message msg,
String serviceName,
String serviceParam,
int ttl)
Propagates a message to the specified peers. |
void |
propagate(Message msg,
String serviceName,
String serviceParam,
int ttl)
Propagates a message to the local network and to as many members of the peer group as possible. |
void |
propagateInGroup(Message msg,
String serviceName,
String serviceParam,
int ttl)
Propagates a message to as many members of the peer group as possible. |
void |
propagateInGroup(Message msg,
String serviceName,
String serviceParam,
int ttl,
String prunePeer)
Deprecated. no need to specify prune peer |
void |
propagateToNeighbors(Message msg,
String serviceName,
String serviceParam,
int ttl)
Propagates a message to members of the peer group reachable via the local network. |
void |
propagateToNeighbors(Message msg,
String serviceName,
String serviceParam,
int ttl,
String prunePeer)
Deprecated. no need to specify prune peer |
boolean |
removeListener(RendezvousListener listener)
Removes a Listener previously added with addListener. |
EndpointListener |
removePropagateListener(String name,
EndpointListener listener)
Deprecated. The naming convention is contrary to the more recent usage of specifying listeners with separate serviceName and serviceParam. Prefer removePropagateListener(String, String, EndpointListener) . |
EndpointListener |
removePropagateListener(String serviceName,
String serviceParam,
EndpointListener listener)
Removes a Listener previously added with addPropagateListener. |
boolean |
setAutoStart(boolean auto)
Enable or disable the automatic switching between an Edge Peer and a Rendezvous Peer. |
boolean |
setAutoStart(boolean auto,
long period)
Enable or disable the automatic switching between an Edge Peer and a Rendezvous Peer. |
void |
startRendezVous()
Start the local peer as a RendezVous peer with the default manager. |
void |
stopRendezVous()
Stop the RendezVous function on the local Peer. |
void |
walk(Message msg,
String serviceName,
String serviceParam,
int ttl)
Walk a message through the rendezvous peers of the network: only rendezvous peers will receive the message. |
void |
walk(Vector destPeerIDs,
Message msg,
String serviceName,
String serviceParam,
int ttl)
Walk a message through the rendezvous peers of the network: only rendezvous peers will receive the message. |
Methods inherited from interface net.jxta.service.Service |
---|
getImplAdvertisement, getInterface |
Methods inherited from interface net.jxta.platform.Module |
---|
init, startApp, stopApp |
Field Detail |
---|
static final int DEFAULT_TTL
propagate()
or walk()
using the most
appropriate TTL value for the implementation and configuration. The
message will almost certainly be sent with a TTL value much less than
this value.
Method Detail |
---|
void connectToRendezVous(PeerAdvertisement adv) throws IOException
adv
- the advertisement of the RendezVousService peer
IOException
- when the RendezVousService peer is not reachablevoid connectToRendezVous(EndpointAddress addr) throws IOException
addr
- EndpointAddress of the rendezvous peer
IOException
- when the RendezVous peer is not reachablevoid disconnectFromRendezVous(ID peerID)
peerID
- the PeerId of the RendezVous to disconnect from.Enumeration getConnectedRendezVous()
Enumeration getDisconnectedRendezVous()
void startRendezVous()
void stopRendezVous()
Enumeration getConnectedPeers()
Vector getConnectedPeerIDs()
boolean addPropagateListener(String name, EndpointListener listener) throws IOException
addPropagateListener(String, String, EndpointListener)
.
name
- The name of the listener.listener
- An EndpointListener to process the message.
IOException
boolean addPropagateListener(String serviceName, String serviceParam, EndpointListener listener)
serviceName
- The serviceName of the listener.serviceParam
- The serviceParam of the listener.listener
- An EndpointListener to process the message.
EndpointListener removePropagateListener(String name, EndpointListener listener)
removePropagateListener(String, String, EndpointListener)
.
name
- The name of the listener.listener
- An EndpointListener to process the message.
EndpointListener removePropagateListener(String serviceName, String serviceParam, EndpointListener listener)
serviceName
- The serviceName of the listener.serviceParam
- The serviceParam of the listener.listener
- An EndpointListener to process the message.
void addListener(RendezvousListener listener)
listener
- An RendezvousListener to process the event.boolean removeListener(RendezvousListener listener)
listener
- the RendezvousListener listener removevoid propagate(Message msg, String serviceName, String serviceParam, int ttl) throws IOException
msg
- is the message to propagate.serviceName
- is the name of the serviceserviceParam
- is the parameter of the servicettl
- The requested TTL for the message.
IOException
void propagate(Enumeration destPeerIds, Message msg, String serviceName, String serviceParam, int ttl) throws IOException
destPeerIds
- an enumeration of PeerIDs of the peers that are the
intended recipients of the propgated message.msg
- is the message to propagate.serviceName
- is the name of the serviceserviceParam
- is the parameter of the servicettl
- The requested TTL for the message.
IOException
void propagateToNeighbors(Message msg, String serviceName, String serviceParam, int ttl, String prunePeer) throws IOException
msg
- is the message to propagate.serviceName
- is the name of the serviceserviceParam
- is the parameter of the serviceprunePeer
- is a peer to prune in the propagation.ttl
- The requested TTL for the message.
IOException
void propagateToNeighbors(Message msg, String serviceName, String serviceParam, int ttl) throws IOException
msg
- is the message to propagate.serviceName
- is the name of the serviceserviceParam
- is the parameter of the servicettl
- The requested TTL for the message.
IOException
void propagateInGroup(Message msg, String serviceName, String serviceParam, int ttl, String prunePeer) throws IOException
msg
- is the message to propagate.serviceName
- is the name of the serviceserviceParam
- is the parameter of the servicettl
- The requested TTL for the message.prunePeer
- is a peer to prune in the propagation.
IOException
void propagateInGroup(Message msg, String serviceName, String serviceParam, int ttl) throws IOException
msg
- is the message to propagate.serviceName
- is the name of the serviceserviceParam
- is the parameter of the servicettl
- The requested TTL for the message.
IOException
boolean isConnectedToRendezVous()
boolean isRendezVous()
RendezVousStatus getRendezVousStatus()
boolean setAutoStart(boolean auto)
auto
- true will activate automatic switching
boolean setAutoStart(boolean auto, long period)
auto
- true will activate automatic switchingperiod
- the period of auto-checking
void walk(Message msg, String serviceName, String serviceParam, int ttl) throws IOException
msg
- is the message to walk.serviceName
- is the name of the serviceserviceParam
- is the parameter of the servicettl
- is the maximum TTL of the message (note that the Rendezvous
Service implementation is free to decrease that value.
IOException
- when walking the message is impossible (network failure)void walk(Vector destPeerIDs, Message msg, String serviceName, String serviceParam, int ttl) throws IOException
destPeerIDs
- is a Vector of PeerIDs of the peers which are receiving
first the walker. Note that each entry in the Vector will create its own
walker.msg
- is the message to walk.serviceName
- is the name of the serviceserviceParam
- is the parameter of the servicettl
- is the maximum TTL of the message (note that the Rendezvous
Service implementation is free to decrease that value.
IOException
- when walking the message is impossible (network failure)Vector getLocalWalkView()
RdvAdvertisement
.
void challengeRendezVous(ID peer, long timeout)
peer
- The peer to be challengedtimeout
- The delay
|
JXTA J2SE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |