rice.p2p.past.messaging
Class PastMessage

java.lang.Object
  extended byrice.p2p.past.messaging.PastMessage
All Implemented Interfaces:
Message, java.io.Serializable
Direct Known Subclasses:
CacheMessage, ContinuationMessage, MessageLostMessage

public abstract class PastMessage
extends java.lang.Object
implements Message

See Also:
Serialized Form

Field Summary
protected  Id dest
           
protected  int id
           
protected  boolean isResponse
           
protected  NodeHandle source
           
 
Constructor Summary
protected PastMessage(int id, NodeHandle source, Id dest)
          Constructor which takes a unique integer Id
 
Method Summary
 void addHop(NodeHandle handle)
          Method which is designed to be overridden by subclasses if they need to keep track of where they've been.
 Id getDestination()
          Method which returns this messages' destination address
 NodeHandle getSource()
          Method which returns this messages' source address
 int getUID()
          Method which returns this messages' unique id
 boolean isResponse()
          Method which returns whether or not this message is a response.
abstract  void returnResponse(Continuation c)
          Method by which this message is supposed to return it's response.
protected  void setResponse()
          Method which builds a response for this message, using the provided object as a result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected int id

source

protected NodeHandle source

dest

protected Id dest

isResponse

protected boolean isResponse
Constructor Detail

PastMessage

protected PastMessage(int id,
                      NodeHandle source,
                      Id dest)
Constructor which takes a unique integer Id

Parameters:
id - The unique id
source - The source address
dest - The destination address
Method Detail

getUID

public int getUID()
Method which returns this messages' unique id

Returns:
The id of this message

getSource

public NodeHandle getSource()
Method which returns this messages' source address

Returns:
The source of this message

getDestination

public Id getDestination()
Method which returns this messages' destination address

Returns:
The dest of this message

setResponse

protected void setResponse()
Method which builds a response for this message, using the provided object as a result. Should be overriden by subclasses, but with the super.setResponse() called.


isResponse

public boolean isResponse()
Method which returns whether or not this message is a response.

Returns:
whether or not this message is a response.

returnResponse

public abstract void returnResponse(Continuation c)
Method by which this message is supposed to return it's response.

Parameters:
c - The continuation to return the reponse to.

addHop

public void addHop(NodeHandle handle)
Method which is designed to be overridden by subclasses if they need to keep track of where they've been.

Parameters:
handle - The current local handle





Imprint-Dataprotection