Rice Pastry API

rice.p2p.multiring.messaging
Class RingMessage

java.lang.Object
  extended by rice.p2p.multiring.messaging.RingMessage
All Implemented Interfaces:
java.io.Serializable, RawScribeContent, ScribeContent

public class RingMessage
extends java.lang.Object
implements RawScribeContent

Version:
$Id: RingMessage.java 4654 2009-01-08 16:33:07Z jeffh $
Author:
Alan Mislove
See Also:
Serialized Form

Field Summary
protected  java.lang.String application
          The name of the application which sent this message
protected  RingId id
          The target of this ring message
protected  RawMessage message
          The internal message to be sent
static short TYPE
           
 
Constructor Summary
RingMessage(InputBuffer buf, Endpoint ringEndpoint, java.util.Hashtable<java.lang.String,Endpoint> endpoints)
          TODO: This can probably be done more efficiently, IE, deserialize the message on getMessage().
RingMessage(RingId id, RawMessage message, java.lang.String application)
          Constructor which takes a unique integer Id
 
Method Summary
 java.lang.String getApplication()
          Method which returns this messages' applicaiton name
 RingId getId()
          Method which returns this messages' id
 Message getMessage()
           
 int getPriority()
          Method which should return the priority level of this message.
 RawMessage getRawMessage()
          Method which returns this messages' internal message
 short getType()
           
 void serialize(OutputBuffer buf)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

public static final short TYPE
See Also:
Constant Field Values

id

protected RingId id
The target of this ring message


message

protected RawMessage message
The internal message to be sent


application

protected java.lang.String application
The name of the application which sent this message

Constructor Detail

RingMessage

public RingMessage(RingId id,
                   RawMessage message,
                   java.lang.String application)
Constructor which takes a unique integer Id

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

RingMessage

public RingMessage(InputBuffer buf,
                   Endpoint ringEndpoint,
                   java.util.Hashtable<java.lang.String,Endpoint> endpoints)
            throws java.io.IOException
TODO: This can probably be done more efficiently, IE, deserialize the message on getMessage(). Can do that later.

Parameters:
buf -
endpoint -
md -
sender -
priority -
Throws:
java.io.IOException
Method Detail

getPriority

public int getPriority()
Method which should return the priority level of this message. The messages can range in priority from 0 (highest priority) to Integer.MAX_VALUE (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.

Returns:
This message's priority

getId

public RingId getId()
Method which returns this messages' id

Returns:
The id of this message

getRawMessage

public RawMessage getRawMessage()
Method which returns this messages' internal message

Returns:
The internal message of this message

getMessage

public Message getMessage()

getApplication

public java.lang.String getApplication()
Method which returns this messages' applicaiton name

Returns:
The application name of this message

getType

public short getType()
Specified by:
getType in interface RawScribeContent

serialize

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

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection