Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.jabber.extensions.mailnotification
Class MailboxIQ

java.lang.Object
  extended by org.jivesoftware.smack.packet.Packet
      extended by org.jivesoftware.smack.packet.IQ
          extended by net.java.sip.communicator.impl.protocol.jabber.extensions.mailnotification.MailboxIQ

public class MailboxIQ
extends org.jivesoftware.smack.packet.IQ

A straightforward extension of the IQ. A Mailbox object is created via the MailboxProvider. It contains all the information we need to notify the user about a new E-Mail message.

Author:
Matthieu Helleringer, Alain Knaebel, Emil Ivov

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jivesoftware.smack.packet.IQ
org.jivesoftware.smack.packet.IQ.Type
 
Field Summary
static String ELEMENT_NAME
          The name of the element that Google use to transport new mail notifications.
static String NAMESPACE
          The name space for new mail notification packets.
 
Fields inherited from class org.jivesoftware.smack.packet.Packet
DEFAULT_LANGUAGE, ID_NOT_AVAILABLE
 
Constructor Summary
MailboxIQ()
           
 
Method Summary
 void addThread(MailThreadInfo threadInfo)
          Adds a thread info element to the list of threads that this MailboxIQ is referring to.
 String getChildElementXML()
          Returns the sub-element XML section of the IQ packet, or null if there isn't one.
 long getDate()
          Returns the date of the most recent unread mail content on the mail server, in milliseconds since the UNIX epoch.
 long getResultTime()
          Returns the time when these results were generated, in milliseconds since the UNIX epoch.
 int getThreadCount()
          Returns the number of threads that are currently in this MailboxIQ.
 int getTotalMatched()
          Returns the number of unread mail messages
 String getUrl()
          Returns the http URL of the mail server containing the messages that this IQ refers to.
 boolean isTotalEstimate()
          Determines whether the total of unread mail messages is an estimate or not.
 void setDate(long date)
          Sets the date of the most recent unread mail content on the mail server, in milliseconds since the UNIX epoch.
 void setResultTime(long l)
          Sets the time these results were generated, in milliseconds since the UNIX epoch.
 void setTotalEstimate(boolean totalEstimate)
          Specifies whether the total number of unread mail messages contained in this object is an estimate or a precise count.
 void setTotalMatched(int totalMatched)
          Specifies the number of unread mail messages.
 void setUrl(String url)
          Specifies an HTTP URL of the mail server that contains the messages indicated in this Mailbox IQ.
 Iterator<MailThreadInfo> threads()
          Returns the list of threads that this MailboxIQ refers to.
 
Methods inherited from class org.jivesoftware.smack.packet.IQ
createErrorResponse, createResultIQ, getType, setType, toXML
 
Methods inherited from class org.jivesoftware.smack.packet.Packet
addExtension, deleteProperty, equals, getDefaultLanguage, getError, getExtension, getExtension, getExtensions, getExtensionsXML, getFrom, getPacketID, getProperty, getPropertyNames, getTo, getXmlns, hashCode, nextID, removeExtension, setDefaultXmlns, setError, setFrom, setPacketID, setProperty, setTo
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMESPACE

public static final String NAMESPACE
The name space for new mail notification packets.

See Also:
Constant Field Values

ELEMENT_NAME

public static final String ELEMENT_NAME
The name of the element that Google use to transport new mail notifications.

See Also:
Constant Field Values
Constructor Detail

MailboxIQ

public MailboxIQ()
Method Detail

setDate

public void setDate(long date)
Sets the date of the most recent unread mail content on the mail server, in milliseconds since the UNIX epoch.

Parameters:
date - the date long

getDate

public long getDate()
Returns the date of the most recent unread mail content on the mail server, in milliseconds since the UNIX epoch.

Returns:
the date of the most recent unread mail content on the mail server, in milliseconds since the UNIX epoch.

getResultTime

public long getResultTime()
Returns the time when these results were generated, in milliseconds since the UNIX epoch.

Returns:
the time when these results were generated, in milliseconds since the UNIX epoch.

setResultTime

public void setResultTime(long l)
Sets the time these results were generated, in milliseconds since the UNIX epoch.

Parameters:
l - the resultTime long

getTotalMatched

public int getTotalMatched()
Returns the number of unread mail messages

Returns:
the total number of matched (unread) mail messages

setTotalMatched

public void setTotalMatched(int totalMatched)
Specifies the number of unread mail messages.

Parameters:
totalMatched - the number of matched mail messages

isTotalEstimate

public boolean isTotalEstimate()
Determines whether the total of unread mail messages is an estimate or not.

Returns:
true if the total number of mail messages is an estimate and false otherwise.

setTotalEstimate

public void setTotalEstimate(boolean totalEstimate)
Specifies whether the total number of unread mail messages contained in this object is an estimate or a precise count.

Parameters:
totalEstimate - true if the number of total messages here is an estimate and false otherwise.

getChildElementXML

public String getChildElementXML()
Returns the sub-element XML section of the IQ packet, or null if there isn't one. Packet extensions must be included, if any are defined.

Specified by:
getChildElementXML in class org.jivesoftware.smack.packet.IQ
Returns:
the child element section of the IQ XML.

setUrl

public void setUrl(String url)
Specifies an HTTP URL of the mail server that contains the messages indicated in this Mailbox IQ.

Parameters:
url - the http URL where users could check the messages that this IQ refers to.

getUrl

public String getUrl()
Returns the http URL of the mail server containing the messages that this IQ refers to.

Returns:
the http URL of the mail server containing the messages that this IQ refers to.

addThread

public void addThread(MailThreadInfo threadInfo)
Adds a thread info element to the list of threads that this MailboxIQ is referring to.

Parameters:
threadInfo - the new thread info instance that we should add to the thread list.

getThreadCount

public int getThreadCount()
Returns the number of threads that are currently in this MailboxIQ.

Returns:
the number of threads currently in this MailboxIQ.

threads

public Iterator<MailThreadInfo> threads()
Returns the list of threads that this MailboxIQ refers to.

Returns:
the list of threads that this MailboxIQ refers to.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.