org.planx.xmlstore.routing.operation
Class StoreMessage

java.lang.Object
  extended by org.planx.xmlstore.routing.operation.OriginMessage
      extended by org.planx.xmlstore.routing.operation.DataMessage
          extended by org.planx.xmlstore.routing.operation.StoreMessage
All Implemented Interfaces:
Message, Streamable

public class StoreMessage
extends DataMessage

Message representing a mapping from a key to a value. If upd is true a StoreMessage with the same key is expected as reply if the receiving node has a newer version of the mapping.


Field Summary
protected  boolean upd
           
 
Fields inherited from class org.planx.xmlstore.routing.operation.DataMessage
key, value
 
Fields inherited from class org.planx.xmlstore.routing.operation.OriginMessage
origin
 
Constructor Summary
protected StoreMessage()
           
  StoreMessage(DataInput in)
           
  StoreMessage(Node origin, Identifier key, TimestampedValue value, boolean upd)
           
 
Method Summary
 byte code()
          The unique code for the message type, used to differentiate all messages from each other.
 void fromStream(DataInput in)
          Reads the internal state of the Streamable object from the input stream.
 void toStream(DataOutput out)
          Writes the internal state of the Streamable object to the output stream in a format that can later be read by the same Streamble class using the Streamable.fromStream(java.io.DataInput) method.
 String toString()
           
 boolean updateRequested()
           
 
Methods inherited from class org.planx.xmlstore.routing.operation.DataMessage
getKey, getValue
 
Methods inherited from class org.planx.xmlstore.routing.operation.OriginMessage
getOrigin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

upd

protected boolean upd
Constructor Detail

StoreMessage

protected StoreMessage()

StoreMessage

public StoreMessage(Node origin,
                    Identifier key,
                    TimestampedValue value,
                    boolean upd)

StoreMessage

public StoreMessage(DataInput in)
             throws IOException
Throws:
IOException
Method Detail

fromStream

public void fromStream(DataInput in)
                throws IOException
Description copied from interface: Streamable
Reads the internal state of the Streamable object from the input stream. Immutable objects should throw an UnsupportedOperationException, and instead implement a constructor as described above.

Specified by:
fromStream in interface Streamable
Overrides:
fromStream in class DataMessage
Throws:
IOException

toStream

public void toStream(DataOutput out)
              throws IOException
Description copied from interface: Streamable
Writes the internal state of the Streamable object to the output stream in a format that can later be read by the same Streamble class using the Streamable.fromStream(java.io.DataInput) method.

Specified by:
toStream in interface Streamable
Overrides:
toStream in class DataMessage
Throws:
IOException

updateRequested

public boolean updateRequested()

code

public byte code()
Description copied from interface: Message
The unique code for the message type, used to differentiate all messages from each other. Since this is of byte type there can be at most 256 different message types.

Specified by:
code in interface Message
Overrides:
code in class DataMessage

toString

public String toString()
Overrides:
toString in class DataMessage


Copyright © 2010. All Rights Reserved.