org.media.mn8.protocol.jabber.datablocks
Class Message

java.lang.Object
  |
  +--org.media.mn8.protocol.jabber.JabberDataBlock
        |
        +--org.media.mn8.protocol.jabber.datablocks.Message

public class Message
extends JabberDataBlock

The class representing a Jabber message object


Fields inherited from class org.media.mn8.protocol.jabber.JabberDataBlock
attributes, childBlocks, parent, textData
 
Constructor Summary
Message()
          Default Constructor.
Message(JabberDataBlock _parent, java.util.Hashtable _attributes)
          Constructor for incomming messages
Message(java.lang.String to)
          Constructor.
Message(java.lang.String to, java.lang.String message)
          Constructor.
 
Method Summary
 Message constructReply()
          Construct a reply message
 java.lang.String getBody()
          Method to get the message body
 java.lang.String getSubject()
          Method to get the message subject
 java.lang.String getTagName()
          Get the tag start marker
 void setBodyText(java.lang.String text)
          Method to set the body text.
 void setHTMLBodyText(java.lang.String html)
          Method to set the body text written in HTML.
 void setSubject(java.lang.String text)
          Method to set the subject text.
 void setThread(java.lang.String text)
          Method to set the message thread.
 
Methods inherited from class org.media.mn8.protocol.jabber.JabberDataBlock
addAttributeToStringBuffer, addChild, addText, constructReply, getAttribute, getBytes, getChildBlocks, getParent, getTagEnd, getTagStart, getText, setAttribute, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Message

public Message(java.lang.String to,
               java.lang.String message)
Constructor. Prepares the message destination and body
Parameters:
to - The destination of the message
message - The message text

Message

public Message(java.lang.String to)
Constructor. Prepares the message destination
Parameters:
to - The destination of the message

Message

public Message()
Default Constructor. Alls for construction of an empty message template.

Message

public Message(JabberDataBlock _parent,
               java.util.Hashtable _attributes)
Constructor for incomming messages
Parameters:
_parent - The parent of this datablock
_attributes - The list of element attributes
Method Detail

setBodyText

public void setBodyText(java.lang.String text)
Method to set the body text. Creates a block with body as it's tag name and inserts the text into it.
Parameters:
bodyText - The string to go in the message body

setHTMLBodyText

public void setHTMLBodyText(java.lang.String html)
Method to set the body text written in HTML. Creates a block with html as it's tag name in the xhtml name space and inserts the html into it.
Parameters:
html - The html to go in the message body

setThread

public void setThread(java.lang.String text)
Method to set the message thread. Creates a block with thread as it's tag name and inserts the thread name into it.
Parameters:
threadName - The string to go in the thread block

setSubject

public void setSubject(java.lang.String text)
Method to set the subject text. Creates a subject block and inserts the text into it.
Parameters:
text - The string to go in the message subject

getSubject

public java.lang.String getSubject()
Method to get the message subject
Returns:
A string representing the message subject

getBody

public java.lang.String getBody()
Method to get the message body
Returns:
The message body as a string

constructReply

public Message constructReply()
Construct a reply message
Returns:
A message object destined for the sender of this message with no subject or body

getTagName

public java.lang.String getTagName()
Get the tag start marker
Overrides:
getTagName in class JabberDataBlock
Returns:
The block start tag


"Copyright © 2001 Internet Multicasting Services & media.org. All Rights Reserved."