Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rice.p2p.scribe
Interface Scribe

All Superinterfaces:
  Destructable

All Known Implementing Classes:
  ScribeImpl

public interface Scribe
extends Destructable

Version:
  $Id: Scribe.java 2885 2006-01-05 12:20:54Z jeffh $
Author:
  Alan Mislove

Method Summary
`void` | `addChild(Topic topic, NodeHandle child)` Adds a child to the given topic
`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, ScribeContent content)` Publishes the given message to the topic.
`void` | `removeChild(Topic topic, NodeHandle child)` Removes a child from the given topic
`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, 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

### 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

### 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

### 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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2005 - Rice Pastry.