com.echomine.jabber.msg
Class DelayXMessage

java.lang.Object
  extended by com.echomine.jabber.JabberMessage
      extended by com.echomine.jabber.JabberJDOMMessage
          extended by com.echomine.jabber.msg.DelayXMessage
All Implemented Interfaces:
JabberMessageParsable

public class DelayXMessage
extends JabberJDOMMessage

This method add support for the jabber:x:delay message type. Normally this message extension is contained within some other message. Currently you cannot send delay message along with the presence message, so this object will only parse incoming data.

Current Implementation: JEP-0091 Version 1.0


Field Summary
 
Fields inherited from class com.echomine.jabber.JabberMessage
messageID
 
Constructor Summary
DelayXMessage()
          constructs a default Delay message (with the x element)
 
Method Summary
 java.lang.String getFrom()
           
 int getMessageType()
          the default message type is unknown.
 java.lang.String getText()
          the text that is optionally associated with the message.
 java.lang.String getTime()
          The time stamp string as returned by the remote server.
 java.util.Date getTimeInLocal()
          The time when the message was sent by the sender, NOT the time received.
 JabberMessage parse(JabberMessageParser parser, Element msgTree)
          parses the message.
 
Methods inherited from class com.echomine.jabber.JabberJDOMMessage
encode, getDOM, getXMLOutputter, setMessageID, toString
 
Methods inherited from class com.echomine.jabber.JabberMessage
getMessageID, getReplyMessage, getTimeout, getXMessage, getXMessages, interrupt, isReplyRequired, isSendXMessages, isSynchronized, replyReceived, setReplyRequired, setSendXMessages, setSynchronized, setTimeout, setXMessage, setXMessages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DelayXMessage

public DelayXMessage()
constructs a default Delay message (with the x element)

Method Detail

parse

public JabberMessage parse(JabberMessageParser parser,
                           Element msgTree)
                    throws ParseException
parses the message. The parser current just extracts out the attributes and text

Specified by:
parse in interface JabberMessageParsable
Overrides:
parse in class JabberJDOMMessage
Throws:
ParseException

getTimeInLocal

public java.util.Date getTimeInLocal()
The time when the message was sent by the sender, NOT the time received. Note that the time is local to your time zone, not in UTC or the sender's timezone. Thus, if you are in PST (GMT-800), then you will get when the message was sent in PST time.

Returns:
the time the message was sent, null if none exists

getTime

public java.lang.String getTime()
The time stamp string as returned by the remote server. This time stamp is in UTC. The time stamp is formatted as an ISO date format. To parse it, you can use something like: SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss");

Returns:
the time stamp string

getFrom

public java.lang.String getFrom()
Returns:
the sender of the message, null if none exists

getText

public java.lang.String getText()
the text that is optionally associated with the message.

Returns:
the text message or null if none exists

getMessageType

public int getMessageType()
Description copied from class: JabberJDOMMessage
the default message type is unknown. It doesn't mean that there is no type. It just means that there is no known message parser for this particular object.

Overrides:
getMessageType in class JabberJDOMMessage
Returns:
a message code that is unique to the message
See Also:
JabberCode


Copyright © 2001-2005 Echomine. All Rights Reserved.