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.testing
Class PingClient

    java.lang.Object
      rice.pastry.client.PastryAppl
          rice.pastry.testing.PingClient

    public class PingClient

extends PastryAppl

A very simple ping object.

Version:
  $Id: PingClient.java 3613 2007-02-15 14:45:14Z jstewart $
Author:
  Andrew Ladd

Field Summary

Fields inherited from class rice.pastry.client.PastryAppl
`address, deserializer, instance, logger, options, receiver, thePastryNode`

Constructor Summary
`PingClient(PastryNode pn)`

Method Summary
`boolean` | `enrouteMessage(Message msg, Id from, NodeHandle nextHop, SendOptions opt)` Called by pastry when a message is enroute and is passing through this node.
`int` | `getAddress()` Returns the address of this application.
`void` | `leafSetChange(NodeHandle nh, boolean wasAdded)` Called by pastry when the leaf set changes.
`void` | `messageForAppl(Message msg)` Called by pastry when a message arrives for this application.
`void` | `routeSetChange(NodeHandle nh, boolean wasAdded)` Called by pastry when the route set changes.
`void` | `sendPing(Id nid)`
`void` | `sendTrace(Id nid)`

Methods inherited from class rice.pastry.client.PastryAppl
`accept, canReceiveSocket, connect, deliverWhenNotReady, destroy, finishReceiveSocket, getDeserializer, getLeafSet, getNodeHandle, getNodeId, getRoutingTable, isClosest, notifyReady, receiveMessage, receiveMessageInternal, register, routeMsg, routeMsg, routeMsgDirect, setDeserializer`

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

Constructor Detail

### PingClient

    public PingClient(PastryNode pn)

Method Detail

### getAddress

    public int getAddress()

  Description copied from class: `PastryAppl`
  Returns the address of this application.

  Overrides:
    `getAddress` in class `PastryAppl`
  Returns:
    the address.

### sendPing

    public void sendPing(Id nid)

### sendTrace

    public void sendTrace(Id nid)

### messageForAppl

    public void messageForAppl(Message msg)

  Description copied from class: `PastryAppl`
  Called by pastry when a message arrives for this application.

  Specified by:
    `messageForAppl` in class `PastryAppl`
  Parameters:
    `msg` - the message that is arriving.

### enrouteMessage

    public boolean enrouteMessage(Message msg,
                                  Id from,
                                  NodeHandle nextHop,
                                  SendOptions opt)

  Description copied from class: `PastryAppl`
  Called by pastry when a message is enroute and is passing through this node. If this method is not overridden, the default behaviour is to let the message pass through.

  Overrides:
    `enrouteMessage` in class `PastryAppl`
  Parameters:
    `msg` - the message that is passing through.
    `from` - the key
    `nextHop` - the default next hop for the message.
    `opt` - the send options the message was sent with.
  Returns:
    true if the message should be routed, false if the message should be cancelled.

### leafSetChange

    public void leafSetChange(NodeHandle nh,
                              boolean wasAdded)

  Description copied from class: `PastryAppl`
  Called by pastry when the leaf set changes.

  Overrides:
    `leafSetChange` in class `PastryAppl`
  Parameters:
    `nh` - the handle of the node that was added or removed.
    `wasAdded` - true if the node was added, false if the node was removed.

### routeSetChange

    public void routeSetChange(NodeHandle nh,
                               boolean wasAdded)

  Description copied from class: `PastryAppl`
  Called by pastry when the route set changes.

  Overrides:
    `routeSetChange` in class `PastryAppl`
  Parameters:
    `nh` - the handle of the node that was added or removed.
    `wasAdded` - true if the node was added, false if the node was removed.

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.