dd.directmail.impl
Class DirectMailMsg

java.lang.Object
  |
  +--ostore.network.NetworkMessage
        |
        +--dd.directmail.impl.DirectMailMsg
All Implemented Interfaces:
Cloneable, QueueElementIF, QuickSerializable

public class DirectMailMsg
extends NetworkMessage
implements QuickSerializable

DirectMailMsg is a message sent out and forwarded by the DirectMailStage as a type of multicast msg that will efficiently deliver the msg to all the nodes in the system.

Version:
$Id: DirectMailMsg.java,v 1.1.1.1 2004/04/06 00:09:57 hweather Exp $
Author:
Hakim Weatherspoon

Field Summary
 int currentRadius
          currentRadius is the number of hops between the src node and the local node.
 QSVector path
          path includes all the nodes that the DirectMailMsg has visited (i.e. src to local node).
 
Fields inherited from class ostore.network.NetworkMessage
comp_q, est_rtt_ms, inbound, peer, sender, tries, user_data, wait_ms
 
Constructor Summary
DirectMailMsg(DirectMail mail, NodeId peer, SecureHash src, int currentRadius, int targetRadius, QSVector path, long nonce)
          Constucts a data-driven server hb message from specified parameters.
DirectMailMsg(InputBuffer buffer)
          Constructs a DirectMailMsg from its serialized form.
 
Method Summary
 Object clone()
          Specified by java.lang.Object
 int getCurrentRadius()
          getCurrentRadius returns the number of hops between the src node and the local node.
 DirectMail getMail()
          getMail returns the mail that is to be delivered to every node.
 QSVector getPath()
          getPath returns the path that includes all the nodes that the DirectMailMsg has visited (i.e. src to local node).
 SecureHash getSrc()
          getSrc returns the mail that is to be delivered to every node.
 int getTargetRadius()
          getTargetRadius returns the maximum radius for the mail msg; that is, TTL.
 SecureHash getXactId()
          getXactId returns xactId of the DirectMailMsg
 void serialize(OutputBuffer buffer)
          Specified by ostore.util.QuickSerializable
 String toString()
          Specified by java.lang.Object
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

currentRadius

public int currentRadius
currentRadius is the number of hops between the src node and the local node.


path

public QSVector path
path includes all the nodes that the DirectMailMsg has visited (i.e. src to local node).

Constructor Detail

DirectMailMsg

public DirectMailMsg(DirectMail mail,
                     NodeId peer,
                     SecureHash src,
                     int currentRadius,
                     int targetRadius,
                     QSVector path,
                     long nonce)
Constucts a data-driven server hb message from specified parameters.

Parameters:
mail - The mail msg itself to be delivered to each node.
peer - NodeId of next forward hop.
src - Identifier of the src node
currentRadius - number of hops between src peer node and local node.
targetRadius - Max radius for heartbeat i.e. TTL.
path - All the nodes that the DirectMailMsg has visited.
nonce - unique number like a monotonically increasing number or current time, etc. Used in a transaction id for msg.

DirectMailMsg

public DirectMailMsg(InputBuffer buffer)
              throws QSException
Constructs a DirectMailMsg from its serialized form.

Parameters:
buffer - serialized form of object.
Method Detail

serialize

public void serialize(OutputBuffer buffer)
Specified by ostore.util.QuickSerializable

Specified by:
serialize in interface QuickSerializable
Overrides:
serialize in class NetworkMessage

getMail

public DirectMail getMail()
getMail returns the mail that is to be delivered to every node.

Returns:
the mail that is to be delivered to every node.

getSrc

public SecureHash getSrc()
getSrc returns the mail that is to be delivered to every node.

Returns:
the mail that is to be delivered to every node.

getTargetRadius

public int getTargetRadius()
getTargetRadius returns the maximum radius for the mail msg; that is, TTL.

Returns:
the maximum radius for the mail msg; that is, TTL.

getCurrentRadius

public int getCurrentRadius()
getCurrentRadius returns the number of hops between the src node and the local node.

Returns:
the number of hops between the src node and the local node.

getXactId

public SecureHash getXactId()
getXactId returns xactId of the DirectMailMsg

Returns:
the mail that is to be delivered to every node.

getPath

public QSVector getPath()
getPath returns the path that includes all the nodes that the DirectMailMsg has visited (i.e. src to local node).

Returns:
the path from src to localnode.

clone

public Object clone()
             throws CloneNotSupportedException
Specified by java.lang.Object

Overrides:
clone in class NetworkMessage
CloneNotSupportedException

toString

public String toString()
Specified by java.lang.Object

Overrides:
toString in class NetworkMessage