ePOST API

rice.p2p.scribe.messaging
Class AnycastMessage

java.lang.Object
  extended by rice.p2p.scribe.messaging.ScribeMessage
      extended by rice.p2p.scribe.messaging.AnycastMessage
All Implemented Interfaces:
java.io.Serializable, Message
Direct Known Subclasses:
SubscribeMessage

public class AnycastMessage
extends ScribeMessage

Version:
$Id: AnycastMessage.java 2302 2005-03-11 00:58:26Z jeffh $
Author:
Alan Mislove
See Also:
Serialized Form

Field Summary
protected  ScribeContent content
          the content of this message
protected  java.util.LinkedList toVisit
          the list of nodes which we are going to visit
protected  java.util.Vector 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
HIGH_PRIORITY, LOW_PRIORITY, MEDIUM_HIGH_PRIORITY, MEDIUM_LOW_PRIORITY, MEDIUM_PRIORITY
 
Constructor Summary
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
 ScribeContent getContent()
          Returns the content
 NodeHandle getNext()
          Returns the next handle to visit and removes the node from the list.
 NodeHandle peekNext()
          Returns the next handle to visit
 void remove(NodeHandle handle)
          Removes the node handle from the to visit and visited lists
 void setContent(ScribeContent content)
          Sets the content
 
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, toString, wait, wait, wait
 

Field Detail

content

protected ScribeContent content
the content of this message


visited

protected java.util.Vector visited
the list of nodes which we have visited


toVisit

protected java.util.LinkedList toVisit
the list of nodes which we are going to visit

Constructor Detail

AnycastMessage

public AnycastMessage(NodeHandle source,
                      Topic topic,
                      ScribeContent content)
Constructor which takes a unique integer Id

Parameters:
source - The source address
topic - The topic
content - The content
Method Detail

getContent

public ScribeContent getContent()
Returns the content

Returns:
The content

setContent

public void setContent(ScribeContent content)
Sets the content

Parameters:
content - The content

peekNext

public NodeHandle peekNext()
Returns the next handle to visit

Returns:
The next handle to visit

getNext

public NodeHandle getNext()
Returns the next handle to visit and removes the node from the list.

Returns:
The next handle to visit

addVisited

public void addVisited(NodeHandle handle)
Adds a node to the visited list

Parameters:
handle - The node to add

addFirst

public void addFirst(NodeHandle handle)
Adds a node the the front of the to-visit list

Parameters:
handle - The handle to add

addLast

public void addLast(NodeHandle handle)
Adds a node the the end of the to-visit list

Parameters:
handle - The handle to add

remove

public void remove(NodeHandle handle)
Removes the node handle from the to visit and visited lists

Parameters:
handle - The handle to remove

ePOST API

Copyright © 2001-2005 - Rice Pastry.