ostore.network
Class NetworkMessage

java.lang.Object
  |
  +--ostore.network.NetworkMessage
All Implemented Interfaces:
Cloneable, QueueElementIF, QuickSerializable
Direct Known Subclasses:
AuthenticationMsg, CloseConnectionMsg, DebugMsg, DebugRespMsg, DynamicBeginDelete, DynamicDMAckMsg, DynamicEndDelete, DynamicMapMsg, DynamicObjReqMsg, DynamicPingMsg, DynamicPongMsg, DynamicRepairRespMsg, FullTestMemberMsg, FullTestMsg, FullTestRespMsg, IdentityMessage, InjectFaultMsg, LatTest.Msg, Network.NatHackMsg, NonceAckMsg, PartialRepublish, PatchworkFaultMsg, PatchworkProbeMsg, PatchworkRevCountMsg, PeriodicRoutePatch, ProbeMsg, QueryMessage, RepairMonitorStage.AttachMessage, RepairMonitorStage.DetachMessage, RepairMonitorStage.PtrDeletedMsg, RMFoundMsg, RouterFaultMsg, SimpleTest.Msg, StaticAliveMsg, StaticAllNodesMsg, StaticBeginMsg, StaticPangMsg, StaticPingMsg, StaticPongMsg, StaticPtrMsg, StaticReadyMsg, TapestryLocateFailure, TapestryMessage, TestDeleteMsg, TestFoundMsg, TestNetworkMsg, TopologyDiscoverQuery, TopologyDiscoverResponse, TputTest.Msg, UpdateMessage

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


Field Summary
 SinkIF comp_q
          A completion queue to enqueue a success or failure on after this message is successfully acknowledged or times out tries times, respectively; the enqueued object will be of type NetworkMessageResult; if this field is null, no event will be enqueued.
 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.
 NodeId sender
          DO NOT TOUCH THIS FIELD.
 int tries
          Times to attempt sending the message before giving up.
 Object user_data
          A value to place in the NetworkMessageResult so that the calling stage can associate the result with this request.
 
Constructor Summary
NetworkMessage(InputBuffer buffer)
           
NetworkMessage(NodeId peer, boolean inbound)
           
 
Method Summary
 Object clone()
           
 void serialize(OutputBuffer buffer)
          Add the object to the buffer.
 String toString()
           
 
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

sender

public NodeId sender
DO NOT TOUCH THIS FIELD. That said, one of you will ignore me; if you are that person, you had better understand ostore.dispatch.Classifier and ostore.network.MultiplexedNetwork.

tries

public int tries
Times to attempt sending the message before giving up. Depending on the underlying network layer, this field may be ignored.

comp_q

public SinkIF comp_q
A completion queue to enqueue a success or failure on after this message is successfully acknowledged or times out tries times, respectively; the enqueued object will be of type NetworkMessageResult; if this field is null, no event will be enqueued. Depending on the underlying network layer, this field may be ignored.

user_data

public Object user_data
A value to place in the NetworkMessageResult so that the calling stage can associate the result with this request. Depending on the underlying network layer, this field may be ignored.
Constructor Detail

NetworkMessage

public NetworkMessage(NodeId peer,
                      boolean inbound)

NetworkMessage

public NetworkMessage(InputBuffer buffer)
               throws QSException
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
Following copied from interface: ostore.util.QuickSerializable
Parameters:
buffer - the output buffer to add the object to

clone

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

toString

public String toString()
Overrides:
toString in class Object