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 DirectNodeHandle

    java.lang.Object
      java.util.Observable
          rice.p2p.commonapi.NodeHandle
              org.mpisws.p2p.transport.commonapi.TransportLayerNodeHandle<Identifier>
                  rice.pastry.NodeHandle<NodeRecord>
                      rice.pastry.direct.DirectNodeHandle

All Implemented Interfaces:
  java.io.Serializable, java.util.Observer

    public class DirectNodeHandle

extends NodeHandle<NodeRecord>
implements java.util.Observer

the node handle used with the direct network

Version:
  $Id: DirectNodeHandle.java 3832 2007-08-27 12:25:35Z jeffh $
Author:
  Andrew Ladd, Rongmei Zhang/Y. Charlie Hu
See Also:
  Serialized Form

Field Summary
`NetworkSimulator` | `simulator`

Fields inherited from class rice.pastry.NodeHandle
`LIVENESS_ALIVE, LIVENESS_DEAD, LIVENESS_SUSPECTED, localnode, logger`

Fields inherited from class rice.p2p.commonapi.NodeHandle
`DECLARED_DEAD, DECLARED_LIVE, PROXIMITY_CHANGED`

Method Summary
`void` | `assertLocalNode()` May be called from handle etc methods to ensure that local node has been set, either on construction or on deserialization/receivemsg.
`boolean` | `equals(java.lang.Object obj)` Equivalence relation for nodehandles.
`NodeRecord` | `getAddress()`
`long` | `getEpoch()`
`int` | `getLiveness()` Gets the Alive attribute of the DirectNodeHandle object
`Id` | `getNodeId()` Gets the NodeId attribute of the DirectNodeHandle object
`TLPastryNode` | `getRemote()` Gets the Remote attribute of the DirectNodeHandle object
`NetworkSimulator` | `getSimulator()` Gets the Simulator attribute of the DirectNodeHandle object
`int` | `hashCode()` Hash codes for node handles.It is the hashcode of their corresponding NodeId's.
`void` | `notifyObservers(java.lang.Object arg)` DESCRIBE THE METHOD
`boolean` | `ping()` DESCRIBE THE METHOD
`int` | `proximity()` Deprecated.
`void` | `receiveMessage(Message msg)` Deprecated. use PastryNode.send()
`void` | `serialize(OutputBuffer buf)`
`java.lang.String` | `toString()` DESCRIBE THE METHOD
`void` | `update(java.util.Observable arg0, java.lang.Object arg1)` Only notify if dead.

Methods inherited from class rice.pastry.NodeHandle
`addObserver, addObserver, bootstrap, checkLiveness, countObservers, deleteObserver, deleteObservers, getId, getLocalNode, isAlive, update`

Methods inherited from class java.util.Observable
`clearChanged, hasChanged, notifyObservers, setChanged`

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

Field Detail

### simulator

    public transient NetworkSimulator simulator

Method Detail

### getRemote

    public TLPastryNode getRemote()

  Gets the Remote attribute of the DirectNodeHandle object

  Returns:
    The Remote value

### getNodeId

    public Id getNodeId()

  Gets the NodeId attribute of the DirectNodeHandle object

  Specified by:
    `getNodeId` in class `NodeHandle<NodeRecord>`
  Returns:
    The NodeId value

### getLiveness

    public int getLiveness()

  Gets the Alive attribute of the DirectNodeHandle object

  Specified by:
    `getLiveness` in class `NodeHandle<NodeRecord>`
  Returns:
    The Alive value

### getSimulator

    public NetworkSimulator getSimulator()

  Gets the Simulator attribute of the DirectNodeHandle object

  Returns:
    The Simulator value

### notifyObservers

    public void notifyObservers(java.lang.Object arg)

  DESCRIBE THE METHOD

  Overrides:
    `notifyObservers` in class `NodeHandle<NodeRecord>`
  Parameters:
    `arg` - DESCRIBE THE PARAMETER

### ping

    public boolean ping()

  DESCRIBE THE METHOD

  Specified by:
    `ping` in class `NodeHandle<NodeRecord>`
  Returns:
    DESCRIBE THE RETURN VALUE

### assertLocalNode

    public final void assertLocalNode()

  Description copied from class: `NodeHandle`
  May be called from handle etc methods to ensure that local node has been set, either on construction or on deserialization/receivemsg.

  Overrides:
    `assertLocalNode` in class `NodeHandle<NodeRecord>`

### proximity

    public int proximity()

  Deprecated.

  DESCRIBE THE METHOD

  Specified by:
    `proximity` in class `NodeHandle<NodeRecord>`
  Returns:
    DESCRIBE THE RETURN VALUE

### receiveMessage

    public void receiveMessage(Message msg)

  Deprecated. use PastryNode.send()

  DESCRIBE THE METHOD

  Specified by:
    `receiveMessage` in class `NodeHandle<NodeRecord>`
  Parameters:
    `msg` - DESCRIBE THE PARAMETER

### equals

    public boolean equals(java.lang.Object obj)

  Equivalence relation for nodehandles. They are equal if and only if their corresponding NodeIds are equal.

  Specified by:
    `equals` in class `NodeHandle<NodeRecord>`
  Parameters:
    `obj` - the other nodehandle .
  Returns:
    true if they are equal, false otherwise.

### hashCode

    public int hashCode()

  Hash codes for node handles.It is the hashcode of their corresponding NodeId's.

  Specified by:
    `hashCode` in class `NodeHandle<NodeRecord>`
  Returns:
    a hash code.

### toString

    public java.lang.String toString()

  DESCRIBE THE METHOD

  Overrides:
    `toString` in class `java.lang.Object`
  Returns:
    DESCRIBE THE RETURN VALUE

### update

    public void update(java.util.Observable arg0,
                       java.lang.Object arg1)

  Only notify if dead. Note that this is limitied in that it's not possible to simulate a byzantine failure of a node. But that's out of the scope of the simulator. If we leave in the first arg, the node notifies DECLARED_LIVE way too often.

  Specified by:
    `update` in interface `java.util.Observer`

### serialize

    public void serialize(OutputBuffer buf)
                   throws java.io.IOException

  Specified by:
    `serialize` in class `NodeHandle<NodeRecord>`
  Throws:
    `java.io.IOException`

### getAddress

    public NodeRecord getAddress()

  Specified by:
    `getAddress` in class `TransportLayerNodeHandle<NodeRecord>`

### getEpoch

    public long getEpoch()

  Specified by:
    `getEpoch` in class `TransportLayerNodeHandle<NodeRecord>`

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.