ostore.network
Class NetworkMessage

java.lang.Object
  |
  +--ostore.network.NetworkMessage
All Implemented Interfaces:
Cloneable, QueueElementIF, QuickSerializable
Direct Known Subclasses:
DynamicDMAckMsg, DynamicDMCastMsg, DynamicGatewayMsg, DynamicMapMsg, DynamicMCReqMsg, DynamicNotifyMsg, DynamicObjMapMsg, DynamicObjReqMsg, DynamicPingMsg, DynamicPongMsg, DynamicRequestMsg, DynamicSurrMsg, DynamicSurrReqMsg, IdentityMessage, PatchworkProbeMsg, PublishMsg, QueryMessage, RouteMsg, RouteObjDestMsg, RouteObjRootMsg, StaticAliveMsg, StaticAllNodesMsg, StaticBeginMsg, StaticPingMsg, StaticPongMsg, StaticReadyMsg, TapestryLocateFailure, Test.Ping, Test.Pong, TopologyDiscoverQuery, TopologyDiscoverResponse, UpdateMessage

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


Field Summary
 boolean inbound
           
 NodeId peer
          If inbound=true then peer is the NodeId of the node where this message came from; otherwise, it's the NodeId of the node where this message should be sent.
 
Constructor Summary
NetworkMessage(byte[] data, int[] offset)
           
NetworkMessage(NodeId peer, boolean inbound)
           
 
Method Summary
 Object clone()
           
 void to_bytes(byte[] data, int[] offset)
          Store the object in its "on the wire" form in the byte array data, starting at index offset [0], and increment offset [0] by the number of bytes written; if data == null, increment offset [0] by the number of bytes that would have been written otherwise.
 String toString()
           
abstract  int type_code()
          Returns the unique integer associated with this class in the TypeTable.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

peer

public NodeId peer
If inbound=true then peer is the NodeId of the node where this message came from; otherwise, it's the NodeId of the node where this message should be sent.

inbound

public boolean inbound
Constructor Detail

NetworkMessage

public NetworkMessage(NodeId peer,
                      boolean inbound)

NetworkMessage

public NetworkMessage(byte[] data,
                      int[] offset)
Method Detail

to_bytes

public void to_bytes(byte[] data,
                     int[] offset)
Description copied from interface: QuickSerializable
Store the object in its "on the wire" form in the byte array data, starting at index offset [0], and increment offset [0] by the number of bytes written; if data == null, increment offset [0] by the number of bytes that would have been written otherwise.
Specified by:
to_bytes in interface QuickSerializable
Following copied from interface: ostore.util.QuickSerializable
Parameters:
data - The byte array to store into, or null.
offset - A single element array whose first element is the index in data to begin writing at on function entry, and which on function exit has been incremented by the number of bytes written.

type_code

public abstract int type_code()
Description copied from interface: QuickSerializable
Returns the unique integer associated with this class in the TypeTable.
Specified by:
type_code in interface QuickSerializable
Following copied from interface: ostore.util.QuickSerializable
Returns:
an integer unique to this class

clone

public Object clone()
             throws CloneNotSupportedException
Overrides:
clone in class Object

toString

public String toString()
Overrides:
toString in class Object