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,v 1.1 2003/09/28 08:16:29 amislove Exp $
- Author:
- amislove
Field Summary |
protected int |
maxChildren
The number of children to allow per topic |
Method Summary |
boolean |
allowSubscribe(rice.p2p.scribe.messaging.SubscribeMessage message,
rice.p2p.scribe.ScribeClient[] clients,
rice.p2p.commonapi.NodeHandle[] children)
This method returns (children.length < maxChildren-1); |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
maxChildren
protected int maxChildren
- The number of children to allow per topic
ScribePolicy.LimitedScribePolicy
public ScribePolicy.LimitedScribePolicy(int max)
- Construtor which takes a maximum number
- Parameters:
max
- The maximum number of children
allowSubscribe
public boolean allowSubscribe(rice.p2p.scribe.messaging.SubscribeMessage message,
rice.p2p.scribe.ScribeClient[] clients,
rice.p2p.commonapi.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 questionchildren
- The list of children who are currently subscribedclients
- The list of clients are are currently subscribed
- Returns:
- True.
Copyright © 2001 - Rice Pastry.