This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.mail.event
class MessageCountEvent

javax.mail.event.MailEvent extended by javax.mail.event.MessageCountEvent

public class MessageCountEvent
extends MailEvent

This class notifies changes in the number of messages in a folder.

Note that some folder types may only deliver MessageCountEvents at certain times or after certain operations. IMAP in particular will only notify the client of MessageCountEvents when a client issues a new command. Refer to RFC 2060 http://www.ietf.org/rfc/rfc2060.txt for details. A client may want "poll" the folder by occasionally calling the getMessageCount or isConnected methods to solicit any such notifications.

See Also (auto-generated):

Session

Store

Properties


Field Summary
static int ADDED
          The messages were added to their folder
protected transient Message[] msgs
          The messages.
static int REMOVED
          The messages were removed from their folder
protected boolean removed
          If true, this event is the result of an explicit expunge by this client, and the messages in this folder have been renumbered to account for this.
protected int type
          The event type.
 
Constructor Summary
MessageCountEvent(Folder folder, int type, boolean removed, Message[] msgs)

          Constructor.
 
Method Summary
 void
dispatch(Object listener)

          Invokes the appropriate MessageCountListener method.
 Message[]

          Return the array of messages added or removed.
 int

          Return the type of this event.
 boolean

          Indicates whether this event is the result of an explicit expunge by this client, or due to an expunge from external sources.
 
Methods inherited from class javax.mail.event.MailEvent
dispatch
 

Field Detail

ADDED

public static final int ADDED
The messages were added to their folder

msgs

protected transient Message[] msgs
The messages.

REMOVED

public static final int REMOVED
The messages were removed from their folder

removed

protected boolean removed
If true, this event is the result of an explicit expunge by this client, and the messages in this folder have been renumbered to account for this. If false, this event is the result of an expunge by external sources.

type

protected int type
The event type.
Constructor Detail

MessageCountEvent

public MessageCountEvent(Folder folder,
                         int type,
                         boolean removed,
                         Message[] msgs)
Constructor.

Parameters:
folder - The containing folder
type - The event type
removed - If true, this event is the result of an explicit expunge by this client, and the messages in this folder have been renumbered to account for this. If false, this event is the result of an expunge by external sources.
msgs - The messages added/removed
Method Detail

dispatch

public void dispatch(Object listener)
Invokes the appropriate MessageCountListener method.

Overrides:
dispatch in class MailEvent
Parameters:
listener

getMessages

public Message[] getMessages()
Return the array of messages added or removed.

Returns:
array of messages

getType

public int getType()
Return the type of this event.

Returns:
type

isRemoved

public boolean isRemoved()
Indicates whether this event is the result of an explicit expunge by this client, or due to an expunge from external sources. If true, this event is due to an explicit expunge and hence all remaining messages in this folder have been renumbered. If false, this event is due to an external expunge.

Note that this method is valid only if the type of this event is REMOVED



This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention. The official Sun™ documentation can be found here at http://java.sun.com/products/javamail/javadocs/index.html.