Rice Pastry API

rice.p2p.scribe
Interface Scribe

All Superinterfaces:
Destructable
All Known Implementing Classes:
ScribeImpl

public interface Scribe
extends Destructable

Version:
$Id: Scribe.java 3524 2007-01-09 14:09:27Z jeffh $
Author:
Alan Mislove

Method Summary
 void addChild(Topic topic, NodeHandle child)
          Adds a child to the given topic
 void anycast(Topic topic, RawScribeContent content)
           
 void anycast(Topic topic, ScribeContent content)
          Anycasts the given content to a member of the given topic
 void destroy()
           
 NodeHandle[] getChildren(Topic topic)
          Returns the list of children for a given topic
 Environment getEnvironment()
           
 NodeHandle getParent(Topic myTopic)
          Returns the parent node for a given topic
 ScribePolicy getPolicy()
          Returns the current policy for this scribe object
 Topic[] getTopics(ScribeClient client)
          Returns the list of topics the given client is subscribed to.
 boolean isRoot(Topic topic)
          Returns whether or not this Scribe is the root for the given topic
 void publish(Topic topic, RawScribeContent content)
           
 void publish(Topic topic, ScribeContent content)
          Publishes the given message to the topic.
 void removeChild(Topic topic, NodeHandle child)
          Removes a child from the given topic
 void setContentDeserializer(ScribeContentDeserializer deserializer)
           
 void setPolicy(ScribePolicy policy)
          Sets the current policy for this scribe object
 void subscribe(Topic topic, ScribeClient client)
          Subscribes the given client to the provided topic.
 void subscribe(Topic topic, ScribeClient client, RawScribeContent content)
           
 void subscribe(Topic topic, ScribeClient client, ScribeContent content)
          Subscribes the given client to the provided topic.
 void unsubscribe(Topic topic, ScribeClient client)
          Unsubscribes the given client from the provided topic.
 

Method Detail

subscribe

void subscribe(Topic topic,
               ScribeClient client)
Subscribes the given client to the provided topic. Any message published to the topic will be delivered to the Client via the deliver() method.

Parameters:
topic - The topic to subscribe to
client - The client to give messages to

subscribe

void subscribe(Topic topic,
               ScribeClient client,
               ScribeContent content)
Subscribes the given client to the provided topic. Any message published to the topic will be delivered to the Client via the deliver() method.

Parameters:
topic - The topic to subscribe to
client - The client to give messages to
content - The content to include in the subscribe

subscribe

void subscribe(Topic topic,
               ScribeClient client,
               RawScribeContent content)

unsubscribe

void unsubscribe(Topic topic,
                 ScribeClient client)
Unsubscribes the given client from the provided topic.

Parameters:
topic - The topic to unsubscribe from
client - The client to unsubscribe

publish

void publish(Topic topic,
             ScribeContent content)
Publishes the given message to the topic.

Parameters:
topic - The topic to publish to
content - The content to publish

publish

void publish(Topic topic,
             RawScribeContent content)

anycast

void anycast(Topic topic,
             ScribeContent content)
Anycasts the given content to a member of the given topic

Parameters:
topic - The topic to anycast to
content - The content to anycast

anycast

void anycast(Topic topic,
             RawScribeContent content)

getPolicy

ScribePolicy getPolicy()
Returns the current policy for this scribe object

Returns:
The current policy for this scribe

setPolicy

void setPolicy(ScribePolicy policy)
Sets the current policy for this scribe object

Parameters:
policy - The current policy for this scribe

isRoot

boolean isRoot(Topic topic)
Returns whether or not this Scribe is the root for the given topic

Parameters:
topic - The topic in question
Returns:
Whether or not we are currently the root

getChildren

NodeHandle[] getChildren(Topic topic)
Returns the list of children for a given topic

Parameters:
topic - The topic to return the children of
Returns:
The children of the topic

getParent

NodeHandle getParent(Topic myTopic)
Returns the parent node for a given topic

Parameters:
myTopic - The topic to return the parent of
Returns:
The parent of the topic

addChild

void addChild(Topic topic,
              NodeHandle child)
Adds a child to the given topic

Parameters:
topic - The topic to add the child to
child - The child to add

removeChild

void removeChild(Topic topic,
                 NodeHandle child)
Removes a child from the given topic

Parameters:
topic - The topic to remove the child from
child - The child to remove

getTopics

Topic[] getTopics(ScribeClient client)
Returns the list of topics the given client is subscribed to.

Parameters:
client - The client in question
Returns:
The list of topics

getEnvironment

Environment getEnvironment()
Returns:

destroy

void destroy()
Specified by:
destroy in interface Destructable

setContentDeserializer

void setContentDeserializer(ScribeContentDeserializer deserializer)

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection