Rice Pastry API

rice.scribe
Interface IScribeApp

All Known Implementing Classes:
BasicScribeRegrTestApp, DirectScribeMaintenanceTestApp, DistScribeRegrTestApp, MultiRingAppl

public interface IScribeApp

Version:
$Id: IScribeApp.java,v 1.16 2003/02/11 18:11:04 atuls Exp $
Author:
Romer Gil, Eric Engineer, Atul Singh, Animesh Nandi

Method Summary
 boolean anycastHandler(rice.scribe.messaging.ScribeMessage msg)
          Invoked by underlying scribe when it receives a anycast Message, to check if there is a local application which can take care of this anycast message.
 void faultHandler(rice.scribe.messaging.ScribeMessage msg, rice.pastry.NodeHandle faultyParent)
          Invoked by Scribe just before the "repair" SUBSCRIBE message is sent when a node suspects its parent is faulty.
 void forwardHandler(rice.scribe.messaging.ScribeMessage msg)
          Called by Scribe before the node forwards a message to its children in the multicast tree.
 void isNewRoot(rice.pastry.NodeId topicId)
          Upcall made by scribe to registered applications to inform them that local node is now the root for some topic, and hence can take appropriate action.
 void newParent(rice.pastry.NodeId topicId, rice.pastry.NodeHandle newParent, java.io.Serializable data)
          Upcall made by scribe to the registered applications to inform them that a new parent is found for local node in the topic tree.
 void receiveMessage(rice.scribe.messaging.ScribeMessage msg)
          Called by Scribe when a multicast message arrives.
 void scribeIsReady()
          Invoked when the underlying Scribe substrate is ready.
 void subscribeHandler(rice.pastry.NodeId topicId, rice.pastry.NodeHandle child, boolean wasAdded, java.io.Serializable obj)
          Invoked by Scribe after a child is added to or removed from one of the node's children tables.
 

Method Detail

scribeIsReady

public void scribeIsReady()
Invoked when the underlying Scribe substrate is ready. The Scribe substrate becomes ready as soon as the local Pastry node on which it lies is ready. In order to get this upcall it is necessary that the IScribeApp registers itself to the Scribe substrate using the registerApp() method in IScribe interface.


receiveMessage

public void receiveMessage(rice.scribe.messaging.ScribeMessage msg)
Called by Scribe when a multicast message arrives.

Parameters:
msg - The message sent in the PUBLISH message.

forwardHandler

public void forwardHandler(rice.scribe.messaging.ScribeMessage msg)
Called by Scribe before the node forwards a message to its children in the multicast tree.

Parameters:
msg - The message about to be forwarded.

subscribeHandler

public void subscribeHandler(rice.pastry.NodeId topicId,
                             rice.pastry.NodeHandle child,
                             boolean wasAdded,
                             java.io.Serializable obj)
Invoked by Scribe after a child is added to or removed from one of the node's children tables.

Parameters:
topicId - The topic for which child was added or removed.
child - The corresponding child.
wasAdded - true if child was added and false if child was removed.
obj - The additional data associated with the subscription message, SUBSCRIBE msg, sent by the "original" child, not the forwarding node.

faultHandler

public void faultHandler(rice.scribe.messaging.ScribeMessage msg,
                         rice.pastry.NodeHandle faultyParent)
Invoked by Scribe just before the "repair" SUBSCRIBE message is sent when a node suspects its parent is faulty.

Parameters:
msg - The SUBSCRIBE message that is sent to repair the multicast tree.
faultyParent - The suspected faulty parent.

anycastHandler

public boolean anycastHandler(rice.scribe.messaging.ScribeMessage msg)
Invoked by underlying scribe when it receives a anycast Message, to check if there is a local application which can take care of this anycast message. If application can service the request of anycast message, the anycast message is not routed furthur(for DFS), else the anycast message will be furthur routed following DFS.

Parameters:
msg - The corresponding Anycast message
Returns:
Whether local application was able to satisfy the request of anycast message.

isNewRoot

public void isNewRoot(rice.pastry.NodeId topicId)
Upcall made by scribe to registered applications to inform them that local node is now the root for some topic, and hence can take appropriate action.

Parameters:
topicId - The topic for which local node is the new root.

newParent

public void newParent(rice.pastry.NodeId topicId,
                      rice.pastry.NodeHandle newParent,
                      java.io.Serializable data)
Upcall made by scribe to the registered applications to inform them that a new parent is found for local node in the topic tree.

Parameters:
topicId - The topic for which new parent is found
newParent - The new parent
data - The data received with the ACK message.

Rice Pastry API

Copyright © 2001 - Rice Pastry.


Imprint-Dataprotection