com.echomine.jabber.msg
Class ExpireXMessage

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

public class ExpireXMessage
extends JabberJDOMMessage

This extension is a simple flag identifying that a message has a limited lifetime. If the message is stored offline, the server will not deliver the message and simply delete it after the expiration time has passed. A client may also optionally support removing the message after expiration if it has been received but not yet been viewed. The seconds attribute is always relative to the time in which the message was sent/received (now). The server will adjust the value if it was stored for some time but not expired on the server.

Current Implementation: JEP-0023 Version 1.0


Field Summary
 
Fields inherited from class com.echomine.jabber.JabberMessage
messageID
 
Constructor Summary
ExpireXMessage()
          constructs a default message
 
Method Summary
 long getExpireTimeout()
           
 int getMessageType()
          the default message type is unknown.
 long getStoredTimeInMillis()
          retrieves the stored time.
 void setExpireTimeout(long seconds)
          sets the seconds for expiration for a message as a notification to the server or the remote client.
 void setStoredTimeInMillis(long time)
          sets the time when this message is stored
 
Methods inherited from class com.echomine.jabber.JabberJDOMMessage
encode, getDOM, getXMLOutputter, parse, 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

ExpireXMessage

public ExpireXMessage()
constructs a default message

Method Detail

getExpireTimeout

public long getExpireTimeout()
Returns:
the seconds when message should be expired, or 0 if no seconds exists

setExpireTimeout

public void setExpireTimeout(long seconds)
sets the seconds for expiration for a message as a notification to the server or the remote client.


getStoredTimeInMillis

public long getStoredTimeInMillis()
retrieves the stored time. The stored time can be subtracted from System.currentTimeInMillis() to find out how much time has passed and check it against the expire timeout to make sure that the message is still considered "fresh".

Returns:
the time when the message was stored, 0 if no attribute exists

setStoredTimeInMillis

public void setStoredTimeInMillis(long time)
sets the time when this message is stored


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.