ca.mcgill.cs.postina.scribe
Class PostinaScribeTransportMessage

java.lang.Object
  extended by ca.mcgill.cs.postina.scribe.PostinaScribeTransportMessage
All Implemented Interfaces:
PostinaMessage, java.io.Serializable, rice.p2p.commonapi.Message, rice.p2p.scribe.ScribeContent
Direct Known Subclasses:
PostinaReliableScribeTransportMessage

public class PostinaScribeTransportMessage
extends java.lang.Object
implements PostinaMessage, rice.p2p.commonapi.Message, rice.p2p.scribe.ScribeContent

A ScribeTransportMessage is the message used internally to encapsulate the message to be sent over the network.

Version:
Oct 23, 2007
Author:
Dominik Zindel
See Also:
Serialized Form

Field Summary
private  java.io.Serializable content
          The actual message is a serializable that has been submitted to Postina for publishing or direct sending.
private  PostinaID from
          The PostinaID identifying the sender/publisher of the message.
private  int priority
          The priority designed for priority-based treatment by the application is defined as integer.
private static long serialVersionUID
           
private  PostinaTopic topic
          The PostinaTopic of the published message.
 
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 PostinaScribeTransportMessage(PostinaID from, PostinaTopic topic, java.io.Serializable content)
          An alternative constructor for a PostinaScribeTransportMessage without a specific priority.
protected PostinaScribeTransportMessage(PostinaID from, PostinaTopic topic, java.io.Serializable content, int priority)
          The default constructor for a PostinaScribeTransportMessage taking all properties including the priority.
 
Method Summary
 java.io.Serializable getContent()
          This method gets the Serializable representing the message that has actually been sent by the sender.
 PostinaID getFrom()
          This method gets the PostinaID identifying the sender/publisher of the message.
 int getPriority()
          This method gets the integer priority that is designed to be used by the application using Postina.
 PostinaTopic getTopic()
          This method gets the PostinaTopic assigned to this message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

content

private final java.io.Serializable content
The actual message is a serializable that has been submitted to Postina for publishing or direct sending.


from

private final PostinaID from
The PostinaID identifying the sender/publisher of the message.


priority

private final int priority
The priority designed for priority-based treatment by the application is defined as integer. If no special priority is specified, the value 5 is assumed.


topic

private final PostinaTopic topic
The PostinaTopic of the published message. Direct messages do have the topic null.

Constructor Detail

PostinaScribeTransportMessage

protected PostinaScribeTransportMessage(PostinaID from,
                                        PostinaTopic topic,
                                        java.io.Serializable content)
An alternative constructor for a PostinaScribeTransportMessage without a specific priority. The default priority of value 5 is assumed. Use the constructor PostinaMessage(PostinaID, PostinaTopic, Serializable, int) to specify a priority. Note that the constructor is protected as applications using Postina are not supposed to create messages.

Parameters:
from - The PostinaID identifying the sender/publisher of the message.
topic - The PostinaTopic identifying the topic of a published message. Direct messages have a topic of value null.
content - The Serializable that represents the message actually issued by the sender.

PostinaScribeTransportMessage

protected PostinaScribeTransportMessage(PostinaID from,
                                        PostinaTopic topic,
                                        java.io.Serializable content,
                                        int priority)
The default constructor for a PostinaScribeTransportMessage taking all properties including the priority. Note that the constructor is protected as applications using Postina are not supposed to create messages.

Parameters:
from - The PostinaID identifying the sender/publisher of the message.
topic - The PostinaTopic identifying the topic of a published message. Direct messages have a topic of value null.
content - The Serializable that represents the message actually issued by the sender.
priority - The integer priority is designed for the application to decide about the importance of the incoming message. This priority is not used for routing.
Method Detail

getContent

public java.io.Serializable getContent()
Description copied from interface: PostinaMessage
This method gets the Serializable representing the message that has actually been sent by the sender.

Specified by:
getContent in interface PostinaMessage
Returns:
The Serializable which is the message sent by the creator.

getFrom

public PostinaID getFrom()
Description copied from interface: PostinaMessage
This method gets the PostinaID identifying the sender/publisher of the message.

Specified by:
getFrom in interface PostinaMessage
Returns:
The PostinaID that identifies the author of the message.

getPriority

public int getPriority()
Description copied from interface: PostinaMessage
This method gets the integer priority that is designed to be used by the application using Postina.

Specified by:
getPriority in interface PostinaMessage
Specified by:
getPriority in interface rice.p2p.commonapi.Message
Returns:
The integer value representing the priority of the message.

getTopic

public PostinaTopic getTopic()
Description copied from interface: PostinaMessage
This method gets the PostinaTopic assigned to this message.

Specified by:
getTopic in interface PostinaMessage
Returns:
The PostinaTopic assigned to this message. null for direct (private) messages.