|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ScribePolicy
Nested Class Summary | |
---|---|
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. |
static class |
ScribePolicy.LimitedScribePolicy
An optional policy for Scribe, which allows up to a specified number of children per topic. |
Method Summary | |
---|---|
java.util.List<Topic> |
allowSubscribe(Scribe scribe,
NodeHandle source,
java.util.List<Topic> topics,
ScribeContent content)
This method is called when the newChild is about to become our child, and the policy should return whether or not the child should be allowed to become our child. |
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> children)
This method is called when an anycast is received which is not satisfied at the local node. |
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 |
Method Detail |
---|
java.util.List<Topic> allowSubscribe(Scribe scribe, NodeHandle source, java.util.List<Topic> topics, ScribeContent content)
for (Topic topic : new ArrayListSome calls that are likely useful are:(message.getTopics())) { message.accept(topic); }
message
- The subscribe message in questionchildren
- The list of children who are currently subscribed to this topicclients
- The list of clients are are currently subscribed to this topicvoid directAnycast(AnycastMessage message, NodeHandle parent, java.util.Collection<NodeHandle> children)
message
- The anycast message in questionparent
- Our current parent for this message's topicchildren
- Our current children for this message's topicvoid childAdded(Topic topic, NodeHandle child)
topic
- The topic to unsubscribe fromchild
- The child that was addedvoid childRemoved(Topic topic, NodeHandle child)
topic
- The topic to unsubscribe fromchild
- The child that was removedvoid recvAnycastFail(Topic topic, NodeHandle failedAtNode, ScribeContent content)
void intermediateNode(ScribeMessage message)
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |