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.direct
Class DirectPastryNodeFactory

    java.lang.Object
      rice.pastry.PastryNodeFactory
          rice.pastry.transport.TransportPastryNodeFactory
              rice.pastry.direct.DirectPastryNodeFactory

    public class DirectPastryNodeFactory

extends TransportPastryNodeFactory

Pastry node factory for direct connections between nodes (local instances).

Version:
  $Id: DirectPastryNodeFactory.java 4221 2008-05-19 16:41:19Z jeffh $
Author:
  Andrew Ladd, Sitaram Iyer, Rongmei Zhang/Y. Charlie Hu

Field Summary
`protected java.util.Collection<NodeHandleFactoryListener<NodeHandle>>` | `listeners`
`protected NodeIdFactory` | `nidFactory`
`protected NetworkSimulator` | `simulator`

Fields inherited from class rice.pastry.transport.TransportPastryNodeFactory
`leafSetMaintFreq, routeSetMaintFreq`

Fields inherited from class rice.pastry.PastryNodeFactory
`environment, logger, lSetSize, rtBase, rtMax`

Constructor Summary
`DirectPastryNodeFactory(NodeIdFactory nf, NetworkSimulator sim, Environment env)` Main constructor.

Method Summary
`protected Bootstrapper` | `getBootstrapper(PastryNode pn, NodeHandleAdapter tl, NodeHandleFactory handleFactory, ProximityNeighborSelector pns)`
`LeafSet` | `getLeafSet(NodeHandle handle)` This method returns the remote leafset of the provided handle to the caller, in a protocol-dependent fashion.
`CancellableTask` | `getLeafSet(NodeHandle handle, Continuation c)`
`protected NodeHandle` | `getLocalHandle(PastryNode pn, NodeHandleFactory handleFactory)`
`NetworkSimulator` | `getNetworkSimulator()` Getter for the NetworkSimulator.
`protected NodeHandleAdapter` | `getNodeHandleAdapter(PastryNode pn, NodeHandleFactory handleFactory, TLDeserializer deserializer)`
`protected NodeHandleFactory` | `getNodeHandleFactory(PastryNode pn)`
`int` | `getProximity(NodeHandle local, NodeHandle remote)` This method determines and returns the proximity of the current local node the provided NodeHandle.
`RouteSet[]` | `getRouteRow(NodeHandle handle, int row)` This method returns the remote route row of the provided handle to the caller, in a protocol-dependent fashion.
`CancellableTask` | `getRouteRow(NodeHandle handle, int row, Continuation c)`
`PastryNode` | `newNode()`
`PastryNode` | `newNode(Id nodeId)` Manufacture a new Pastry node.
`PastryNode` | `newNode(NodeHandle bootstrap)` Manufacture a new Pastry node.
`PastryNode` | `newNode(NodeHandle bootstrap, Id nodeId)` Call this to construct a new node of the type chosen by the factory, with the given nodeId.

Methods inherited from class rice.pastry.transport.TransportPastryNodeFactory
`getJoinProtocol, getLeafSetProtocol, getProximityNeighborSelector, getRouterStrategy, getRouteSetProtocol, getTLDeserializer, nodeHandleHelper, registerApps`

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

### nidFactory

    protected NodeIdFactory nidFactory

### simulator

    protected NetworkSimulator simulator

### listeners

    protected java.util.Collection<NodeHandleFactoryListener<NodeHandle>> listeners

Constructor Detail

### DirectPastryNodeFactory

    public DirectPastryNodeFactory(NodeIdFactory nf,
                                   NetworkSimulator sim,
                                   Environment env)

  Main constructor.

  Parameters:
    `nf` - the NodeIdFactory
    `sim` - the NetworkSimulator
    `e` - the Enviornment

Method Detail

### getNetworkSimulator

    public NetworkSimulator getNetworkSimulator()

  Getter for the NetworkSimulator.

  Returns:
    the NetworkSimulator we are using.

### newNode

    public PastryNode newNode(NodeHandle bootstrap)

  Manufacture a new Pastry node.

  Specified by:
    `newNode` in class `PastryNodeFactory`
  Parameters:
    `bootstrap` - The node handle to bootstrap off of
  Returns:
    a new PastryNode

### newNode

    public PastryNode newNode()
                       throws java.io.IOException

  Specified by:
    `newNode` in class `PastryNodeFactory`
  Throws:
    `java.io.IOException`

### newNode

    public PastryNode newNode(NodeHandle bootstrap,
                              Id nodeId)

  Description copied from class: `PastryNodeFactory`
  Call this to construct a new node of the type chosen by the factory, with the given nodeId.

  Specified by:
    `newNode` in class `PastryNodeFactory`
  Parameters:
    `bootstrap` - The node handle to bootstrap off of
    `nodeId` - The nodeId of the new node

### newNode

    public PastryNode newNode(Id nodeId)
                       throws java.io.IOException

  Manufacture a new Pastry node.

  Specified by:
    `newNode` in class `PastryNodeFactory`
  Returns:
    a new PastryNode
  Throws:
    `java.io.IOException`

### getLeafSet

    public LeafSet getLeafSet(NodeHandle handle)
                       throws java.io.IOException

  This method returns the remote leafset of the provided handle to the caller, in a protocol-dependent fashion. Note that this method may block while sending the message across the wire.

  Parameters:
    `handle` - The node to connect to
  Returns:
    The leafset of the remote node
  Throws:
    `java.io.IOException`

### getLeafSet

    public CancellableTask getLeafSet(NodeHandle handle,
                                      Continuation c)

### getRouteRow

    public RouteSet[] getRouteRow(NodeHandle handle,
                                  int row)
                           throws java.io.IOException

  This method returns the remote route row of the provided handle to the caller, in a protocol-dependent fashion. Note that this method may block while sending the message across the wire.

  Parameters:
    `handle` - The node to connect to
    `row` - The row number to retrieve
  Returns:
    The route row of the remote node
  Throws:
    `java.io.IOException`

### getRouteRow

    public CancellableTask getRouteRow(NodeHandle handle,
                                       int row,
                                       Continuation c)

### getProximity

    public int getProximity(NodeHandle local,
                            NodeHandle remote)

  This method determines and returns the proximity of the current local node the provided NodeHandle. This will need to be done in a protocol- dependent fashion and may need to be done in a special way.

  Parameters:
    `handle` - The handle to determine the proximity of
  Returns:
    The proximity of the provided handle

### getLocalHandle

    protected NodeHandle getLocalHandle(PastryNode pn,
                                        NodeHandleFactory handleFactory)
                                 throws java.io.IOException

  Specified by:
    `getLocalHandle` in class `TransportPastryNodeFactory`
  Throws:
    `java.io.IOException`

### getNodeHandleFactory

    protected NodeHandleFactory getNodeHandleFactory(PastryNode pn)
                                              throws java.io.IOException

  Specified by:
    `getNodeHandleFactory` in class `TransportPastryNodeFactory`
  Throws:
    `java.io.IOException`

### getNodeHandleAdapter

    protected NodeHandleAdapter getNodeHandleAdapter(PastryNode pn,
                                                     NodeHandleFactory handleFactory,
                                                     TLDeserializer deserializer)
                                              throws java.io.IOException

  Specified by:
    `getNodeHandleAdapter` in class `TransportPastryNodeFactory`
  Throws:
    `java.io.IOException`

### getBootstrapper

    protected Bootstrapper getBootstrapper(PastryNode pn,
                                           NodeHandleAdapter tl,
                                           NodeHandleFactory handleFactory,
                                           ProximityNeighborSelector pns)

  Specified by:
    `getBootstrapper` in class `TransportPastryNodeFactory`

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.