Note that Store extends the Service
class, which provides many common methods for naming stores,
connecting to stores, and listening to connection events.
javax.mail.Service, javax.mail.event.ConnectionEvent, javax.mail.event.StoreEvent
| Modifier and Type | Field and Description |
|---|---|
| private volatile Vector | |
| private volatile Vector |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | addFolderListener(FolderListener
the Listener for Folder events l)Add a listener for Folder events on any Folder object obtained from this Store. |
| public synchronized void | addStoreListener(StoreListener
the Listener for Store events l)Add a listener for StoreEvents on this Store. |
| public abstract Folder | Returns: the root FolderReturns a Folder object that represents the 'root' of the default namespace presented to the user by the Store. |
| public abstract Folder | |
| public abstract Folder | |
| public Folder[] | Returns: array of Folder objectsReturn a set of folders representing the personal namespaces for the current user. |
| public Folder[] | Returns: array of Folder objectsReturn a set of folders representing the shared namespaces. |
| public Folder[] | Returns: array of Folder objectsthe user name user)Return a set of folders representing the namespaces for
|
| protected void | notifyFolderListeners(int
type of FolderEvent type, Folder affected Folder folder)Notify all FolderListeners. |
| protected void | notifyFolderRenamedListeners(Folder
the folder being renamed oldF, Folder the folder representing the new name. newF)Notify all FolderListeners about the renaming of a folder. |
| protected void | notifyStoreListeners(int
the StoreEvent type type, String a message for the StoreEvent message)Notify all StoreListeners. |
| public synchronized void | |
| public synchronized void |
| folderListeners | back to summary |
|---|---|
| private volatile Vector<FolderListener> folderListeners | |
| storeListeners | back to summary |
|---|---|
| private volatile Vector<StoreListener> storeListeners | |
| Store | back to summary |
|---|---|
| protected Store(Session session, URLName urlname) Constructor. | |
| addFolderListener | back to summary |
|---|---|
| public synchronized void addFolderListener(FolderListener l) Add a listener for Folder events on any Folder object obtained from this Store. FolderEvents are delivered to FolderListeners on the affected Folder as well as to FolderListeners on the containing Store. The default implementation provided here adds this listener to an internal list of FolderListeners.
| |
| addStoreListener | back to summary |
|---|---|
| public synchronized void addStoreListener(StoreListener l) Add a listener for StoreEvents on this Store. The default implementation provided here adds this listener to an internal list of StoreListeners.
| |
| getDefaultFolder | back to summary |
|---|---|
| public abstract Folder getDefaultFolder() throws MessagingException Returns a Folder object that represents the 'root' of the default namespace presented to the user by the Store.
| |
| getFolder | back to summary |
|---|---|
| public abstract Folder getFolder(String name) throws MessagingException Return the Folder object corresponding to the given name. Note
that a Folder object is returned even if the named folder does
not physically exist on the Store. The Folder objects are not cached by the Store, so invoking this method on the same name multiple times will return that many distinct Folder objects.
| |
| getFolder | back to summary |
|---|---|
| public abstract Folder getFolder(URLName url) throws MessagingException Return a closed Folder object, corresponding to the given URLName. The store specified in the given URLName should refer to this Store object.
Implementations of this method may obtain the name of the
actual folder using the
| |
| getPersonalNamespaces | back to summary |
|---|---|
| public Folder[] getPersonalNamespaces() throws MessagingException Return a set of folders representing the personal namespaces for the current user. A personal namespace is a set of names that is considered within the personal scope of the authenticated user. Typically, only the authenticated user has access to mail folders in their personal namespace. If an INBOX exists for a user, it must appear within the user's personal namespace. In the typical case, there should be only one personal namespace for each user in each Store.
This implementation returns an array with a single entry containing
the return value of the
| |
| getSharedNamespaces | back to summary |
|---|---|
| public Folder[] getSharedNamespaces() throws MessagingException Return a set of folders representing the shared namespaces. A shared namespace is a namespace that consists of mail folders that are intended to be shared amongst users and do not exist within a user's personal namespace. This implementation returns an empty array. Subclasses should override this method to return appropriate information.
| |
| getUserNamespaces | back to summary |
|---|---|
| public Folder[] getUserNamespaces(String user) throws MessagingException Return a set of folders representing the namespaces for
This implementation returns an empty array. Subclasses should override this method to return appropriate information.
| |
| notifyFolderListeners | back to summary |
|---|---|
| protected void notifyFolderListeners(int type, Folder folder) Notify all FolderListeners. Store implementations are expected to use this method to broadcast Folder events. The provided default implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the registered FolderListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems.
| |
| notifyFolderRenamedListeners | back to summary |
|---|---|
| protected void notifyFolderRenamedListeners(Folder oldF, Folder newF) Notify all FolderListeners about the renaming of a folder. Store implementations are expected to use this method to broadcast Folder events indicating the renaming of folders. The provided default implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the registered FolderListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems. | |
| notifyStoreListeners | back to summary |
|---|---|
| protected void notifyStoreListeners(int type, String message) Notify all StoreListeners. Store implementations are expected to use this method to broadcast StoreEvents. The provided default implementation queues the event into an internal event queue. An event dispatcher thread dequeues events from the queue and dispatches them to the registered StoreListeners. Note that the event dispatching occurs in a separate thread, thus avoiding potential deadlock problems.
| |
| removeFolderListener | back to summary |
|---|---|
| public synchronized void removeFolderListener(FolderListener l) Remove a listener for Folder events. The default implementation provided here removes this listener from the internal list of FolderListeners.
| |
| removeStoreListener | back to summary |
|---|---|
| public synchronized void removeStoreListener(StoreListener l) Remove a listener for Store events. The default implementation provided here removes this listener from the internal list of StoreListeners.
| |