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.LimitedScribePolicy

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

All Implemented Interfaces:
  ScribePolicy

Enclosing class:
  ScribePolicy

public static class ScribePolicy.LimitedScribePolicy
extends ScribePolicy.DefaultScribePolicy

An optional policy for Scribe, which allows up to a specified number of children per topic.

Version:
  $Id: ScribePolicy.java 2551 2005-06-06 19:01:02Z jeffh $
Author:
  amislove

Nested Class Summary

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

Field Summary
`protected int` | `maxChildren` The number of children to allow per topic

Fields inherited from class rice.p2p.scribe.ScribePolicy.DefaultScribePolicy
`environment`

Constructor Summary
`ScribePolicy.LimitedScribePolicy(int max, Environment env)` Construtor which takes a maximum number

Method Summary
`boolean` | `allowSubscribe(SubscribeMessage message, ScribeClient[] clients, NodeHandle[] children)` This method returns (children.length < maxChildren-1);

Methods inherited from class rice.p2p.scribe.ScribePolicy.DefaultScribePolicy
`childAdded, childRemoved, directAnycast`

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

Field Detail

### maxChildren

    protected int maxChildren

  The number of children to allow per topic

Constructor Detail

### ScribePolicy.LimitedScribePolicy

    public ScribePolicy.LimitedScribePolicy(int max,
                                            Environment env)

  Construtor which takes a maximum number

Parameters:
  `max` - The maximum number of children
  `env` - DESCRIBE THE PARAMETER

Method Detail

### allowSubscribe

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

  This method returns (children.length < maxChildren-1);

  Specified by:
    `allowSubscribe` in interface `ScribePolicy`
  Overrides:
    `allowSubscribe` in class `ScribePolicy.DefaultScribePolicy`
  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.

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.