Rice Pastry API

rice.p2p.past.messaging
Class PastMessage

java.lang.Object
  |
  +--rice.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

Version:
$Id: PastMessage.java,v 1.5 2003/06/11 18:02:35 amislove Exp $
Author:
Alan Mislove, Ansley Post, Peter Druschel
See Also:
Serialized Form

Field Summary
protected  rice.p2p.commonapi.Id dest
           
protected  int id
           
protected  boolean isResponse
           
protected  rice.p2p.commonapi.NodeHandle source
           
 
Constructor Summary
protected PastMessage(int id, rice.p2p.commonapi.NodeHandle source, rice.p2p.commonapi.Id dest)
          Constructor which takes a unique integer Id
 
Method Summary
 void addHop(rice.p2p.commonapi.NodeHandle handle)
          Method which is designed to be overridden by subclasses if they need to keep track of where they've been.
 rice.p2p.commonapi.Id getDestination()
          Method which returns this messages' destination address
 rice.p2p.commonapi.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(rice.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 rice.p2p.commonapi.NodeHandle source

dest

protected rice.p2p.commonapi.Id dest

isResponse

protected boolean isResponse
Constructor Detail

PastMessage

protected PastMessage(int id,
                      rice.p2p.commonapi.NodeHandle source,
                      rice.p2p.commonapi.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 rice.p2p.commonapi.NodeHandle getSource()
Method which returns this messages' source address

Returns:
The source of this message

getDestination

public rice.p2p.commonapi.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(rice.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(rice.p2p.commonapi.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

Rice Pastry API

Copyright © 2001 - Rice Pastry.


Imprint-Dataprotection