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 3501
for details.
A client may want to "poll" the folder by occasionally calling the
getMessageCount or
isOpen methods
to solicit any such notifications.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | ADDED
The messages were added to their folder |
| protected transient Message[] | msgs
The messages. |
| public static final 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. |
| private static final long | |
| protected int | type
The event type. |
| Access | Constructor and Description |
|---|---|
| public | MessageCountEvent(Folder
The containing folder folder, int The event type type, boolean 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. removed, Message[] The messages added/removed msgs)Constructor. |
| Modifier and Type | Method and Description |
|---|---|
| public void | dispatch(Object
the listener to invoke on listener)Implements abstract javax. |
| public Message[] | |
| public int | |
| public boolean | Returns: true if the message has been removedIndicates whether this event is the result of an explicit expunge by this client, or due to an expunge from external sources. |
| ADDED | back to summary |
|---|---|
| public static final int ADDED The messages were added to their folder | |
| msgs | back to summary |
|---|---|
| protected transient Message[] msgs The messages. | |
| REMOVED | back to summary |
|---|---|
| public static final int REMOVED The messages were removed from their folder | |
| removed | back to summary |
|---|---|
| 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. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| type | back to summary |
|---|---|
| protected int type The event type. | |
| MessageCountEvent | back to summary |
|---|---|
| public MessageCountEvent(Folder folder, int type, boolean removed, Message[] msgs) Constructor.
| |
| dispatch | back to summary |
|---|---|
| public void dispatch(Object listener) Implements abstract javax. Invokes the appropriate MessageCountListener method.
| |
| getMessages | back to summary |
|---|---|
| public Message[] getMessages() Return the array of messages added or removed.
| |
| getType | back to summary |
|---|---|
| public int getType() Return the type of this event.
| |
| isRemoved | back to summary |
|---|---|
| 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
Note that this method is valid only if the type of this event
is
| |