|
Project JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.rendezvous.RendezVousServiceProvider
public abstract class RendezVousServiceProvider
This abstract class must be extended for all RendezVous Service providers that are managed by RendezVousServiceImpl.
Implementors of providers are responsible for using appropriate synchronization. The RendezvousServiceImpl provides synchronization control only only those methods which involve changing the active provider.
Field Summary | |
---|---|
protected boolean |
closed
|
protected PeerGroup |
group
|
protected String |
HEADER_NAME
|
protected int |
MAX_TTL
Maximum TTL we will allow for propagation and repropagation issued by this peer. |
protected static String |
MESSAGE_NAMESPACE_NAME
|
protected String |
PropPName
|
protected static String |
PropSName
|
protected RendezVousServiceImpl |
rdvService
|
protected RendezvousMeter |
rendezvousMeter
|
protected RendezvousServiceMonitor |
rendezvousServiceMonitor
|
Constructor Summary | |
---|---|
protected |
RendezVousServiceProvider(PeerGroup g,
RendezVousServiceImpl rdvService)
|
Method Summary | |
---|---|
abstract void |
challengeRendezVous(ID peer,
long delay)
Resets the local idea of the lease to the specified value. |
protected RendezVousPropagateMessage |
checkPropHeader(Message msg)
|
abstract void |
disconnectFromRendezVous(ID peerID)
Remove a RendezVousService point. |
abstract Vector |
getConnectedPeerIDs()
|
abstract Enumeration |
getConnectedPeers()
|
abstract Enumeration |
getConnectedRendezVous()
Returns an Enumeration of the PeerID all the RendezVous on which this Peer is currentely connected. |
abstract Enumeration |
getDisconnectedRendezVous()
Returns an Enumeration of the PeerID all the RendezVous on which this Peer failed to connect to. |
protected XMLDocument |
getPeerAdvertisementDoc()
|
protected RendezVousPropagateMessage |
getPropHeader(Message msg)
Get propagate header from the message. |
abstract boolean |
isConnectedToRendezVous()
Return true if connected to a rendezvous. |
protected static EndpointAddress |
mkAddress(ID destPeer,
String serv,
String parm)
Convenience method for constructing an endpoint address from an id |
protected static EndpointAddress |
mkAddress(String destPeer,
String serv,
String parm)
Convenience method for constructing an endpoint address from an id |
void |
processIncomingMessage(Message msg,
EndpointAddress srcAddr,
EndpointAddress dstAddr)
EndpointListener for the JxtaPropagate/ |
protected void |
processReceivedMessage(Message message,
RendezVousPropagateMessage propHdr,
EndpointAddress srcAddr,
EndpointAddress dstAddr)
Process a propagated message. |
abstract void |
propagate(Enumeration destPeerIds,
Message msg,
String serviceName,
String serviceParam,
int ttl)
Propagates a message onto as many peers on the local network as possible. |
abstract void |
propagate(Message msg,
String serviceName,
String serviceParam,
int ttl)
Propagates a message onto as many peers on the local network as possible. |
abstract void |
propagateInGroup(Message msg,
String serviceName,
String serviceParam,
int ttl)
|
abstract void |
propagateToNeighbors(Message msg,
String serviceName,
String serviceParam,
int ttl)
Propagates a message onto as many peers on the local network as possible. |
protected abstract void |
repropagate(Message msg,
RendezVousPropagateMessage propHdr,
String sName,
String sParam)
|
protected void |
sendToNetwork(Message msg,
RendezVousPropagateMessage propHdr)
Propagates on all endpoint protocols. |
abstract void |
setChoiceDelay(long delay)
|
void |
setRendezvousServiceMonitor(RendezvousServiceMonitor rendezvousServiceMonitor)
Set the RendezvousServiceMonitor, not to be confused with the RendeszousMonitor. |
protected int |
startApp(String[] arg)
Supply arguments and starts this service if it hadn't started by itself. |
protected void |
stopApp()
Ask this service to stop. |
protected RendezVousPropagateMessage |
updatePropHeader(Message msg,
RendezVousPropagateMessage propHdr,
String serviceName,
String serviceParam,
int ttl)
|
abstract 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. |
abstract 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 class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String PropSName
protected static final String MESSAGE_NAMESPACE_NAME
protected final String PropPName
protected final String HEADER_NAME
protected int MAX_TTL
protected final PeerGroup group
protected final RendezVousServiceImpl rdvService
protected boolean closed
protected RendezvousServiceMonitor rendezvousServiceMonitor
protected RendezvousMeter rendezvousMeter
Constructor Detail |
---|
protected RendezVousServiceProvider(PeerGroup g, RendezVousServiceImpl rdvService)
Method Detail |
---|
public void processIncomingMessage(Message msg, EndpointAddress srcAddr, EndpointAddress dstAddr)
processIncomingMessage
in interface EndpointListener
protected XMLDocument getPeerAdvertisementDoc()
protected int startApp(String[] arg)
protected void stopApp()
public void setRendezvousServiceMonitor(RendezvousServiceMonitor rendezvousServiceMonitor)
RendezvousServiceMonitor
- MonitorManager
public abstract void challengeRendezVous(ID peer, long delay)
peer
- The peer to be chanllengeddelay
- The delaypublic abstract void disconnectFromRendezVous(ID peerID)
peerID
- the PeerId of the RendezVous to disconnect from.public abstract Enumeration getConnectedRendezVous()
public abstract Enumeration getDisconnectedRendezVous()
public abstract Vector getConnectedPeerIDs()
public abstract Enumeration getConnectedPeers()
public abstract void setChoiceDelay(long delay)
public abstract void 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 service
IOException
public abstract void propagate(Enumeration destPeerIds, Message msg, String serviceName, String serviceParam, int ttl) throws IOException
destPeerIDs
- is a vector of PeerID of the peers that are recipients
of the propgated message.msg
- is the message to propagate.serviceName
- is the name of the serviceserviceParam
- is the parameter of the service
IOException
public abstract 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 serviceprunePeer
- is a peer to prune in the propagation.
IOException
public abstract boolean isConnectedToRendezVous()
public abstract 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)public abstract void walk(Vector destPeerIDs, Message msg, String serviceName, String serviceParam, int ttl) throws IOException
destPeerIDs
- is a Vector of PeerID 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)protected void processReceivedMessage(Message message, RendezVousPropagateMessage propHdr, EndpointAddress srcAddr, EndpointAddress dstAddr)
protected abstract void repropagate(Message msg, RendezVousPropagateMessage propHdr, String sName, String sParam)
public abstract void propagateInGroup(Message msg, String serviceName, String serviceParam, int ttl) throws IOException
IOException
protected void sendToNetwork(Message msg, RendezVousPropagateMessage propHdr) throws IOException
msg
- is the message to propagate.serviceName
- is the name of the servicequeueName
- Description of Parameter
IOException
protected static final EndpointAddress mkAddress(String destPeer, String serv, String parm)
destPeer
- peer idserv
- the service name (if any)parm
- the service param (if any)endpointAddress
- for this peer id.protected static final EndpointAddress mkAddress(ID destPeer, String serv, String parm)
destPeer
- peer idserv
- the service name (if any)parm
- the service param (if any)endpointAddress
- for this peer id.protected RendezVousPropagateMessage getPropHeader(Message msg)
msg
- The source message.
protected RendezVousPropagateMessage checkPropHeader(Message msg)
protected RendezVousPropagateMessage updatePropHeader(Message msg, RendezVousPropagateMessage propHdr, String serviceName, String serviceParam, int ttl)
|
JXTA J2SE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |