org.planx.xmlstore.routing.operation
Class OriginMessage

java.lang.Object
  extended by org.planx.xmlstore.routing.operation.OriginMessage
All Implemented Interfaces:
Message, Streamable
Direct Known Subclasses:
AcknowledgeMessage, ConnectMessage, DataMessage, HashMessage, HashRequestMessage, LookupMessage, NodeReplyMessage, RemoveMessage, StoreRequestMessage

public abstract class OriginMessage
extends Object
implements Message

A message containing the origin node. This class can be subclassed to implement messages that contain more information.


Field Summary
protected  Node origin
           
 
Constructor Summary
protected OriginMessage()
           
  OriginMessage(DataInput in)
           
  OriginMessage(Node origin)
           
 
Method Summary
abstract  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.
 Node getOrigin()
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

origin

protected Node origin
Constructor Detail

OriginMessage

protected OriginMessage()

OriginMessage

public OriginMessage(Node origin)

OriginMessage

public OriginMessage(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
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
Throws:
IOException

getOrigin

public Node getOrigin()

code

public abstract 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


Copyright © 2010. All Rights Reserved.