Rice Pastry API

rice.scribe.messaging
Class ScribeMessage

java.lang.Object
  |
  +--rice.pastry.messaging.Message
        |
        +--rice.scribe.messaging.ScribeMessage
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
MessageAckOnSubscribe, MessageAnycast, MessageCreate, MessageHeartBeat, MessagePublish, MessageReplyFromParent, MessageRequestToParent, MessageScribeMaintenance, MessageSubscribe, MessageUnsubscribe

public abstract class ScribeMessage
extends Message
implements java.io.Serializable

This is an abstract implementation of a Scribe message object.

Version:
$Id: ScribeMessage.java,v 1.4 2002/11/21 05:13:10 atuls Exp $
Author:
Romer Gil
See Also:
Serialized Form

Field Summary
protected  rice.pastry.NodeHandle m_source
          The ID of the source of this message.
protected  rice.pastry.NodeId m_topicId
          The ID of the topic that this message refers to.
 
Constructor Summary
ScribeMessage(rice.pastry.messaging.Address addr, rice.pastry.NodeHandle source, rice.pastry.NodeId tid, rice.pastry.security.Credentials c)
          Constructor
 
Method Summary
 java.io.Serializable getData()
          Gets the data inside of the ScribeMessage object.
 rice.pastry.NodeHandle getSource()
          Returns the nodeId of the node that generated the message.
 rice.pastry.NodeId getTopicId()
          Returns the topicId associated with the message.
abstract  void handleDeliverMessage(rice.scribe.Scribe scribe, rice.scribe.Topic topic)
          This method is called whenever the scribe node receives a message for itself and wants to process it.
abstract  boolean handleForwardMessage(rice.scribe.Scribe scribe, rice.scribe.Topic topic)
          This method is called whenever the scribe node forwards a message in the scribe network.
 void setData(java.io.Serializable data)
          Sets the data contained in the message.
abstract  java.lang.String toString()
           
 
Methods inherited from class rice.pastry.messaging.Message
getCredentials, getDate, getDestination, getSenderId, getStream, hasPriority, setPriority, setSenderId, stamp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_topicId

protected rice.pastry.NodeId m_topicId
The ID of the topic that this message refers to. Should be serializable.


m_source

protected rice.pastry.NodeHandle m_source
The ID of the source of this message. Should be serializable.

Constructor Detail

ScribeMessage

public ScribeMessage(rice.pastry.messaging.Address addr,
                     rice.pastry.NodeHandle source,
                     rice.pastry.NodeId tid,
                     rice.pastry.security.Credentials c)
Constructor

Parameters:
addr - the address of the scribe receiver.
source - the node generating the message.
c - the credentials associated with the mesasge.
Method Detail

handleDeliverMessage

public abstract void handleDeliverMessage(rice.scribe.Scribe scribe,
                                          rice.scribe.Topic topic)
This method is called whenever the scribe node receives a message for itself and wants to process it. The processing is delegated by scribe to the message.

Parameters:
scribe - the scribe application
topic - the topic within the scribe application

handleForwardMessage

public abstract boolean handleForwardMessage(rice.scribe.Scribe scribe,
                                             rice.scribe.Topic topic)
This method is called whenever the scribe node forwards a message in the scribe network. The processing is delegated by scribe to the message.

Parameters:
scribe - the scribe application.
topic - the topic within the scribe application.
Returns:
true if the message should be routed further, false otherwise.

setData

public void setData(java.io.Serializable data)
Sets the data contained in the message.

Parameters:
data - the data contained in the message.

getData

public java.io.Serializable getData()
Gets the data inside of the ScribeMessage object.

Returns:
the data contained in the message.

getTopicId

public rice.pastry.NodeId getTopicId()
Returns the topicId associated with the message.

Returns:
topicId to which the message was posted.

getSource

public rice.pastry.NodeHandle getSource()
Returns the nodeId of the node that generated the message.

Returns:
the handle to the source node.

toString

public abstract java.lang.String toString()
Overrides:
toString in class java.lang.Object

Rice Pastry API

Copyright © 2001 - Rice Pastry.


Imprint-Dataprotection