Rice Pastry API

rice.p2p.scribe.messaging
Class AbstractSubscribeMessage

java.lang.Object
  extended by rice.p2p.scribe.messaging.AbstractSubscribeMessage
All Implemented Interfaces:
java.io.Serializable, Message, RawMessage, RawSerializable
Direct Known Subclasses:
SubscribeAckMessage, SubscribeFailedMessage

public abstract class AbstractSubscribeMessage
extends java.lang.Object
implements RawMessage

Version:
$Id: AbstractSubscribeMessage.java 3672 2007-04-12 10:46:09Z jeffh $
Author:
Alan Mislove
See Also:
Serialized Form

Field Summary
protected  int id
          The id of this subscribe message
protected  NodeHandle source
           
protected  java.util.List<Topic> topics
          You can now subscribe to a bunch of Topics at the same time.
 
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 AbstractSubscribeMessage(InputBuffer buf, Endpoint endpoint)
          Protected because it should only be called from an extending class, to get version numbers correct.
  AbstractSubscribeMessage(NodeHandle source, java.util.List<Topic> topics, int id)
          Constructor which takes a unique integer Id
 
Method Summary
 int getId()
          Returns this subscribe lost message's id
 int getPriority()
          Method which should return the priority level of this message.
 NodeHandle getSource()
          Method which returns this messages' source address
 java.util.List<Topic> getTopics()
           
 void serialize(OutputBuffer buf)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface rice.p2p.commonapi.rawserialization.RawMessage
getType
 

Field Detail

id

protected int id
The id of this subscribe message


source

protected NodeHandle source

topics

protected java.util.List<Topic> topics
You can now subscribe to a bunch of Topics at the same time. This list must be sorted. note: NOT AUTOMATICALLY SERIALIZED!!!

Constructor Detail

AbstractSubscribeMessage

public AbstractSubscribeMessage(NodeHandle source,
                                java.util.List<Topic> topics,
                                int id)
Constructor which takes a unique integer Id

Parameters:
id - The unique id
source - The source address
dest - The destination address

AbstractSubscribeMessage

protected AbstractSubscribeMessage(InputBuffer buf,
                                   Endpoint endpoint)
                            throws java.io.IOException
Protected because it should only be called from an extending class, to get version numbers correct.

Throws:
java.io.IOException
Method Detail

getId

public int getId()
Returns this subscribe lost message's id

Returns:
The id of this subscribe lost message

getPriority

public int getPriority()
Description copied from interface: Message
Method which should return the priority level of this message. The messages can range in priority from -15 (highest priority) to 15 (lowest) - when sending messages across the wire, the queue is sorted by message priority. If the queue reaches its limit, the lowest priority messages are discarded. Thus, applications which are very verbose should have LOW_PRIORITY or lower, and applications which are somewhat quiet are allowed to have MEDIUM_PRIORITY or possibly even HIGH_PRIORITY.

Specified by:
getPriority in interface Message
Returns:
This message's priority

getSource

public NodeHandle getSource()
Method which returns this messages' source address

Returns:
The source of this message

getTopics

public java.util.List<Topic> getTopics()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

serialize

public void serialize(OutputBuffer buf)
               throws java.io.IOException
Specified by:
serialize in interface RawSerializable
Throws:
java.io.IOException

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection