dd.directmail.api
Class DirectMail

java.lang.Object
  |
  +--dd.directmail.api.DirectMail
All Implemented Interfaces:
Cloneable, QueueElementIF, QuickSerializable
Direct Known Subclasses:
DirectMailTester.DoneTestDirectMail, DirectMailTester.TestDirectMail, HostHbStage.DeadMail, HostHbStage.HostHb, HostHbTester.ControlDirectMail, HostHbTester.PhaseDirectMail, Test.TestMasterDirectMail

public abstract class DirectMail
extends Object
implements QuickSerializable, Cloneable, QueueElementIF

DirectMail is mail (i.e. msg) sent out and forwarded by the DirectMailStage as a type of multicast msg that will efficiently deliver the mail to all the nodes in the system.

Version:
$Id: DirectMail.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.
 boolean inbound
          Whether this message is being received (true) or sent (false).
 
Constructor Summary
DirectMail(InputBuffer buffer)
          Constructs a DirectMail from its serialized form.
DirectMail(SecureHash src, int targetRadius, long srcTime)
          Constucts a data-driven server hb message from specified parameters.
 
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.
 SecureHash getSrc()
          getSrc returns the mail that is to be delivered to every node.
 long getSrcTime()
          getSrcTime returns the current time of the src server in microseconds.
 int getTargetRadius()
          getTargetRadius returns the maximum radius for the mail msg; that is, TTL.
 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

inbound

public boolean inbound
Whether this message is being received (true) or sent (false).


currentRadius

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

Constructor Detail

DirectMail

public DirectMail(SecureHash src,
                  int targetRadius,
                  long srcTime)
Constucts a data-driven server hb message from specified parameters.

Parameters:
src - Identifier of the src node
targetRadius - Max radius for DirectMail i.e. TTL.
srcTime - Current time of the src server in microseconds.

DirectMail

public DirectMail(InputBuffer buffer)
           throws QSException
Constructs a DirectMail 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

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.

getSrcTime

public long getSrcTime()
getSrcTime returns the current time of the src server in microseconds.

Returns:
current time of the src server in microseconds.

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.

clone

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

Overrides:
clone in class Object
CloneNotSupportedException

toString

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

Overrides:
toString in class Object