|
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.messaging.ScribeMessage rice.p2p.scribe.messaging.AnycastMessage
public class AnycastMessage
Field Summary | |
---|---|
protected RawScribeContent |
content
the content of this message |
protected NodeHandle |
initialRequestor
|
protected java.util.LinkedList<NodeHandle> |
toVisit
the list of nodes which we are going to visit |
static short |
TYPE
|
protected java.util.ArrayList<NodeHandle> |
visited
the list of nodes which we have visited |
Fields inherited from class rice.p2p.scribe.messaging.ScribeMessage |
---|
source, topic |
Fields inherited from interface rice.p2p.commonapi.Message |
---|
DEFAULT_PRIORITY, HIGH_PRIORITY, LOW_PRIORITY, LOWEST_PRIORITY, MAX_PRIORITY, MEDIUM_HIGH_PRIORITY, MEDIUM_LOW_PRIORITY, MEDIUM_PRIORITY |
Constructor Summary | |
---|---|
protected |
AnycastMessage(InputBuffer buf,
Endpoint endpoint,
ScribeContentDeserializer cd)
Protected because it should only be called from an extending class, to get version numbers correct. |
|
AnycastMessage(NodeHandle source,
Topic topic,
RawScribeContent content)
|
|
AnycastMessage(NodeHandle source,
Topic topic,
ScribeContent content)
Constructor which takes a unique integer Id |
Method Summary | |
---|---|
void |
addFirst(NodeHandle handle)
Adds a node the the front of the to-visit list |
void |
addLast(NodeHandle handle)
Adds a node the the end of the to-visit list |
void |
addVisited(NodeHandle handle)
Adds a node to the visited list |
static AnycastMessage |
build(InputBuffer buf,
Endpoint endpoint,
ScribeContentDeserializer scd)
|
ScribeContent |
getContent()
Returns the content |
NodeHandle |
getInitialRequestor()
|
NodeHandle |
getLastVisited()
|
NodeHandle |
getNext()
Returns the next handle to visit and removes the node from the list. |
RawScribeContent |
getRawContent()
|
int |
getToVisitSize()
|
short |
getType()
Raw Serialization ************************************** |
int |
getVisitedSize()
|
boolean |
hasVisited(NodeHandle handle)
|
NodeHandle |
peekLastToVisit()
|
NodeHandle |
peekNext()
Returns the next handle to visit |
void |
remove(NodeHandle handle)
Removes the node handle from the to visit and visited lists |
void |
serialize(OutputBuffer buf)
|
protected void |
serializeHelper(OutputBuffer buf)
Use this to allow SubscribeMessage to extend this, but not have the version number nor the content. |
void |
setContent(RawScribeContent content)
Sets the content |
void |
setContent(ScribeContent content)
|
java.lang.String |
toString()
|
Methods inherited from class rice.p2p.scribe.messaging.ScribeMessage |
---|
getPriority, getSource, getTopic, setSource |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final short TYPE
protected RawScribeContent content
protected java.util.ArrayList<NodeHandle> visited
protected java.util.LinkedList<NodeHandle> toVisit
protected NodeHandle initialRequestor
Constructor Detail |
---|
public AnycastMessage(NodeHandle source, Topic topic, ScribeContent content)
source
- The source addresstopic
- The topiccontent
- The contentpublic AnycastMessage(NodeHandle source, Topic topic, RawScribeContent content)
protected AnycastMessage(InputBuffer buf, Endpoint endpoint, ScribeContentDeserializer cd) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public ScribeContent getContent()
public RawScribeContent getRawContent()
public void setContent(RawScribeContent content)
content
- The contentpublic void setContent(ScribeContent content)
public NodeHandle peekNext()
public NodeHandle getNext()
public NodeHandle peekLastToVisit()
public void addVisited(NodeHandle handle)
handle
- The node to addpublic void addFirst(NodeHandle handle)
handle
- The handle to addpublic void addLast(NodeHandle handle)
handle
- The handle to addpublic java.lang.String toString()
toString
in class java.lang.Object
public NodeHandle getInitialRequestor()
public NodeHandle getLastVisited()
public void remove(NodeHandle handle)
handle
- The handle to removepublic int getVisitedSize()
public int getToVisitSize()
public boolean hasVisited(NodeHandle handle)
public short getType()
public void serialize(OutputBuffer buf) throws java.io.IOException
serialize
in interface RawSerializable
serialize
in class ScribeMessage
java.io.IOException
protected void serializeHelper(OutputBuffer buf) throws java.io.IOException
java.io.IOException
public static AnycastMessage build(InputBuffer buf, Endpoint endpoint, ScribeContentDeserializer scd) throws java.io.IOException
java.io.IOException
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |