Rice Pastry API

rice.pastry.socket
Class SocketPastryNodeFactory

java.lang.Object
  extended by rice.pastry.PastryNodeFactory
      extended by rice.pastry.transport.TransportPastryNodeFactory
          extended by rice.pastry.socket.SocketPastryNodeFactory

public class SocketPastryNodeFactory
extends TransportPastryNodeFactory

Pastry node factory for Socket-linked nodes.

Version:
$Id: SocketPastryNodeFactory.java,v 1.6 2004/03/08 19:53:57 amislove Exp $
Author:
Alan Mislove

Field Summary
protected  int findFireWallPolicy
           
protected  NodeIdFactory nidFactory
           
static byte[] PASTRY_MAGIC_NUMBER
           
protected  RandomSource random
           
protected  int 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
SocketPastryNodeFactory(NodeIdFactory nf, java.net.InetAddress bindAddress, int startPort, Environment env, NATHandler handler)
           
SocketPastryNodeFactory(NodeIdFactory nf, int startPort, Environment env)
           
 
Method Summary
protected  Bootstrapper getBootstrapper(TLPastryNode pn, NodeHandleAdapter tl, NodeHandleFactory handleFactory, ProximityNeighborSelector pns)
           
protected  CommonAPITransportLayer<TransportLayerNodeHandle<MultiInetSocketAddress>> getCommonAPITransportLayer(UpperIdentity<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer> upperIdentity, TLPastryNode pn, TLDeserializer deserializer)
           
protected  IdentityImpl<TransportLayerNodeHandle<MultiInetSocketAddress>,MultiInetSocketAddress,java.nio.ByteBuffer,SourceRoute<MultiInetSocketAddress>> getIdentityImpl(TLPastryNode pn, SocketNodeHandleFactory handleFactory)
           
protected  LivenessTransportLayer<SourceRoute<MultiInetSocketAddress>,java.nio.ByteBuffer> getLivenessTransportLayer(TransportLayer<SourceRoute<MultiInetSocketAddress>,java.nio.ByteBuffer> tl, TLPastryNode pn)
           
 NodeHandle getLocalHandle(TLPastryNode pn, NodeHandleFactory nhf, java.lang.Object localNodeInfo)
           
protected  TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer> getMagicNumberTransportLayer(WireTransportLayer wtl, TLPastryNode pn)
           
protected  MultiAddressSourceRouteFactory getMultiAddressSourceRouteFactory(TLPastryNode pn)
           
 NodeHandle getNodeHandle(java.net.InetSocketAddress bootstrap)
           
 void getNodeHandle(java.net.InetSocketAddress[] bootstraps, Continuation c)
           
 NodeHandle getNodeHandle(java.net.InetSocketAddress[] bootstraps, int int1)
           
 NodeHandle getNodeHandle(java.net.InetSocketAddress bootstrap, int i)
           
 NodeHandleFactory getNodeHandleFactory(TLPastryNode pn)
           
 NodeHandleAdapter getNodeHanldeAdapter(TLPastryNode pn, NodeHandleFactory handleFactory2, TLDeserializer deserializer)
           
protected  PriorityTransportLayer<MultiInetSocketAddress> getPriorityTransportLayer(SourceRouteManager<MultiInetSocketAddress> srm, TLPastryNode pn)
           
protected  SourceRouteManager<MultiInetSocketAddress> getSourceRouteManagerLayer(LivenessTransportLayer<SourceRoute<MultiInetSocketAddress>,java.nio.ByteBuffer> ltl, TLPastryNode pn, MultiInetSocketAddress proxyAddress, MultiAddressSourceRouteFactory esrFactory)
           
protected  SourceRouteTransportLayer<MultiInetSocketAddress> getSourceRouteTransportLayer(MultiInetAddressTransportLayer etl, TLPastryNode pn, MultiAddressSourceRouteFactory esrFactory)
           
protected  UpperIdentity<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer> getUpperIdentityLayer(PriorityTransportLayer<MultiInetSocketAddress> priorityTL, TLPastryNode pn, IdentityImpl<TransportLayerNodeHandle<MultiInetSocketAddress>,MultiInetSocketAddress,java.nio.ByteBuffer,SourceRoute<MultiInetSocketAddress>> identity, SourceRouteManager<MultiInetSocketAddress> srm)
           
protected  WireTransportLayer getWireTransportLayer(java.net.InetSocketAddress innermostAddress, TLPastryNode pn)
           
 PastryNode newNode(Id nodeId, java.net.InetSocketAddress pAddress)
          Method which creates a Pastry node from the next port with the specified nodeId (or one generated from the NodeIdFactory if not specified)
protected  PastryNode newNode(Id nodeId, java.net.InetSocketAddress pAddress, boolean throwException)
           
 PastryNode newNode(NodeHandle bootstrap)
          Method which creates a Pastry node from the next port with a randomly generated NodeId.
 PastryNode newNode(NodeHandle bootstrap, Id nodeId)
          Method which creates a Pastry node from the next port with the specified nodeId (or one generated from the NodeIdFactory if not specified)
 PastryNode newNode(NodeHandle nodeHandle, Id id, java.net.InetSocketAddress proxyAddress)
          Method which creates a Pastry node from the next port with the specified nodeId (or one generated from the NodeIdFactory if not specified)
 PastryNode newNode(NodeHandle bootstrap, java.net.InetSocketAddress proxy)
          Method which creates a Pastry node from the next port with the specified nodeId (or one generated from the NodeIdFactory if not specified)
static java.net.InetSocketAddress verifyConnection(int i, java.net.InetSocketAddress addr, java.net.InetSocketAddress[] addr2, Environment env, Logger l)
           
 
Methods inherited from class rice.pastry.transport.TransportPastryNodeFactory
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

PASTRY_MAGIC_NUMBER

public static final byte[] PASTRY_MAGIC_NUMBER

nidFactory

protected NodeIdFactory nidFactory

random

protected RandomSource random

testFireWallPolicy

protected int testFireWallPolicy

findFireWallPolicy

protected int findFireWallPolicy
Constructor Detail

SocketPastryNodeFactory

public SocketPastryNodeFactory(NodeIdFactory nf,
                               int startPort,
                               Environment env)
                        throws java.io.IOException
Throws:
java.io.IOException

SocketPastryNodeFactory

public SocketPastryNodeFactory(NodeIdFactory nf,
                               java.net.InetAddress bindAddress,
                               int startPort,
                               Environment env,
                               NATHandler handler)
                        throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getLocalHandle

public NodeHandle getLocalHandle(TLPastryNode pn,
                                 NodeHandleFactory nhf,
                                 java.lang.Object localNodeInfo)
Specified by:
getLocalHandle in class TransportPastryNodeFactory

getNodeHandleFactory

public NodeHandleFactory getNodeHandleFactory(TLPastryNode pn)
Specified by:
getNodeHandleFactory in class TransportPastryNodeFactory

getNodeHanldeAdapter

public NodeHandleAdapter getNodeHanldeAdapter(TLPastryNode pn,
                                              NodeHandleFactory handleFactory2,
                                              TLDeserializer deserializer)
                                       throws java.io.IOException
Specified by:
getNodeHanldeAdapter in class TransportPastryNodeFactory
Throws:
java.io.IOException

getWireTransportLayer

protected WireTransportLayer getWireTransportLayer(java.net.InetSocketAddress innermostAddress,
                                                   TLPastryNode pn)
                                            throws java.io.IOException
Throws:
java.io.IOException

getMagicNumberTransportLayer

protected TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer> getMagicNumberTransportLayer(WireTransportLayer wtl,
                                                                                                      TLPastryNode pn)

getMultiAddressSourceRouteFactory

protected MultiAddressSourceRouteFactory getMultiAddressSourceRouteFactory(TLPastryNode pn)

getSourceRouteTransportLayer

protected SourceRouteTransportLayer<MultiInetSocketAddress> getSourceRouteTransportLayer(MultiInetAddressTransportLayer etl,
                                                                                         TLPastryNode pn,
                                                                                         MultiAddressSourceRouteFactory esrFactory)

getIdentityImpl

protected IdentityImpl<TransportLayerNodeHandle<MultiInetSocketAddress>,MultiInetSocketAddress,java.nio.ByteBuffer,SourceRoute<MultiInetSocketAddress>> getIdentityImpl(TLPastryNode pn,
                                                                                                                                                                        SocketNodeHandleFactory handleFactory)
                                                                                                                                                                 throws java.io.IOException
Throws:
java.io.IOException

getLivenessTransportLayer

protected LivenessTransportLayer<SourceRoute<MultiInetSocketAddress>,java.nio.ByteBuffer> getLivenessTransportLayer(TransportLayer<SourceRoute<MultiInetSocketAddress>,java.nio.ByteBuffer> tl,
                                                                                                                    TLPastryNode pn)

getSourceRouteManagerLayer

protected SourceRouteManager<MultiInetSocketAddress> getSourceRouteManagerLayer(LivenessTransportLayer<SourceRoute<MultiInetSocketAddress>,java.nio.ByteBuffer> ltl,
                                                                                TLPastryNode pn,
                                                                                MultiInetSocketAddress proxyAddress,
                                                                                MultiAddressSourceRouteFactory esrFactory)

getPriorityTransportLayer

protected PriorityTransportLayer<MultiInetSocketAddress> getPriorityTransportLayer(SourceRouteManager<MultiInetSocketAddress> srm,
                                                                                   TLPastryNode pn)

getUpperIdentityLayer

protected UpperIdentity<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer> getUpperIdentityLayer(PriorityTransportLayer<MultiInetSocketAddress> priorityTL,
                                                                                                                    TLPastryNode pn,
                                                                                                                    IdentityImpl<TransportLayerNodeHandle<MultiInetSocketAddress>,MultiInetSocketAddress,java.nio.ByteBuffer,SourceRoute<MultiInetSocketAddress>> identity,
                                                                                                                    SourceRouteManager<MultiInetSocketAddress> srm)

getCommonAPITransportLayer

protected CommonAPITransportLayer<TransportLayerNodeHandle<MultiInetSocketAddress>> getCommonAPITransportLayer(UpperIdentity<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer> upperIdentity,
                                                                                                               TLPastryNode pn,
                                                                                                               TLDeserializer deserializer)

getBootstrapper

protected Bootstrapper getBootstrapper(TLPastryNode pn,
                                       NodeHandleAdapter tl,
                                       NodeHandleFactory handleFactory,
                                       ProximityNeighborSelector pns)
Specified by:
getBootstrapper in class TransportPastryNodeFactory

getNodeHandle

public NodeHandle getNodeHandle(java.net.InetSocketAddress bootstrap,
                                int i)

getNodeHandle

public NodeHandle getNodeHandle(java.net.InetSocketAddress bootstrap)

getNodeHandle

public void getNodeHandle(java.net.InetSocketAddress[] bootstraps,
                          Continuation c)

getNodeHandle

public NodeHandle getNodeHandle(java.net.InetSocketAddress[] bootstraps,
                                int int1)

newNode

public PastryNode newNode(NodeHandle bootstrap)
Method which creates a Pastry node from the next port with a randomly generated NodeId.

Specified by:
newNode in class PastryNodeFactory
Parameters:
bootstrap - Node handle to bootstrap from.
Returns:
A node with a random ID and next port number.

newNode

public PastryNode newNode(NodeHandle bootstrap,
                          java.net.InetSocketAddress proxy)
Method which creates a Pastry node from the next port with the specified nodeId (or one generated from the NodeIdFactory if not specified)

Parameters:
bootstrap - Node handle to bootstrap from.
Returns:
A node with a random ID and next port number.

newNode

public PastryNode newNode(NodeHandle bootstrap,
                          Id nodeId)
Method which creates a Pastry node from the next port with the specified nodeId (or one generated from the NodeIdFactory if not specified)

Specified by:
newNode in class PastryNodeFactory
Parameters:
bootstrap - Node handle to bootstrap from.
nodeId - if non-null, will use this nodeId for the node, rather than using the NodeIdFactory
Returns:
A node with a random ID and next port number.

newNode

public PastryNode newNode(NodeHandle nodeHandle,
                          Id id,
                          java.net.InetSocketAddress proxyAddress)
Method which creates a Pastry node from the next port with the specified nodeId (or one generated from the NodeIdFactory if not specified)

Parameters:
bootstrap - Node handle to bootstrap from.
nodeId - if non-null, will use this nodeId for the node, rather than using the NodeIdFactory
Returns:
A node with a random ID and next port number.

newNode

public PastryNode newNode(Id nodeId,
                          java.net.InetSocketAddress pAddress)
Method which creates a Pastry node from the next port with the specified nodeId (or one generated from the NodeIdFactory if not specified)

Parameters:
bootstrap - Node handle to bootstrap from.
nodeId - if non-null, will use this nodeId for the node, rather than using the NodeIdFactory
pAddress - The address to claim that this node is at - used for proxies behind NATs
Returns:
A node with a random ID and next port number.

newNode

protected PastryNode newNode(Id nodeId,
                             java.net.InetSocketAddress pAddress,
                             boolean throwException)
                      throws java.io.IOException
Throws:
java.io.IOException

verifyConnection

public static java.net.InetSocketAddress verifyConnection(int i,
                                                          java.net.InetSocketAddress addr,
                                                          java.net.InetSocketAddress[] addr2,
                                                          Environment env,
                                                          Logger l)

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection