|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.tutorial.splitstream.MySplitStreamClient
public class MySplitStreamClient
We implement the Application interface to receive regular timed messages (see lesson5). We implement the ScribeClient interface to receive scribe messages (called ScribeContent).
Field Summary | |
---|---|
static int |
DATA_LENGTH
The lenght of a message in bytes. |
protected Endpoint |
endpoint
The Endpoint represents the underlieing node. |
static int |
NUM_PUBLISHES
The number of messages to publish. |
protected RandomSource |
random
Data source... |
Constructor Summary | |
---|---|
MySplitStreamClient(Node node)
The constructor for this scribe client. |
Method Summary | |
---|---|
void |
deliver(Id id,
Message message)
Part of the Application interface. |
void |
deliver(Stripe s,
byte[] data)
Called whenever we receive a published message. |
boolean |
forward(RouteMessage message)
This method is invoked on applications when the underlying node is about to forward the given message with the provided target to the specified next hop. |
void |
joinFailed(Stripe s)
This is a call back into the application to notify it that one of the stripes was unable to to find a parent, and thus unable to recieve data. |
void |
publish()
Multicasts data. |
void |
startPublishTask()
Starts the publish task. |
void |
subscribe()
Subscribes to all stripes in myChannelId. |
void |
update(NodeHandle handle,
boolean joined)
This method is invoked to inform the application that the given node has either joined or left the neighbor set of the local node, as the set would be returned by the neighborSet call. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DATA_LENGTH
public static final int NUM_PUBLISHES
protected RandomSource random
protected Endpoint endpoint
Constructor Detail |
---|
public MySplitStreamClient(Node node)
node
- the PastryNodeMethod Detail |
---|
public void subscribe()
public void startPublishTask()
public void deliver(Id id, Message message)
deliver
in interface Application
id
- The destination id of the messagemessage
- The message being sentpublic void publish()
public void deliver(Stripe s, byte[] data)
deliver
in interface SplitStreamClient
s
- The stripe the data as received ondata
- The data that was receivedpublic void joinFailed(Stripe s)
SplitStreamClient
joinFailed
in interface SplitStreamClient
s
- The stripe which the join failed onpublic boolean forward(RouteMessage message)
Application
forward
in interface Application
message
- The message being sent, containing an internal message
along with a destination key and nodeHandle next hop.
public void update(NodeHandle handle, boolean joined)
Application
update
in interface Application
handle
- The handle that has joined/leftjoined
- Whether the node has joined or left
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |