|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.p2p.scribe.ScribePolicy.DefaultScribePolicy
public static class ScribePolicy.DefaultScribePolicy
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface rice.p2p.scribe.ScribePolicy |
---|
ScribePolicy.DefaultScribePolicy, ScribePolicy.LimitedScribePolicy |
Field Summary | |
---|---|
protected Environment |
environment
|
Constructor Summary | |
---|---|
ScribePolicy.DefaultScribePolicy(Environment env)
|
Method Summary | |
---|---|
java.util.List<Topic> |
allowSubscribe(Scribe scribe,
NodeHandle source,
java.util.List<Topic> topics,
ScribeContent content)
If you don't override the deprecated allowSubscribe(), This method always return true; |
boolean |
allowSubscribe(SubscribeMessage message,
ScribeClient[] clients,
NodeHandle[] children)
This method should be deprecated, but is here for reverse compatibility. |
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,
java.util.Collection<NodeHandle> theChildren)
Simply adds the parent and children in order, which implements a depth-first-search. |
ScribeContent |
divideContent(java.util.List<Topic> theTopics,
ScribeContent content)
This method is called when the ScribeImpl splits a SubscribeMessage into multiple parts. |
void |
intermediateNode(ScribeMessage message)
This is invoked whenever this message arrives on any overlay node, this gives the ScribeClient's power to tap into some datastructures they might wanna edit |
void |
recvAnycastFail(Topic topic,
NodeHandle failedAtNode,
ScribeContent content)
This notifies us when we receive a failure for a anycast |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Environment environment
Constructor Detail |
---|
public ScribePolicy.DefaultScribePolicy(Environment env)
Method Detail |
---|
public java.util.List<Topic> allowSubscribe(Scribe scribe, NodeHandle source, java.util.List<Topic> topics, ScribeContent content)
allowSubscribe
in interface ScribePolicy
message
- The subscribe message in questionchildren
- The list of children who are currently subscribedclients
- The list of clients are are currently subscribed
public boolean allowSubscribe(SubscribeMessage message, ScribeClient[] clients, NodeHandle[] children)
message
- clients
- children
-
public void directAnycast(AnycastMessage message, NodeHandle parent, java.util.Collection<NodeHandle> theChildren)
directAnycast
in interface ScribePolicy
message
- The anycast message in questionparent
- Our current parent for this message's topicchildren
- Our current children for this message's topicpublic void childAdded(Topic topic, NodeHandle child)
childAdded
in interface ScribePolicy
topic
- The topic to unsubscribe fromchild
- The child that was addedpublic void childRemoved(Topic topic, NodeHandle child)
childRemoved
in interface ScribePolicy
topic
- The topic to unsubscribe fromchild
- The child that was removedpublic void intermediateNode(ScribeMessage message)
ScribePolicy
intermediateNode
in interface ScribePolicy
public void recvAnycastFail(Topic topic, NodeHandle failedAtNode, ScribeContent content)
ScribePolicy
recvAnycastFail
in interface ScribePolicy
public ScribeContent divideContent(java.util.List<Topic> theTopics, ScribeContent content)
ScribePolicy
divideContent
in interface ScribePolicy
theTopics
- topics going to a particular locationcontent
- the content that may need to be divided
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |