bamboo.vivaldi
Class LocateNodeMsg

java.lang.Object
  extended by bamboo.vivaldi.LocateNodeMsg
All Implemented Interfaces:
ostore.util.QuickSerializable, QueueElementIF

public class LocateNodeMsg
extends Object
implements ostore.util.QuickSerializable, QueueElementIF

A message used to pick a random node in the bamboo overlay for updating the sender's virtual coordinate. Upon receipt, a node will respond with a LocateNodeResp to tell the sender it's node id and current virtual coordinate.

The sending node also includes its current virtual coordinate, in case the remote node wishes to use the response message to update its own virtual coordinate.

Version:
$Id: LocateNodeMsg.java,v 1.2 2004/03/09 22:04:37 czerwin Exp $
Author:
Steven Czerwinski

Constructor Summary
LocateNodeMsg(ostore.util.InputBuffer buffer)
          Deserializes an existing request from the input buffer (network).
LocateNodeMsg(ostore.util.NodeId requestor, VirtualCoordinate coord, int version)
          Creates a new request, ready to be sent out to the network.
 
Method Summary
 ostore.util.NodeId getRequestor()
          Returns the id of the node who orginally made this request.
 VirtualCoordinate getRequestorCoord()
          Returns the virtual coordinate of the requestor.
 int getVersion()
          Returns the virtual coordinate version number of the requestor.
 void serialize(ostore.util.OutputBuffer buffer)
          Serializes this object.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LocateNodeMsg

public LocateNodeMsg(ostore.util.NodeId requestor,
                     VirtualCoordinate coord,
                     int version)
Creates a new request, ready to be sent out to the network.

Parameters:
requestor - The node orginiating this request.
coord - The requestor's current virtual coordinate.

LocateNodeMsg

public LocateNodeMsg(ostore.util.InputBuffer buffer)
              throws ostore.util.QSException
Deserializes an existing request from the input buffer (network).

Parameters:
buffer - The buffer from which to retreive the object.
Throws:
ostore.util.QSException
Method Detail

getRequestor

public ostore.util.NodeId getRequestor()
Returns the id of the node who orginally made this request.

Returns:
The sender's node id.

getRequestorCoord

public VirtualCoordinate getRequestorCoord()
Returns the virtual coordinate of the requestor.


getVersion

public int getVersion()
Returns the virtual coordinate version number of the requestor.


serialize

public void serialize(ostore.util.OutputBuffer buffer)
Serializes this object.

Specified by:
serialize in interface ostore.util.QuickSerializable

toString

public String toString()
Overrides:
toString in class Object