Rice Pastry API

rice.pastry.socket.nat.rendezvous
Class RendezvousSocketPastryNodeFactory

java.lang.Object
  extended by rice.pastry.PastryNodeFactory
      extended by rice.pastry.transport.TransportPastryNodeFactory
          extended by rice.pastry.socket.SocketPastryNodeFactory
              extended by rice.pastry.socket.nat.rendezvous.RendezvousSocketPastryNodeFactory
Direct Known Subclasses:
InternetPastryNodeFactory

public class RendezvousSocketPastryNodeFactory
extends SocketPastryNodeFactory

This class assembles the rendezvous layer with the rendezvous app. Need to think about where this best goes, but for now, we'll put it just above the magic number layer.

Author:
Jeff Hoye

Nested Class Summary
 
Nested classes/interfaces inherited from class rice.pastry.socket.SocketPastryNodeFactory
SocketPastryNodeFactory.TLBootstrapper, SocketPastryNodeFactory.TransLiveness<Identifier,MessageType>, SocketPastryNodeFactory.TransLivenessProximity<Identifier,MessageType>
 
Field Summary
protected  java.lang.String CONTACT_STATE
          Maps to a byte contactState
protected  RandomSource random
           
static java.lang.String RENDEZVOUS_CONTACT_DIRECT_STRATEGY
          getVars() maps to a ContactDirectStrategy
static java.lang.String RENDEZVOUS_STRATEGY
          maps to a RendezvousStrategy
static java.lang.String RENDEZVOUS_TL
          maps to a RendezvousTransportLayerImpl
static java.lang.String SIMULATE_FIREWALL
          maps to a boolean, if true then simulates a firewall
 
Fields inherited from class rice.pastry.socket.SocketPastryNodeFactory
findFireWallPolicy, IP_SERVICE, localAddress, MULTI_ADDRESS_STRATEGY, MULTI_INET_TL, NETWORK_INFO_NODE_HANDLE_INDEX, nidFactory, NODE_HANDLE_FACTORY, PASTRY_MAGIC_NUMBER, PRIORITY_TL, PROXY_ADDRESS, testFireWallPolicy
 
Fields inherited from class rice.pastry.transport.TransportPastryNodeFactory
leafSetMaintFreq, routeSetMaintFreq
 
Fields inherited from class rice.pastry.PastryNodeFactory
environment, logger, lSetSize, rtBase, rtMax
 
Constructor Summary
RendezvousSocketPastryNodeFactory(NodeIdFactory nf, java.net.InetAddress bindAddress, int startPort, Environment env, boolean firewalled)
           
RendezvousSocketPastryNodeFactory(NodeIdFactory nf, int startPort, Environment env, boolean firewalled)
           
 
Method Summary
protected  void generatePilotStrategy(PastryNode pn, RendezvousTransportLayerImpl<java.net.InetSocketAddress,RendezvousSocketNodeHandle> rendezvousLayer)
           
protected  Bootstrapper getBootstrapper(PastryNode pn, NodeHandleAdapter tl, NodeHandleFactory handleFactory, ProximityNeighborSelector pns)
          This code opens a pilot to our bootstrap node before proceeding.
protected  ContactDeserializer<java.net.InetSocketAddress,RendezvousSocketNodeHandle> getContactDeserializer(PastryNode pn)
           
protected  ContactDirectStrategy<RendezvousSocketNodeHandle> getContactDirectStrategy(PastryNode pn)
           
protected  IdentitySerializer<TransportLayerNodeHandle<MultiInetSocketAddress>,MultiInetSocketAddress,SourceRoute<MultiInetSocketAddress>> getIdentiySerializer(PastryNode pn, SocketNodeHandleFactory handleFactory)
           
protected  TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer> getIpServiceTransportLayer(TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer> wtl, PastryNode pn)
           
protected  JoinProtocol getJoinProtocol(PastryNode pn, LeafSet leafSet, RoutingTable routeTable, ReadyStrategy lsProtocol)
           
 NodeHandle getLocalHandle(PastryNode pn, NodeHandleFactory nhf)
           
protected  NextHopStrategy<MultiInetSocketAddress> getNextHopStrategy(TransportLayer<SourceRoute<MultiInetSocketAddress>,java.nio.ByteBuffer> ltl, LivenessProvider<SourceRoute<MultiInetSocketAddress>> livenessProvider, Pinger<SourceRoute<MultiInetSocketAddress>> pinger, PastryNode pn, MultiInetSocketAddress proxyAddress, MultiAddressSourceRouteFactory esrFactory)
           
 NodeHandleFactory getNodeHandleFactory(PastryNode pn)
           
protected  PilotFinder<RendezvousSocketNodeHandle> getPilotFinder(PastryNode pn)
           
protected  PriorityTransportLayer<MultiInetSocketAddress> getPriorityTransportLayer(TransportLayer<MultiInetSocketAddress,java.nio.ByteBuffer> trans, LivenessProvider<MultiInetSocketAddress> liveness, ProximityProvider<MultiInetSocketAddress> prox, PastryNode pn)
           
protected  ProximityNeighborSelector getProximityNeighborSelector(PastryNode pn)
          Can be overridden.
protected  RendezvousGenerationStrategy<RendezvousSocketNodeHandle> getRendezvousGenerator(PastryNode pn)
           
protected  RendezvousStrategy<RendezvousSocketNodeHandle> getRendezvousStrategy(PastryNode pn)
           
protected  RendezvousStrategy<RendezvousSocketNodeHandle> getRendezvousStrategyHelper(PastryNode pn)
          This is an annoying hack.
protected  TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer> getRendezvousTransportLayer(TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer> mtl, PastryNode pn)
           
protected  ResponseStrategy<java.net.InetSocketAddress> getResponseStrategy(PastryNode pn)
           
protected  TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer> getWireTransportLayer(java.net.InetSocketAddress innermostAddress, PastryNode pn)
          For testing, may return a FirewallTL impl for testing.
protected  boolean isInternetRoutablePrefix(java.net.InetAddress address)
           
protected  void newNodeSelector(Id nodeId, MultiInetSocketAddress proxyAddress, Continuation<PastryNode,java.io.IOException> deliverResultToMe, java.util.Map<java.lang.String,java.lang.Object> initialVars, boolean firewalled)
          Can override the contactState on a per-node basis
protected  void newNodeSelector(Id nodeId, MultiInetSocketAddress proxyAddress, Continuation<PastryNode,java.io.IOException> deliverResultToMe, java.util.Map<java.lang.String,java.lang.Object> initialVars, byte contactState)
          Can override the contactState on a per-node basis
protected  void registerApps(PastryNode pn, LeafSet leafSet, RoutingTable routeTable, NodeHandleAdapter nha, NodeHandleFactory handleFactory)
           
 void setContactState(byte contactState)
           
 
Methods inherited from class rice.pastry.socket.SocketPastryNodeFactory
cloneEnvironment, cloneLogManager, cloneProcessor, cloneRandomSource, cloneSelectorManager, getBindAddress, getBindStrategy, getBottomLayers, getCommonAPITransportLayer, getIdentityImpl, getLimitSocketsTransportLayer, getLivenessTransportLayer, getLowerIdentityLayer, getMagicNumberTransportLayer, getMultiAddressSourceRouteFactory, getMultiAddressSourceRouteTransportLayer, getNextInetSocketAddress, getNodeHandle, getNodeHandle, getNodeHandle, getNodeHandle, getNodeHandleAdapter, getOptionsAdder, getProbeStrategy, getSocketCountListener, getSourceRouteForwardStrategy, getSourceRouteManagerLayer, getSourceRouteStrategy, getSourceRouteTransportLayer, getUpperIdentityLayer, newNode, newNode, newNode, newNode, newNode, newNode, newNode, newNode, newNode, newNodeSelector, verifyConnection
 
Methods inherited from class rice.pastry.transport.TransportPastryNodeFactory
getLeafSetProtocol, getRouterStrategy, getRouteSetProtocol, getTLDeserializer, nodeHandleHelper
 
Methods inherited from class rice.pastry.PastryNodeFactory
getEnvironment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTACT_STATE

protected java.lang.String CONTACT_STATE
Maps to a byte contactState


random

protected RandomSource random

RENDEZVOUS_STRATEGY

public static final java.lang.String RENDEZVOUS_STRATEGY
maps to a RendezvousStrategy

See Also:
Constant Field Values

RENDEZVOUS_TL

public static final java.lang.String RENDEZVOUS_TL
maps to a RendezvousTransportLayerImpl

See Also:
Constant Field Values

SIMULATE_FIREWALL

public static final java.lang.String SIMULATE_FIREWALL
maps to a boolean, if true then simulates a firewall

See Also:
Constant Field Values

RENDEZVOUS_CONTACT_DIRECT_STRATEGY

public static final java.lang.String RENDEZVOUS_CONTACT_DIRECT_STRATEGY
getVars() maps to a ContactDirectStrategy

See Also:
Constant Field Values
Constructor Detail

RendezvousSocketPastryNodeFactory

public RendezvousSocketPastryNodeFactory(NodeIdFactory nf,
                                         java.net.InetAddress bindAddress,
                                         int startPort,
                                         Environment env,
                                         boolean firewalled)
                                  throws java.io.IOException
Throws:
java.io.IOException

RendezvousSocketPastryNodeFactory

public RendezvousSocketPastryNodeFactory(NodeIdFactory nf,
                                         int startPort,
                                         Environment env,
                                         boolean firewalled)
                                  throws java.io.IOException
Throws:
java.io.IOException
Method Detail

setContactState

public void setContactState(byte contactState)

newNodeSelector

protected void newNodeSelector(Id nodeId,
                               MultiInetSocketAddress proxyAddress,
                               Continuation<PastryNode,java.io.IOException> deliverResultToMe,
                               java.util.Map<java.lang.String,java.lang.Object> initialVars,
                               boolean firewalled)
Can override the contactState on a per-node basis

Parameters:
nodeId -
proxyAddress -
deliverResultToMe -
initialVars -
firewalled -

newNodeSelector

protected void newNodeSelector(Id nodeId,
                               MultiInetSocketAddress proxyAddress,
                               Continuation<PastryNode,java.io.IOException> deliverResultToMe,
                               java.util.Map<java.lang.String,java.lang.Object> initialVars,
                               byte contactState)
Can override the contactState on a per-node basis

Parameters:
nodeId -
proxyAddress -
deliverResultToMe -
initialVars -
contactState -

getJoinProtocol

protected JoinProtocol getJoinProtocol(PastryNode pn,
                                       LeafSet leafSet,
                                       RoutingTable routeTable,
                                       ReadyStrategy lsProtocol)
Overrides:
getJoinProtocol in class TransportPastryNodeFactory

getIpServiceTransportLayer

protected TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer> getIpServiceTransportLayer(TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer> wtl,
                                                                                                    PastryNode pn)
                                                                                             throws java.io.IOException
Overrides:
getIpServiceTransportLayer in class SocketPastryNodeFactory
Throws:
java.io.IOException

getIdentiySerializer

protected IdentitySerializer<TransportLayerNodeHandle<MultiInetSocketAddress>,MultiInetSocketAddress,SourceRoute<MultiInetSocketAddress>> getIdentiySerializer(PastryNode pn,
                                                                                                                                                               SocketNodeHandleFactory handleFactory)
Overrides:
getIdentiySerializer in class SocketPastryNodeFactory

getRendezvousTransportLayer

protected TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer> getRendezvousTransportLayer(TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer> mtl,
                                                                                                     PastryNode pn)

getNextHopStrategy

protected NextHopStrategy<MultiInetSocketAddress> getNextHopStrategy(TransportLayer<SourceRoute<MultiInetSocketAddress>,java.nio.ByteBuffer> ltl,
                                                                     LivenessProvider<SourceRoute<MultiInetSocketAddress>> livenessProvider,
                                                                     Pinger<SourceRoute<MultiInetSocketAddress>> pinger,
                                                                     PastryNode pn,
                                                                     MultiInetSocketAddress proxyAddress,
                                                                     MultiAddressSourceRouteFactory esrFactory)
                                                              throws java.io.IOException
Overrides:
getNextHopStrategy in class SocketPastryNodeFactory
Throws:
java.io.IOException

getResponseStrategy

protected ResponseStrategy<java.net.InetSocketAddress> getResponseStrategy(PastryNode pn)

getContactDirectStrategy

protected ContactDirectStrategy<RendezvousSocketNodeHandle> getContactDirectStrategy(PastryNode pn)

getPilotFinder

protected PilotFinder<RendezvousSocketNodeHandle> getPilotFinder(PastryNode pn)

generatePilotStrategy

protected void generatePilotStrategy(PastryNode pn,
                                     RendezvousTransportLayerImpl<java.net.InetSocketAddress,RendezvousSocketNodeHandle> rendezvousLayer)

getContactDeserializer

protected ContactDeserializer<java.net.InetSocketAddress,RendezvousSocketNodeHandle> getContactDeserializer(PastryNode pn)

getRendezvousGenerator

protected RendezvousGenerationStrategy<RendezvousSocketNodeHandle> getRendezvousGenerator(PastryNode pn)

getProximityNeighborSelector

protected ProximityNeighborSelector getProximityNeighborSelector(PastryNode pn)
Description copied from class: TransportPastryNodeFactory
Can be overridden.

Overrides:
getProximityNeighborSelector in class TransportPastryNodeFactory
Returns:

getRendezvousStrategyHelper

protected RendezvousStrategy<RendezvousSocketNodeHandle> getRendezvousStrategyHelper(PastryNode pn)
This is an annoying hack. We can't register the RendezvousApp until registerApps(), but we need it here. This table temporarily holds the rendezvousApps until they are needed, then it is deleted.


getRendezvousStrategy

protected RendezvousStrategy<RendezvousSocketNodeHandle> getRendezvousStrategy(PastryNode pn)

registerApps

protected void registerApps(PastryNode pn,
                            LeafSet leafSet,
                            RoutingTable routeTable,
                            NodeHandleAdapter nha,
                            NodeHandleFactory handleFactory)
Overrides:
registerApps in class SocketPastryNodeFactory

getNodeHandleFactory

public NodeHandleFactory getNodeHandleFactory(PastryNode pn)
Overrides:
getNodeHandleFactory in class SocketPastryNodeFactory

getLocalHandle

public NodeHandle getLocalHandle(PastryNode pn,
                                 NodeHandleFactory nhf)
Overrides:
getLocalHandle in class SocketPastryNodeFactory

getWireTransportLayer

protected TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer> getWireTransportLayer(java.net.InetSocketAddress innermostAddress,
                                                                                               PastryNode pn)
                                                                                        throws java.io.IOException
For testing, may return a FirewallTL impl for testing.

Overrides:
getWireTransportLayer in class SocketPastryNodeFactory
Throws:
java.io.IOException

getPriorityTransportLayer

protected PriorityTransportLayer<MultiInetSocketAddress> getPriorityTransportLayer(TransportLayer<MultiInetSocketAddress,java.nio.ByteBuffer> trans,
                                                                                   LivenessProvider<MultiInetSocketAddress> liveness,
                                                                                   ProximityProvider<MultiInetSocketAddress> prox,
                                                                                   PastryNode pn)
Overrides:
getPriorityTransportLayer in class SocketPastryNodeFactory

getBootstrapper

protected Bootstrapper getBootstrapper(PastryNode pn,
                                       NodeHandleAdapter tl,
                                       NodeHandleFactory handleFactory,
                                       ProximityNeighborSelector pns)
This code opens a pilot to our bootstrap node before proceeding. This is necessary to allow the liveness checks to be sent back to me without the bootstrap node remembering the address that I sent the liveness check on. When the node goes live, close all of the opened pilots, to not blow out the bootstrap node.

Overrides:
getBootstrapper in class SocketPastryNodeFactory

isInternetRoutablePrefix

protected boolean isInternetRoutablePrefix(java.net.InetAddress address)
Returns:
true if ip address matches firewall prefix

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection