|
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. |
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 |
Method Detail |
---|
java.util.List<Topic> allowSubscribe(Scribe scribe, NodeHandle source, java.util.List<Topic> topics, ScribeContent content)
IteratorOr, to accept all:i = topics.iterator(); while (i.hasNext()) { Topic topic = i.next(); if (!accept(topic)) { // your decision on what to do for the topic i.remove(); } } return topics;
return topics;Some calls that are likely useful are:
scribe
- the Scribe that is making the requestsource
- the subscribertopics
- the topics that are requestedcontent
- the content that came with the messagereturn
- the list that is acceptedvoid 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)
ScribeContent divideContent(java.util.List<Topic> theTopics, ScribeContent content)
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 |