rice.pastry.wire.messaging.datagram
Class DatagramMessage

java.lang.Object
  extended byrice.pastry.wire.messaging.datagram.DatagramMessage
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AcknowledgementMessage, DatagramTransportMessage, PingMessage

public abstract class DatagramMessage
extends java.lang.Object
implements java.io.Serializable

Class which wraps all messages to be sent through the UDP-based pastry protocol. Adds on a "packet number" which should be repeated in the AcknowledgementMessage ack packet.

See Also:
Serialized Form

Field Summary
protected  NodeId destination
          DESCRIBE THE FIELD
protected  int num
          DESCRIBE THE FIELD
protected  NodeId source
          DESCRIBE THE FIELD
 
Constructor Summary
DatagramMessage(NodeId source, NodeId destination, int num)
          Builds a DatagramMessage given a packet number
 
Method Summary
 AcknowledgementMessage getAck(java.net.InetSocketAddress address)
          Returns the approriate 'ack' message for this datagram transport message.
 NodeId getDestination()
          Returns the NodeId which is the destination
 int getNum()
          Returns the "packet number" of this transmission
 NodeId getSource()
          Returns the NodeId from which this message came.
 void setNum(int num)
          Sets the "packet number" of this transmission
 java.lang.String toString()
          DESCRIBE THE METHOD
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

num

protected int num
DESCRIBE THE FIELD


source

protected NodeId source
DESCRIBE THE FIELD


destination

protected NodeId destination
DESCRIBE THE FIELD

Constructor Detail

DatagramMessage

public DatagramMessage(NodeId source,
                       NodeId destination,
                       int num)
Builds a DatagramMessage given a packet number

Parameters:
num - The "packet number"
source - DESCRIBE THE PARAMETER
destination - DESCRIBE THE PARAMETER
Method Detail

getNum

public int getNum()
Returns the "packet number" of this transmission

Returns:
The packet number of this message.

getSource

public NodeId getSource()
Returns the NodeId from which this message came.

Returns:
This message's source

getDestination

public NodeId getDestination()
Returns the NodeId which is the destination

Returns:
This message's destination

getAck

public AcknowledgementMessage getAck(java.net.InetSocketAddress address)
Returns the approriate 'ack' message for this datagram transport message.

Parameters:
address - The address the ack will be sent to
Returns:
The Ack value

setNum

public void setNum(int num)
Sets the "packet number" of this transmission

Parameters:
num - The packet number

toString

public java.lang.String toString()
DESCRIBE THE METHOD

Returns:
DESCRIBE THE RETURN VALUE





Imprint-Dataprotection