|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RendezVousService
The RendezVous Service provides propagation of messages within a JXTA PeerGroup.
The JXTA RendezVous Service defines a subscription mechanism allowing JXTA peers to receive propagated messages (clients of the service) or become a repeater of the service (rendezvous peers). The Standard Reference Implementation requires that at least one peer in a PeerGroup to act as a Rendezvous. Rendezvous peers may dynamically join or leave the PeerGroup over time.
Field 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_DISABLED, START_OK |
Method Summary | |
---|---|
void |
addListener(RendezvousListener listener)
Add a listener for RendezVousEvents. |
boolean |
addPropagateListener(String serviceName,
String serviceParam,
EndpointListener listener)
Deprecated. This method just calls EndpointService.addIncomingMessageListener(net.jxta.endpoint.EndpointListener, java.lang.String, java.lang.String) . It's better to just
register your listener with the Endpoint. This call may be
eventually removed. |
void |
challengeRendezVous(ID peer,
long timeout)
Set a new deadline for the rendezvous to be proven alive. |
void |
connectToRendezVous(EndpointAddress addr)
Deprecated. Directly connecting to rendezvous peers is not recommended. Seed rendezvous should be specified using the RdvConfigAdv mechanisms. |
void |
connectToRendezVous(PeerAdvertisement adv)
Deprecated. Directly connecting to rendezvous peers is not recommended. Seed rendezvous should be specified using the RdvConfigAdv mechanisms. |
void |
disconnectFromRendezVous(ID peerID)
Disconnect from the specified rendezvous. |
Vector<ID> |
getConnectedPeerIDs()
Returns a Vector of the PeerID of the peers that are currently connected to this peer. |
Enumeration<ID> |
getConnectedPeers()
Returns an Enumeration of the PeerID of the peers that are currently connected to this peer. |
Enumeration<ID> |
getConnectedRendezVous()
Returns an Enumeration of the PeerID all the RendezVous on which this Peer is currently connected. |
Enumeration<ID> |
getDisconnectedRendezVous()
Deprecated. Due to design changes this no longer returns accurate nor complete results. It will eventually be removed. |
Vector<RdvAdvertisement> |
getLocalWalkView()
Deprecated. Due to design changes, the list of peers may be empty in configurations which previously returned a non-empty result. Future JXTA versions are likely to use a different API. |
RendezVousStatus |
getRendezVousStatus()
Returns the current role of this peer within the peergroup. |
boolean |
isConnectedToRendezVous()
Return true if connected to a rendezvous. |
boolean |
isRendezVous()
Returns true if this peer is acting as a rendezvous peer (per the
implementation definition) within the peer group. |
void |
propagate(Enumeration<? extends ID> 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 |
propagateToNeighbors(Message msg,
String serviceName,
String serviceParam,
int ttl)
Propagates a message to members of the peer group reachable via the local network. |
boolean |
removeListener(RendezvousListener listener)
Removes a Rendezvous event listener previously added with addListener. |
EndpointListener |
removePropagateListener(String serviceName,
String serviceParam,
EndpointListener listener)
Deprecated. This method just calls EndpointService.removeIncomingMessageListener(java.lang.String, java.lang.String) .
It's better to just deregister your listener with the Endpoint. This call
may be eventually removed. |
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. |
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<? extends ID> 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 |
---|
@Deprecated void connectToRendezVous(PeerAdvertisement adv) throws IOException
adv
- the advertisement of the RendezVousService peer
IOException
- When the specified peer is unreachable@Deprecated void connectToRendezVous(EndpointAddress addr) throws IOException
addr
- EndpointAddress of the rendezvous peer
IOException
- When the specified peer is unreachablevoid disconnectFromRendezVous(ID peerID)
peerID
- the PeerId of the RendezVous to disconnect from.Enumeration<ID> getConnectedRendezVous()
getConnectedPeers()
.
@Deprecated Enumeration<ID> getDisconnectedRendezVous()
void startRendezVous()
void stopRendezVous()
Enumeration<ID> getConnectedPeers()
PeerID
connected to this peer.Vector<ID> getConnectedPeerIDs()
PeerID
connected to this peer.@Deprecated boolean addPropagateListener(String serviceName, String serviceParam, EndpointListener listener)
EndpointService.addIncomingMessageListener(net.jxta.endpoint.EndpointListener, java.lang.String, java.lang.String)
. It's better to just
register your listener with the Endpoint. This call may be
eventually removed.
serviceName
- The serviceName of the listener.serviceParam
- The serviceParam of the listener.listener
- An EndpointListener to process the message.
@Deprecated EndpointListener removePropagateListener(String serviceName, String serviceParam, EndpointListener listener)
EndpointService.removeIncomingMessageListener(java.lang.String, java.lang.String)
.
It's better to just deregister your listener with the Endpoint. This call
may be eventually removed.
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 remove
void propagate(Message msg, String serviceName, String serviceParam, int ttl) throws IOException
msg
- is the message to propagate.serviceName
- is the name of the service.serviceParam
- is the parameter of the service.ttl
- The requested TTL for the message.
IOException
- if an io error occursvoid propagate(Enumeration<? extends ID> 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 propagated message.msg
- The message to propagate.serviceName
- The name of the service.serviceParam
- The parameter of the service.ttl
- The requested TTL for the message.
IOException
- if an io error occursvoid propagateToNeighbors(Message msg, String serviceName, String serviceParam, int ttl) throws IOException
msg
- is the message to propagate.serviceName
- is the name of the service.serviceParam
- is the parameter of the service.ttl
- The requested TTL for the message.
IOException
- if an io error occursvoid 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
- if an io error occursboolean isConnectedToRendezVous()
true
if connected to a rendezvous.
true
if connected to a rendezvous otherwise false
.boolean isRendezVous()
true
if this peer is acting as a rendezvous peer (per the
implementation definition) within the peer group. false
is
returned for all other peer roles.
true
if this peer is acting as a rendezvous peer (per the
implementation definition) within the peer group. false
is
returned for all other peer roles.RendezVousStatus getRendezVousStatus()
boolean setAutoStart(boolean auto)
auto
- true
will activate automatic role switching.
boolean setAutoStart(boolean auto, long period)
auto
- true
will activate automatic role switching.period
- The interval in milliseconds at which the peer should
reconsider it's role.
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.
IOException
- when walking the message is impossible (network failure)void walk(Vector<? extends ID> 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.
IOException
- when walking the message is impossible (network failure)@Deprecated Vector<RdvAdvertisement> getLocalWalkView()
void challengeRendezVous(ID peer, long timeout)
peer
- The peer to be challengedtimeout
- The delay
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |