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
Interface NetworkSimulator

All Known Implementing Classes:
  BasicNetworkSimulator

public interface NetworkSimulator

Interface to an object which is simulating the network.

Version:
  $Id: NetworkSimulator.java 2805 2005-11-17 16:22:24Z jeffh $
Author:
  Andrew Ladd

Method Summary
`void` | `deliverMessage(Message msg, DirectPastryNode node)` Deliver message ASAP.
`ScheduledMessage` | `deliverMessage(Message msg, DirectPastryNode node, int delay)` Deliver message.
`ScheduledMessage` | `deliverMessage(Message msg, DirectPastryNode node, int delay, int period)` Deliver message.
`ScheduledMessage` | `deliverMessageFixedRate(Message msg, DirectPastryNode node, int delay, int period)` Deliver message.
`void` | `destroy(DirectPastryNode dpn)` DESCRIBE THE METHOD
`NodeRecord` | `generateNodeRecord()` Generates a random node record
`DirectNodeHandle` | `getClosest(DirectNodeHandle nh)` Returns the closest Node in proximity.
`Environment` | `getEnvironment()` Gets the Environment attribute of the NetworkSimulator object
`TestRecord` | `getTestRecord()` Gets the TestRecord attribute of the NetworkSimulator object
`boolean` | `isAlive(DirectNodeHandle nh)` Checks to see if a node id is alive.
`int` | `proximity(DirectNodeHandle a, DirectNodeHandle b)` Determines proximity between two nodes.
`void` | `registerNode(DirectPastryNode dpn)` Registers a node handle with the simulator.
`void` | `removeNode(DirectPastryNode node)` DESCRIBE THE METHOD
`void` | `setTestRecord(TestRecord tr)` Sets the TestRecord attribute of the NetworkSimulator object
`boolean` | `simulate()` Simulate one message delivery.
`boolean` | `simulateFor(int millis)` Simulate for that many millis
`boolean` | `simulateUntil(long time)` Deliver messages until the clock reaches time

Method Detail

### getEnvironment

    public Environment getEnvironment()

  Gets the Environment attribute of the NetworkSimulator object

  Returns:
    The Environment value

### registerNode

    public void registerNode(DirectPastryNode dpn)

  Registers a node handle with the simulator.

  Parameters:
    `dpn` - DESCRIBE THE PARAMETER

### isAlive

    public boolean isAlive(DirectNodeHandle nh)

  Checks to see if a node id is alive.

  Parameters:
    `nh` - DESCRIBE THE PARAMETER
  Returns:
    true if alive, false otherwise.

### proximity

    public int proximity(DirectNodeHandle a,
                         DirectNodeHandle b)

  Determines proximity between two nodes.

  Parameters:
    `a` - a node id.
    `b` - another node id.
  Returns:
    proximity of b to a.

### deliverMessage

    public ScheduledMessage deliverMessage(Message msg,
                                           DirectPastryNode node,
                                           int delay)

  Deliver message.

  Parameters:
    `msg` - message to deliver.
    `node` - the Pastry node to deliver it to.
    `delay` - DESCRIBE THE PARAMETER
  Returns:
    DESCRIBE THE RETURN VALUE

### deliverMessage

    public ScheduledMessage deliverMessage(Message msg,
                                           DirectPastryNode node,
                                           int delay,
                                           int period)

  Deliver message.

  Parameters:
    `msg` - message to deliver.
    `node` - the Pastry node to deliver it to.
    `period` - to deliver the message after the delay
    `delay` - DESCRIBE THE PARAMETER
  Returns:
    DESCRIBE THE RETURN VALUE

### deliverMessageFixedRate

    public ScheduledMessage deliverMessageFixedRate(Message msg,
                                                    DirectPastryNode node,
                                                    int delay,
                                                    int period)

  Deliver message.

  Parameters:
    `msg` - message to deliver.
    `node` - the Pastry node to deliver it to.
    `period` - to deliver the message after the delay
    `delay` - DESCRIBE THE PARAMETER
  Returns:
    DESCRIBE THE RETURN VALUE

### deliverMessage

    public void deliverMessage(Message msg,
                               DirectPastryNode node)

  Deliver message ASAP.

  Parameters:
    `msg` - message to deliver.
    `node` - the Pastry node to deliver it to.

### simulate

    public boolean simulate()

  Simulate one message delivery.

  Returns:
    true if a message was delivered, false otherwise.

### simulateUntil

    public boolean simulateUntil(long time)

  Deliver messages until the clock reaches time

  Parameters:
    `time` - the time to simulate until
  Returns:

### simulateFor

    public boolean simulateFor(int millis)

  Simulate for that many millis

  Parameters:
    `millis` - the amount of time to simulate until
  Returns:

### setTestRecord

    public void setTestRecord(TestRecord tr)

  Sets the TestRecord attribute of the NetworkSimulator object

  Parameters:
    `tr` - The new TestRecord value

### getTestRecord

    public TestRecord getTestRecord()

  Gets the TestRecord attribute of the NetworkSimulator object

  Returns:
    The TestRecord value

### getClosest

    public DirectNodeHandle getClosest(DirectNodeHandle nh)

  Returns the closest Node in proximity.

  Parameters:
    `nh` - DESCRIBE THE PARAMETER
  Returns:

### destroy

    public void destroy(DirectPastryNode dpn)

  DESCRIBE THE METHOD

  Parameters:
    `dpn` - DESCRIBE THE PARAMETER

### generateNodeRecord

    public NodeRecord generateNodeRecord()

  Generates a random node record

  Returns:

### removeNode

    public void removeNode(DirectPastryNode node)

  DESCRIBE THE METHOD

  Parameters:
    `node` - DESCRIBE THE PARAMETER

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.