rice.pastry.socket.nat.rendezvous
Class RendezvousJoinProtocol
java.lang.Object
rice.pastry.client.PastryAppl
rice.pastry.standard.StandardJoinProtocol
rice.pastry.standard.ConsistentJoinProtocol
rice.pastry.socket.nat.rendezvous.RendezvousJoinProtocol
- All Implemented Interfaces:
- java.util.Observer, JoinProtocol, NodeSetListener, LoopObserver
public class RendezvousJoinProtocol
- extends ConsistentJoinProtocol
The purpose of this class is to allow a NATted node to boot.
Without this class, when the JoinRequest reaches the nearest neighbor of the joiner,
that node can't deliver the Request back to the joiner (because he is NATted).
The class opens a pilot to the bootstrap, then includes this node in the RendezvousJoinRequest.
Note that this class uses both JoinRequests and RendezvousJoinRequests. The latter are only used for
a NATted Joiner.
Overview:
Extend CJPSerializer to also use RendezvousJoinRequest (include the bootstrap, and possibly additional credentials)
pass in constructor
Override handleInitiateJoin():
If local node is NATted:
open a pilot to the bootstrap (make sure to complete this before continuing)
send the RendezvousJoinRequest
else
super.handleInitiateJoin()
TODO:
Override respondToJoiner():
If joiner is NATted:
use the pilot on the bootstrap:
rendezvousLayer.requestSocket(joiner, bootstrap)
Override completeJoin() to close the pilot to the bootstrap before calling super.completeJoin() because that will cause pilots to open.
may need a way to verify that it is closed, or else don't close it if it's in the leafset, b/c it may become busted
- Author:
- Jeff Hoye
Method Summary |
protected void |
getJoinRequest(NodeHandle b,
Continuation<JoinRequest,java.lang.Exception> deliverJRToMe)
Use RendezvousJoinRequest if local node is NATted |
protected java.util.Map<java.lang.String,java.lang.Object> |
getOptions(JoinRequest jr,
java.util.Map<java.lang.String,java.lang.Object> existing)
This is called from respondToJoiner() and other places, we need to set the OPTION_USE_PILOT
to the intermediate node, so that will queue the RendezvousTL to use the pilot. |
Methods inherited from class rice.pastry.standard.ConsistentJoinProtocol |
addToLeafSet, delayInterest, destroy, loopTime, nodeSetUpdate, otherNodesMaySuspectFaulty, receiveMessage, requestFromEveryoneWeHaventHeardFrom, sendTheMessage, setReady, update, whoDoWeNeedAResponseFrom |
Methods inherited from class rice.pastry.client.PastryAppl |
accept, canReceiveSocket, connect, enrouteMessage, finishReceiveSocket, getDeserializer, getLeafSet, getNodeHandle, getNodeId, getRoutingTable, isClosest, leafSetChange, notifyReady, receiveMessageInternal, register, routeMsg, routeMsg, routeMsgDirect, routeSetChange, setDeserializer |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RendezvousJoinProtocol
public RendezvousJoinProtocol(PastryNode ln,
NodeHandle lh,
RoutingTable rt,
LeafSet ls,
ReadyStrategy nextReadyStrategy,
PilotManager<RendezvousSocketNodeHandle> pilotManager)
getJoinRequest
protected void getJoinRequest(NodeHandle b,
Continuation<JoinRequest,java.lang.Exception> deliverJRToMe)
- Use RendezvousJoinRequest if local node is NATted
- Overrides:
getJoinRequest
in class StandardJoinProtocol
getOptions
protected java.util.Map<java.lang.String,java.lang.Object> getOptions(JoinRequest jr,
java.util.Map<java.lang.String,java.lang.Object> existing)
- This is called from respondToJoiner() and other places, we need to set the OPTION_USE_PILOT
to the intermediate node, so that will queue the RendezvousTL to use the pilot.
- Overrides:
getOptions
in class StandardJoinProtocol
Copyright © 2001-2005 - Rice Pastry.