Rice Pastry API

rice.p2p.multiring.messaging
Class RingMessage

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

public class RingMessage
extends java.lang.Object
implements ScribeContent

Version:
$Id: RingMessage.java 3274 2006-05-15 16:17:47Z 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
          DESCRIBE THE FIELD
 
Constructor Summary
RingMessage(InputBuffer buf, Endpoint ringEndpoint, java.util.Hashtable 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
 RawMessage getMessage()
          Method which returns this messages' internal message
 byte getPriority()
          Method which should return the priority level of this message.
 short getType()
          Gets the Type attribute of the RingMessage object
 void serialize(OutputBuffer buf)
          DESCRIBE THE METHOD
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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


TYPE

public static final short TYPE
DESCRIBE THE FIELD

See Also:
Constant Field Values
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
message - DESCRIBE THE PARAMETER
application - DESCRIBE THE PARAMETER

RingMessage

public RingMessage(InputBuffer buf,
                   Endpoint ringEndpoint,
                   java.util.Hashtable 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 -
ringEndpoint - DESCRIBE THE PARAMETER
endpoints - DESCRIBE THE PARAMETER
Throws:
java.io.IOException - DESCRIBE THE EXCEPTION
java.io.IOException
Method Detail

getPriority

public byte 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

getMessage

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

Returns:
The internal message of this message

getApplication

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

Returns:
The application name of this message

getType

public short getType()
Gets the Type attribute of the RingMessage object

Returns:
The Type value

serialize

public void serialize(OutputBuffer buf)
               throws java.io.IOException
DESCRIBE THE METHOD

Parameters:
buf - DESCRIBE THE PARAMETER
Throws:
java.io.IOException - DESCRIBE THE EXCEPTION

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection