Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rice.pastry.socket
Class SocketPastryNodeFactory

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

Direct Known Subclasses:
  RendezvousSocketPastryNodeFactory

    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

Nested Class Summary
`protected static interface` | `SocketPastryNodeFactory.TransLiveness<Identifier,MessageType>`
`protected static interface` | `SocketPastryNodeFactory.TransLivenessProximity<Identifier,MessageType>`

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 Environment` | `cloneEnvironment(Environment rootEnvironment, Id nodeId)`
`protected LogManager` | `cloneLogManager(Environment rootEnvironment, Id nodeId)`
`protected Processor` | `cloneProcessor(Environment rootEnvironment, Id nodeId, LogManager lman)`
`protected RandomSource` | `cloneRandomSource(Environment rootEnvironment, Id nodeId, LogManager lman)`
`protected SelectorManager` | `cloneSelectorManager(Environment rootEnvironment, Id nodeId, LogManager lman)`
`protected Bootstrapper` | `getBootstrapper(TLPastryNode pn, NodeHandleAdapter tl, NodeHandleFactory handleFactory, ProximityNeighborSelector pns, java.lang.Object localNodeData)`
`protected TransportLayer<TransportLayerNodeHandle<MultiInetSocketAddress>,RawMessage>` | `getCommonAPITransportLayer(TransportLayer<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 TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer>` | `getLimitSocketsTransportLayer(TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer> mntl, TLPastryNode pn)`
`protected SocketPastryNodeFactory.TransLiveness<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<SourceRoute<MultiInetSocketAddress>,java.nio.ByteBuffer>` | `getLowerIdentityLayer(TransportLayer<SourceRoute<MultiInetSocketAddress>,java.nio.ByteBuffer> srl, TLPastryNode pn, IdentityImpl<TransportLayerNodeHandle<MultiInetSocketAddress>,MultiInetSocketAddress,java.nio.ByteBuffer,SourceRoute<MultiInetSocketAddress>> identity)`
`protected TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer>` | `getMagicNumberTransportLayer(TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer> wtl, TLPastryNode pn)`
`protected MultiAddressSourceRouteFactory` | `getMultiAddressSourceRouteFactory(TLPastryNode pn)`
`protected TransportLayer<MultiInetSocketAddress,java.nio.ByteBuffer>` | `getMultiAddressSourceRouteFactory(TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer> mntl, TLPastryNode pn, MultiInetSocketAddress localAddress)`
`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 TransportLayer<MultiInetSocketAddress,java.nio.ByteBuffer>` | `getPriorityTransportLayer(TransportLayer<MultiInetSocketAddress,java.nio.ByteBuffer> trans, LivenessProvider<MultiInetSocketAddress> liveness, ProximityProvider<MultiInetSocketAddress> prox, TLPastryNode pn)`
`protected SocketPastryNodeFactory.TransLivenessProximity<MultiInetSocketAddress,java.nio.ByteBuffer>` | `getSourceRouteManagerLayer(TransportLayer<SourceRoute<MultiInetSocketAddress>,java.nio.ByteBuffer> ltl, LivenessProvider<SourceRoute<MultiInetSocketAddress>> livenessProvider, Pinger<SourceRoute<MultiInetSocketAddress>> pinger, TLPastryNode pn, MultiInetSocketAddress proxyAddress, MultiAddressSourceRouteFactory esrFactory)`
`protected TransportLayer<SourceRoute<MultiInetSocketAddress>,java.nio.ByteBuffer>` | `getSourceRouteTransportLayer(TransportLayer<MultiInetSocketAddress,java.nio.ByteBuffer> etl, TLPastryNode pn, MultiAddressSourceRouteFactory esrFactory)`
`protected SocketPastryNodeFactory.TransLivenessProximity<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer>` | `getUpperIdentityLayer(TransportLayer<MultiInetSocketAddress,java.nio.ByteBuffer> priorityTL, TLPastryNode pn, IdentityImpl<TransportLayerNodeHandle<MultiInetSocketAddress>,MultiInetSocketAddress,java.nio.ByteBuffer,SourceRoute<MultiInetSocketAddress>> identity, LivenessProvider<MultiInetSocketAddress> live, ProximityProvider<MultiInetSocketAddress> prox, OverrideLiveness<SourceRoute<MultiInetSocketAddress>> overrideLiveness)`
`protected TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer>` | `getWireTransportLayer(java.net.InetSocketAddress innermostAddress, TLPastryNode pn)`
`PastryNode` | `newNode()` Need to boot manually.
`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
`getProximityNeighborSelector, 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`

### getMultiAddressSourceRouteFactory

    protected MultiAddressSourceRouteFactory getMultiAddressSourceRouteFactory(TLPastryNode pn)

### getWireTransportLayer

    protected TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer> 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(TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer> wtl,
                                                                                                          TLPastryNode pn)

### getLimitSocketsTransportLayer

    protected TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer> getLimitSocketsTransportLayer(TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer> mntl,
                                                                                                           TLPastryNode pn)

### getMultiAddressSourceRouteFactory

    protected TransportLayer<MultiInetSocketAddress,java.nio.ByteBuffer> getMultiAddressSourceRouteFactory(TransportLayer<java.net.InetSocketAddress,java.nio.ByteBuffer> mntl,
                                                                                                           TLPastryNode pn,
                                                                                                           MultiInetSocketAddress localAddress)

### getSourceRouteTransportLayer

    protected TransportLayer<SourceRoute<MultiInetSocketAddress>,java.nio.ByteBuffer> getSourceRouteTransportLayer(TransportLayer<MultiInetSocketAddress,java.nio.ByteBuffer> 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`

### getLowerIdentityLayer

    protected TransportLayer<SourceRoute<MultiInetSocketAddress>,java.nio.ByteBuffer> getLowerIdentityLayer(TransportLayer<SourceRoute<MultiInetSocketAddress>,java.nio.ByteBuffer> srl,
                                                                                                            TLPastryNode pn,
                                                                                                            IdentityImpl<TransportLayerNodeHandle<MultiInetSocketAddress>,MultiInetSocketAddress,java.nio.ByteBuffer,SourceRoute<MultiInetSocketAddress>> identity)

### getLivenessTransportLayer

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

### getSourceRouteManagerLayer

    protected SocketPastryNodeFactory.TransLivenessProximity<MultiInetSocketAddress,java.nio.ByteBuffer> getSourceRouteManagerLayer(TransportLayer<SourceRoute<MultiInetSocketAddress>,java.nio.ByteBuffer> ltl,
                                                                                                                                    LivenessProvider<SourceRoute<MultiInetSocketAddress>> livenessProvider,
                                                                                                                                    Pinger<SourceRoute<MultiInetSocketAddress>> pinger,
                                                                                                                                    TLPastryNode pn,
                                                                                                                                    MultiInetSocketAddress proxyAddress,
                                                                                                                                    MultiAddressSourceRouteFactory esrFactory)
                                                                                                                             throws java.io.IOException

  Throws:
    `java.io.IOException`

### getPriorityTransportLayer

    protected TransportLayer<MultiInetSocketAddress,java.nio.ByteBuffer> getPriorityTransportLayer(TransportLayer<MultiInetSocketAddress,java.nio.ByteBuffer> trans,
                                                                                                   LivenessProvider<MultiInetSocketAddress> liveness,
                                                                                                   ProximityProvider<MultiInetSocketAddress> prox,
                                                                                                   TLPastryNode pn)

### getUpperIdentityLayer

    protected SocketPastryNodeFactory.TransLivenessProximity<TransportLayerNodeHandle<MultiInetSocketAddress>,java.nio.ByteBuffer> getUpperIdentityLayer(TransportLayer<MultiInetSocketAddress,java.nio.ByteBuffer> priorityTL,
                                                                                                                                                         TLPastryNode pn,
                                                                                                                                                         IdentityImpl<TransportLayerNodeHandle<MultiInetSocketAddress>,MultiInetSocketAddress,java.nio.ByteBuffer,SourceRoute<MultiInetSocketAddress>> identity,
                                                                                                                                                         LivenessProvider<MultiInetSocketAddress> live,
                                                                                                                                                         ProximityProvider<MultiInetSocketAddress> prox,
                                                                                                                                                         OverrideLiveness<SourceRoute<MultiInetSocketAddress>> overrideLiveness)

### getCommonAPITransportLayer

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

### getBootstrapper

    protected Bootstrapper getBootstrapper(TLPastryNode pn,
                                           NodeHandleAdapter tl,
                                           NodeHandleFactory handleFactory,
                                           ProximityNeighborSelector pns,
                                           java.lang.Object localNodeData)

  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()

  Need to boot manually. n.getBootstrapper().boot(addresses);

  Returns:

### 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`

### cloneEnvironment

    protected Environment cloneEnvironment(Environment rootEnvironment,
                                           Id nodeId)

### cloneLogManager

    protected LogManager cloneLogManager(Environment rootEnvironment,
                                         Id nodeId)

### cloneSelectorManager

    protected SelectorManager cloneSelectorManager(Environment rootEnvironment,
                                                   Id nodeId,
                                                   LogManager lman)

### cloneProcessor

    protected Processor cloneProcessor(Environment rootEnvironment,
                                       Id nodeId,
                                       LogManager lman)

### cloneRandomSource

    protected RandomSource cloneRandomSource(Environment rootEnvironment,
                                             Id nodeId,
                                             LogManager lman)

### verifyConnection

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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2005 - Rice Pastry.