rice.pastry.socket.nat.rendezvous
Class RendezvousApp
java.lang.Object
rice.pastry.client.PastryAppl
rice.pastry.socket.nat.rendezvous.RendezvousApp
- All Implemented Interfaces:
- RendezvousStrategy<RendezvousSocketNodeHandle>
public class RendezvousApp
- extends PastryAppl
- implements RendezvousStrategy<RendezvousSocketNodeHandle>
TODO: make not abstract
- Author:
- Jeff Hoye
Method Summary |
void |
isNatted(NodeHandle bootstrap,
Continuation<java.net.InetSocketAddress,java.lang.Exception> receiveResult)
Can be called before you boot, will tell you if you are Firewalled. |
void |
messageForAppl(Message msg)
Called by pastry when a message arrives for this application. |
Cancellable |
openChannel(RendezvousSocketNodeHandle target,
RendezvousSocketNodeHandle rendezvous,
byte[] credentials,
Continuation<java.lang.Integer,java.lang.Exception> deliverResultToMe)
Calls ChannelOpener.openChannel(dest, credentials) on target
Possible exceptions to deliverResultToMe:
NodeIsFaultyException if target is faulty
UnableToConnectException if dest is faulty |
MessageRequestHandle<RendezvousSocketNodeHandle,java.nio.ByteBuffer> |
sendMessage(RendezvousSocketNodeHandle i,
java.nio.ByteBuffer m,
MessageCallback<RendezvousSocketNodeHandle,java.nio.ByteBuffer> deliverAckToMe,
java.util.Map<java.lang.String,java.lang.Object> options)
Sends the message via an out-of-band channel. |
Methods inherited from class rice.pastry.client.PastryAppl |
accept, canReceiveSocket, connect, deliverWhenNotReady, destroy, enrouteMessage, finishReceiveSocket, getAddress, getDeserializer, getLeafSet, getNodeHandle, getNodeId, getRoutingTable, isClosest, leafSetChange, notifyReady, receiveMessage, 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 |
RendezvousApp
public RendezvousApp(PastryNode pn)
isNatted
public void isNatted(NodeHandle bootstrap,
Continuation<java.net.InetSocketAddress,java.lang.Exception> receiveResult)
- Can be called before you boot, will tell you if you are Firewalled.
Should send a message to the bootstrap, who forwards it to another node who sends you the request back. Should
try UDP/TCP.
Returns your external address.
- Parameters:
bootstrap
- receiveResult
-
messageForAppl
public void messageForAppl(Message msg)
- Description copied from class:
PastryAppl
- Called by pastry when a message arrives for this application.
- Specified by:
messageForAppl
in class PastryAppl
- Parameters:
msg
- the message that is arriving.
openChannel
public Cancellable openChannel(RendezvousSocketNodeHandle target,
RendezvousSocketNodeHandle rendezvous,
byte[] credentials,
Continuation<java.lang.Integer,java.lang.Exception> deliverResultToMe)
- Description copied from interface:
RendezvousStrategy
- Calls ChannelOpener.openChannel(dest, credentials) on target
Possible exceptions to deliverResultToMe:
NodeIsFaultyException if target is faulty
UnableToConnectException if dest is faulty
- Specified by:
openChannel
in interface RendezvousStrategy<RendezvousSocketNodeHandle>
- Parameters:
target
- call ChannelOpener.openChannel() on this Identifierrendezvous
- pass this to ChannelOpener.openChannel(), it's who the ChannelOpener will connect tocredentials
- this is also passed to ChannelOpener.openChannel()deliverResultToMe
- notify me when success/failure
- Returns:
- a way to cancel the request
sendMessage
public MessageRequestHandle<RendezvousSocketNodeHandle,java.nio.ByteBuffer> sendMessage(RendezvousSocketNodeHandle i,
java.nio.ByteBuffer m,
MessageCallback<RendezvousSocketNodeHandle,java.nio.ByteBuffer> deliverAckToMe,
java.util.Map<java.lang.String,java.lang.Object> options)
- Description copied from interface:
RendezvousStrategy
- Sends the message via an out-of-band channel. Usually routing.
- Specified by:
sendMessage
in interface RendezvousStrategy<RendezvousSocketNodeHandle>
- Returns:
Copyright © 2001-2005 - Rice Pastry.