- java.lang.Object
-
- java.util.EventObject
-
- javax.mail.event.MailEvent
-
- javax.mail.event.MessageCountEvent
-
- All Implemented Interfaces:
- Serializable
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
orisConnected
methods to solicit any such notifications.- Author:
- John Mani
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static int
ADDED
The messages were added to their folderprotected Message[]
msgs
The messages.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.static int
REMOVED
The messages were removed from their folderprotected int
type
The event type.-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor and Description MessageCountEvent(Folder folder, int type, boolean removed, Message[] msgs)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
dispatch(Object listener)
Invokes the appropriate MessageCountListener method.Message[]
getMessages()
Return the array of messages added or removed.int
getType()
Return the type of this event.boolean
isRemoved()
Indicates whether this event is the result of an explicit expunge by this client, or due to an expunge from external sources.
-
-
-
Field Detail
-
ADDED
public static final int ADDED
The messages were added to their folder- See Also:
- Constant Field Values
-
REMOVED
public static final int REMOVED
The messages were removed from their folder- See Also:
- Constant Field Values
-
type
protected int type
The event type.
-
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.
-
msgs
protected transient Message[] msgs
The messages.
-
-
Constructor Detail
-
MessageCountEvent
public MessageCountEvent(Folder folder, int type, boolean removed, Message[] msgs)
Constructor.- Parameters:
folder
- The containing foldertype
- The event typeremoved
- 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
-
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. Iftrue
, this event is due to an explicit expunge and hence all remaining messages in this folder have been renumbered. Iffalse
, this event is due to an external expunge.Note that this method is valid only if the type of this event is
REMOVED
-
getMessages
public Message[] getMessages()
Return the array of messages added or removed.- Returns:
- array of messages
-
-
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/mail/event/MessageCountEvent.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.