|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.rendezvous.RendezVousServiceProvider
net.jxta.impl.rendezvous.StdRendezVousService
public abstract class StdRendezVousService
Base class for providers which implement the JXTA Standard Rendezvous Protocol.
Nested Class Summary | |
---|---|
protected static interface |
StdRendezVousService.StdRdvProtocolListener
Interface for listeners to : <assignedID>/ |
Field Summary | |
---|---|
static String |
ConnectedLeaseReply
|
static String |
ConnectedPeerReply
|
static String |
ConnectedRdvAdvReply
|
static String |
ConnectRequest
|
protected static int |
DEFAULT_MAX_TTL
Default Maximum TTL. |
static String |
DisconnectRequest
|
protected String |
pName
|
protected String |
pParam
|
protected Timer |
timer
|
Fields inherited from class net.jxta.impl.rendezvous.RendezVousServiceProvider |
---|
closed, group, MAX_TTL, PROP_HDR_ELEMENT_NAME, PropPName, PropSName, RDV_MSG_NAMESPACE_NAME, rdvService, rendezvousMeter, rendezvousServiceMonitor |
Constructor Summary | |
---|---|
protected |
StdRendezVousService(PeerGroup group,
RendezVousServiceImpl rdvService)
Constructor |
Method Summary | |
---|---|
abstract PeerConnection |
getPeerConnection(ID id)
Returns the peer connection or null if not present. |
protected abstract PeerConnection[] |
getPeerConnections()
Returns an array of the current peer connections. |
void |
processReceivedMessage(Message message,
RendezVousPropagateMessage propHdr,
EndpointAddress srcAddr,
EndpointAddress dstAddr)
Process a propagated message. |
void |
propagate(Enumeration<? extends ID> destPeerIDs,
Message msg,
String serviceName,
String serviceParam,
int initialTTL)
Propagates a message onto as many peers on the local network as possible. |
void |
propagateToNeighbors(Message msg,
String serviceName,
String serviceParam,
int initialTTL)
Propagates a message onto as many peers on the local network as possible. |
protected void |
repropagate(Message msg,
RendezVousPropagateMessage propHdr,
String serviceName,
String serviceParam)
Responsible for forwarding received messages to the rest of the network as appropriate. |
protected void |
sendDisconnect(ID peerid,
PeerAdvertisement padv)
Sends a disconnect message to the specified peer. |
protected void |
sendDisconnect(PeerConnection pConn)
Sends a disconnect message to the specified peer. |
protected int |
sendToEachConnection(Message msg,
RendezVousPropagateMessage propHdr)
Sends to all connected peers. |
protected int |
startApp(String[] argv,
StdRendezVousService.StdRdvProtocolListener handler)
|
void |
stopApp()
Ask this service to stop. |
Methods inherited from class net.jxta.impl.rendezvous.RendezVousServiceProvider |
---|
challengeRendezVous, checkPropHeader, connectToRendezVous, disconnectFromRendezVous, getConnectedPeerIDs, getPeerAdvertisementDoc, getPropHeader, isConnectedToRendezVous, mkAddress, mkAddress, processIncomingMessage, propagate, propagateInGroup, sendToNetwork, setRendezvousServiceMonitor, startApp, updatePropHeader, walk, walk |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ConnectRequest
public static final String DisconnectRequest
public static final String ConnectedPeerReply
public static final String ConnectedLeaseReply
public static final String ConnectedRdvAdvReply
protected static final int DEFAULT_MAX_TTL
protected final String pName
protected final String pParam
protected final Timer timer
Constructor Detail |
---|
protected StdRendezVousService(PeerGroup group, RendezVousServiceImpl rdvService)
group
- the PeerGrouprdvService
- the parent rendezvous serviceMethod Detail |
---|
protected int startApp(String[] argv, StdRendezVousService.StdRdvProtocolListener handler)
public void stopApp()
stopApp
in class RendezVousServiceProvider
public void processReceivedMessage(Message message, RendezVousPropagateMessage propHdr, EndpointAddress srcAddr, EndpointAddress dstAddr)
processReceivedMessage
in class RendezVousServiceProvider
message
- the message receivedpropHdr
- the message headersrcAddr
- the source addressdstAddr
- the message destination addreesspublic void propagate(Enumeration<? extends ID> destPeerIDs, Message msg, String serviceName, String serviceParam, int initialTTL)
propagate
in class RendezVousServiceProvider
destPeerIDs
- An enumeration of the peers that are recipients of the
propagated message.msg
- is the message to propagate.serviceName
- is the name of the serviceserviceParam
- is the parameter of the serviceinitialTTL
- is the maximum TTL of the message (note that the Rendezvous
Service implementation is free to decrease that value.public void propagateToNeighbors(Message msg, String serviceName, String serviceParam, int initialTTL) throws IOException
propagateToNeighbors
in class RendezVousServiceProvider
msg
- is the message to propagate.serviceName
- is the name of the serviceserviceParam
- is the parameter of the serviceinitialTTL
- is the maximum TTL of the message (note that the Rendezvous
Service implementation is free to decrease that value.
IOException
- if an io error occursprotected void repropagate(Message msg, RendezVousPropagateMessage propHdr, String serviceName, String serviceParam)
repropagate
in class RendezVousServiceProvider
msg
- the message to be repropagated.propHdr
- It's current propagation header.serviceName
- The destination service.serviceParam
- The destination service parameter.public abstract PeerConnection getPeerConnection(ID id)
id
- the node ID
protected abstract PeerConnection[] getPeerConnections()
protected int sendToEachConnection(Message msg, RendezVousPropagateMessage propHdr)
msg
- The message to be sent.propHdr
- The propagation header associated with the message.
protected void sendDisconnect(ID peerid, PeerAdvertisement padv)
peerid
- The peer to be disconnected.padv
- The peer to be disconnected.protected void sendDisconnect(PeerConnection pConn)
pConn
- The peer to be disconnected.
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |