demo.howto
Class DDHowto.Ping

java.lang.Object
  |
  +--dd.api.DDRouteMsg
        |
        +--demo.howto.DDHowto.Ping
All Implemented Interfaces:
QueueElementIF, QuickSerializable
Enclosing class:
DDHowto

public static class DDHowto.Ping
extends DDRouteMsg

One of two DD messages used in this test. I inherit from DDRouteMsg because I'm talking to a specific other node in the network. If I wanted to talk to any node holding an object with GUID g, I would use a DDLocateMsg instead. Other interesting DD message types are:

Refer to the DD javadocs for more details about any of the above.

Since this class inherits from DDRouteMsg, it indirectly inherits from QuickSerializable, meaning that we have to define two main functions:

See below for details.


Field Summary
 int seq
          sequence number to keep track of ping/pong.
 
Fields inherited from class dd.api.DDRouteMsg
dd_intermediate_upcall, hopCount, inbound, one_hop, peer, recursive_route, TTL
 
Constructor Summary
DDHowto.Ping(InputBuffer buffer)
          A deserialization constructor.
DDHowto.Ping(SecureHash dest, boolean recursive, boolean dd_intermediate_upcall, boolean one_hop, int seq)
          A constructor for messages I'm going to send to someone else.
 
Method Summary
 void serialize(OutputBuffer buffer)
          Specified by ostore.util.QuickSerializable A serialization function.
 String toString()
          Specified by java.lang.Object It's always nice for debugging to define one of these.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

seq

public int seq
sequence number to keep track of ping/pong.

Constructor Detail

DDHowto.Ping

public DDHowto.Ping(SecureHash dest,
                    boolean recursive,
                    boolean dd_intermediate_upcall,
                    boolean one_hop,
                    int seq)
A constructor for messages I'm going to send to someone else. Sets the destination node and sequence number.


DDHowto.Ping

public DDHowto.Ping(InputBuffer buffer)
A deserialization constructor. Used by DD on the receiving node to reproduce the message from its "on-the-wire" representation.

Method Detail

serialize

public void serialize(OutputBuffer buffer)
Specified by ostore.util.QuickSerializable A serialization function. Produces the "on-the-wire" representation of this object. Must be the inverse of the deserialization constructor, above, or bad things will happen.

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

toString

public String toString()
Specified by java.lang.Object It's always nice for debugging to define one of these.

Overrides:
toString in class Object