ostore.dtree
Class DTreeMsg

java.lang.Object
  |
  +--dd.api.DDRouteMsg
        |
        +--ostore.dtree.DTreeMsg
All Implemented Interfaces:
QueueElementIF, QuickSerializable

public class DTreeMsg
extends DDRouteMsg

Messages sent among nodes in a dissemination tree. Only DTreeNode stages should dispatch or subscribe to events of this type.

A DTreeMsg encapsulates a local event inside a message suitable for sending through DD. Currently all local events use this single wrapper class; it may be preferrable to create individual DDRouteMsg subclasses for each type of message.

Version:
$Id: DTreeMsg.java,v 1.28 2004/05/13 20:13:52 hweather Exp $
Author:
Dennis Geels
See Also:
DDRouteMsg

Field Summary
 QuickSerializable content
          The message to send.
 boolean direction
          One of UPSTREAM or DOWNSTREAM.
static boolean DOWNSTREAM
          Marks a message sent from a node to a child in the tree.
 SecureHash source
          The source (root) of this message.
 SecureHash tree_id
          The name of the tree on which this message is sent.
static boolean UPSTREAM
          Marks a message sent from a node to its parent in the tree.
 
Fields inherited from class dd.api.DDRouteMsg
dd_intermediate_upcall, hopCount, inbound, one_hop, peer, recursive_route, TTL
 
Constructor Summary
DTreeMsg(InputBuffer buffer)
          Creates a DTreeMsg from its QuickSerializable form.
DTreeMsg(SecureHash tree_id, SecureHash dest, SecureHash source, boolean direction, QuickSerializable content, boolean recursive, boolean dd_intermediate_upcall, boolean one_hop)
          Creates a new DTreeMsg.
 
Method Summary
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 String toString()
          Returns a human-readable representation of this DTreeMsg.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UPSTREAM

public static final boolean UPSTREAM
Marks a message sent from a node to its parent in the tree.

See Also:
Constant Field Values

DOWNSTREAM

public static final boolean DOWNSTREAM
Marks a message sent from a node to a child in the tree.

See Also:
Constant Field Values

tree_id

public SecureHash tree_id
The name of the tree on which this message is sent.


source

public SecureHash source
The source (root) of this message.


direction

public boolean direction
One of UPSTREAM or DOWNSTREAM.


content

public QuickSerializable content
The message to send.

Constructor Detail

DTreeMsg

public DTreeMsg(SecureHash tree_id,
                SecureHash dest,
                SecureHash source,
                boolean direction,
                QuickSerializable content,
                boolean recursive,
                boolean dd_intermediate_upcall,
                boolean one_hop)
Creates a new DTreeMsg.

Parameters:
tree_id - The name of the tree down which the message is sent.
dest - The GUID for the server of the destination DTreeNode.
direction - One of UPSTREAM or DOWNSTREAM.
content - The message to send to that DTreeNode.
recursive - See DDRouteMsg.recursive_route for details.
dd_intermediate_upcall - See DDRouteMsg.dd_intermediate_upcall for details.
one_hop - See DDRouteMsg.one_hop for details.

DTreeMsg

public DTreeMsg(InputBuffer buffer)
         throws QSException
Creates a DTreeMsg from its QuickSerializable form.

Method Detail

serialize

public void serialize(OutputBuffer buffer)
Description copied from interface: QuickSerializable
Add the object to the buffer.

Specified by:
serialize in interface QuickSerializable
Overrides:
serialize in class DDRouteMsg
Parameters:
buffer - the output buffer to add the object to

toString

public String toString()
Returns a human-readable representation of this DTreeMsg.

Overrides:
toString in class Object