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
Class ScribePolicy.DefaultScribePolicy

    java.lang.Object
      rice.p2p.scribe.ScribePolicy.DefaultScribePolicy

All Implemented Interfaces:
  ScribePolicy

Direct Known Subclasses:
  ScribePolicy.LimitedScribePolicy, ScribeRegrTest.TestScribePolicy

Enclosing class:
  ScribePolicy

public static class ScribePolicy.DefaultScribePolicy
extends java.lang.Object
implements ScribePolicy

The default policy for Scribe, which always allows new children to join and adds children in the order in which they are provided, implicitly providing a depth-first search.

Version:
  $Id: ScribePolicy.java,v 1.4 2005/03/11 00:58:10 jeffh Exp $
Author:
  amislove

Nested Class Summary

Nested classes inherited from class rice.p2p.scribe.ScribePolicy
`ScribePolicy.DefaultScribePolicy, ScribePolicy.LimitedScribePolicy`

Field Summary
`protected java.util.Random` | `random` DESCRIBE THE FIELD

Constructor Summary
`ScribePolicy.DefaultScribePolicy()`

Method Summary
`boolean` | `allowSubscribe(SubscribeMessage message, ScribeClient[] clients, NodeHandle[] children)` This method always return true;
`void` | `childAdded(Topic topic, NodeHandle child)` Informs this policy that a child was added to a topic - the topic is free to ignore this upcall if it doesn't care.
`void` | `childRemoved(Topic topic, NodeHandle child)` Informs this policy that a child was removed from a topic - the topic is free to ignore this upcall if it doesn't care.
`void` | `directAnycast(AnycastMessage message, NodeHandle parent, NodeHandle[] children)` Simply adds the parent and children in order, which implements a depth-first-search.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### random

    protected java.util.Random random

  DESCRIBE THE FIELD

Constructor Detail

### ScribePolicy.DefaultScribePolicy

    public ScribePolicy.DefaultScribePolicy()

Method Detail

### allowSubscribe

    public boolean allowSubscribe(SubscribeMessage message,
                                  ScribeClient[] clients,
                                  NodeHandle[] children)

  This method always return true;

  Specified by:
    `allowSubscribe` in interface `ScribePolicy`
  Parameters:
    `message` - The subscribe message in question
    `children` - The list of children who are currently subscribed
    `clients` - The list of clients are are currently subscribed
  Returns:
    True.

### directAnycast

    public void directAnycast(AnycastMessage message,
                              NodeHandle parent,
                              NodeHandle[] children)

  Simply adds the parent and children in order, which implements a depth-first-search.

  Specified by:
    `directAnycast` in interface `ScribePolicy`
  Parameters:
    `message` - The anycast message in question
    `parent` - Our current parent for this message's topic
    `children` - Our current children for this message's topic

### childAdded

    public void childAdded(Topic topic,
                           NodeHandle child)

  Informs this policy that a child was added to a topic - the topic is free to ignore this upcall if it doesn't care.

  Specified by:
    `childAdded` in interface `ScribePolicy`
  Parameters:
    `topic` - The topic to unsubscribe from
    `child` - The child that was added

### childRemoved

    public void childRemoved(Topic topic,
                             NodeHandle child)

  Informs this policy that a child was removed from a topic - the topic is free to ignore this upcall if it doesn't care.

  Specified by:
    `childRemoved` in interface `ScribePolicy`
  Parameters:
    `topic` - The topic to unsubscribe from
    `child` - The child that was removed

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.