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.dist
Class DistPastryNodeFactory

    java.lang.Object
      rice.pastry.PastryNodeFactory
          rice.pastry.dist.DistPastryNodeFactory

Direct Known Subclasses:
  SocketPastryNodeFactory

public abstract class DistPastryNodeFactory
extends PastryNodeFactory

An abstraction of the nodeId factory for distributed nodes. In order to obtain a nodeId factory, a client should use the getFactory method, passing in either PROTOCOL_RMI or PROTOCOL_WIRE as the protocol, and the port number the factory should use. In the wire protocol, the port number is the starting port number that the nodes are constructed on, and in the rmi protocol, the port number is the location of the local RMI registry.

Version:
  $Id: DistPastryNodeFactory.java,v 1.8 2003/12/22 03:24:46 amislove Exp $
Author:
  Alan Mislove

Field Summary
`static int` | `PROTOCOL_DEFAULT` DESCRIBE THE FIELD
`static int` | `PROTOCOL_SOCKET` DESCRIBE THE FIELD

Constructor Summary
`protected` | `DistPastryNodeFactory()` Constructor.

Method Summary
`abstract NodeHandle` | `generateNodeHandle(java.net.InetSocketAddress address)` Method which all subclasses should implement allowing the client to generate a node handle given the address of a node.
`static DistPastryNodeFactory` | `getFactory(NodeIdFactory nf, int protocol, int port)` Static method which is designed to be used by clients needing a distrubuted pastry node factory.
`NodeHandle` | `getNodeHandle(java.net.InetSocketAddress address)` Method which a client should use in order to get a bootstrap node from the factory.
`NodeHandle` | `getNodeHandle(java.net.InetSocketAddress[] addresses)` Method which a client should use in order to get a bootstrap node from the factory.
`abstract PastryNode` | `newNode(NodeHandle bootstrap)` Generates a new pastry node with a random NodeId using the bootstrap bootstrap.
`abstract PastryNode` | `newNode(NodeHandle bootstrap, java.net.InetSocketAddress proxy)` Generates a new pastry node with the specified NodeId using the bootstrap bootstrap.
`abstract PastryNode` | `newNode(NodeHandle bootstrap, NodeId nodeId)` Generates a new pastry node with the specified NodeId using the bootstrap bootstrap.
`abstract PastryNode` | `newNode(NodeHandle bootstrap, NodeId nodeId, java.net.InetSocketAddress proxy)` Generates a new pastry node with the specified NodeId using the bootstrap bootstrap.

Methods inherited from class rice.pastry.PastryNodeFactory
`getLeafSet, getNearest, getProximity, getRouteRow`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### PROTOCOL_SOCKET

    public static int PROTOCOL_SOCKET

  DESCRIBE THE FIELD

### PROTOCOL_DEFAULT

    public static int PROTOCOL_DEFAULT

  DESCRIBE THE FIELD

Constructor Detail

### DistPastryNodeFactory

    protected DistPastryNodeFactory()

  Constructor. Protected - one should use the getFactory method.

Method Detail

### getNodeHandle

    public final NodeHandle getNodeHandle(java.net.InetSocketAddress address)

  Method which a client should use in order to get a bootstrap node from the factory. In the wire protocol, this method will generate a node handle corresponding to the pastry node at location address. In the rmi protocol, this method will generate a node handle for the pastry node bound to address.

  Parameters:
    `address` - The address of the remote node.
  Returns:
    The NodeHandle value

### getNodeHandle

    public final NodeHandle getNodeHandle(java.net.InetSocketAddress[] addresses)

  Method which a client should use in order to get a bootstrap node from the factory. In the wire protocol, this method will generate a node handle corresponding to the pastry node at location address. In the rmi protocol, this method will generate a node handle for the pastry node bound to address.

  Parameters:
    `addresses` - DESCRIBE THE PARAMETER
  Returns:
    The NodeHandle value

### generateNodeHandle

    public abstract NodeHandle generateNodeHandle(java.net.InetSocketAddress address)

  Method which all subclasses should implement allowing the client to generate a node handle given the address of a node. This is designed to allow the client to get their hands on a bootstrap node during the initialization phase of the client application.

  Parameters:
    `address` - DESCRIBE THE PARAMETER
  Returns:
    DESCRIBE THE RETURN VALUE

### newNode

    public abstract PastryNode newNode(NodeHandle bootstrap)

  Generates a new pastry node with a random NodeId using the bootstrap bootstrap.

  Specified by:
    `newNode` in class `PastryNodeFactory`
  Parameters:
    `bootstrap` - Node handle to bootstrap from.
  Returns:
    DESCRIBE THE RETURN VALUE

### newNode

    public abstract PastryNode newNode(NodeHandle bootstrap,
                                       NodeId nodeId)

  Generates a new pastry node with the specified NodeId using the bootstrap bootstrap.

  Specified by:
    `newNode` in class `PastryNodeFactory`
  Parameters:
    `bootstrap` - Node handle to bootstrap from.
    `nodeId` - DESCRIBE THE PARAMETER
  Returns:
    DESCRIBE THE RETURN VALUE

### newNode

    public abstract PastryNode newNode(NodeHandle bootstrap,
                                       NodeId nodeId,
                                       java.net.InetSocketAddress proxy)

  Generates a new pastry node with the specified NodeId using the bootstrap bootstrap.

  Parameters:
    `bootstrap` - Node handle to bootstrap from.
    `nodeId` - DESCRIBE THE PARAMETER
    `proxy` - DESCRIBE THE PARAMETER
  Returns:
    DESCRIBE THE RETURN VALUE

### newNode

    public abstract PastryNode newNode(NodeHandle bootstrap,
                                       java.net.InetSocketAddress proxy)

  Generates a new pastry node with the specified NodeId using the bootstrap bootstrap.

  Parameters:
    `bootstrap` - Node handle to bootstrap from.
    `proxy` - DESCRIBE THE PARAMETER
  Returns:
    DESCRIBE THE RETURN VALUE

### getFactory

    public static DistPastryNodeFactory getFactory(NodeIdFactory nf,
                                                   int protocol,
                                                   int port)

  Static method which is designed to be used by clients needing a distrubuted pastry node factory. The protocol should be one of PROTOCOL_RMI or PROTOCOL_WIRE. The port is protocol-dependent, and is the port number of the RMI registry if using RMI, or is the starting port number the nodes should be created on if using wire.

  Parameters:
    `protocol` - The protocol to use (PROTOCOL_RMI or PROTOCOL_WIRE)
    `port` - The RMI registry port if RMI, or the starting port if wire.
    `nf` - DESCRIBE THE PARAMETER
  Returns:
    A DistPastryNodeFactory using the given protocol and port.
  Throws:
    `java.lang.IllegalArgumentException` - If protocol is an unsupported port.

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.