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 3274 2006-05-15 16:17:47Z 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)
          DESCRIBE THE METHOD
 void anycast(Topic topic, ScribeContent content)
          Anycasts the given content to a member of the given topic
 void destroy()
          DESCRIBE THE METHOD
 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)
          DESCRIBE THE METHOD
 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)
          Sets the ContentDeserializer attribute of the Scribe object
 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)
          DESCRIBE THE METHOD
 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

public 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

public 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

public void subscribe(Topic topic,
                      ScribeClient client,
                      RawScribeContent content)
DESCRIBE THE METHOD

Parameters:
topic - DESCRIBE THE PARAMETER
client - DESCRIBE THE PARAMETER
content - DESCRIBE THE PARAMETER

unsubscribe

public 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

public 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

public void publish(Topic topic,
                    RawScribeContent content)
DESCRIBE THE METHOD

Parameters:
topic - DESCRIBE THE PARAMETER
content - DESCRIBE THE PARAMETER

anycast

public 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

public void anycast(Topic topic,
                    RawScribeContent content)
DESCRIBE THE METHOD

Parameters:
topic - DESCRIBE THE PARAMETER
content - DESCRIBE THE PARAMETER

getPolicy

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

Returns:
The current policy for this scribe

setPolicy

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

Parameters:
policy - The current policy for this scribe

isRoot

public 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

public 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

public 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

public 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

public 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

public 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

public Environment getEnvironment()
Returns:

destroy

public void destroy()
DESCRIBE THE METHOD

Specified by:
destroy in interface Destructable

setContentDeserializer

public void setContentDeserializer(ScribeContentDeserializer deserializer)
Sets the ContentDeserializer attribute of the Scribe object

Parameters:
deserializer - The new ContentDeserializer value

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection