| java.lang.Object javax.mail.Service javax.mail.Store
All known Subclasses: com.sun.mail.pop3.POP3Store, com.sun.mail.imap.IMAPStore,
Store | abstract public class Store extends Service (Code) | | An abstract class that models a message store and its
access protocol, for storing and retrieving messages.
Subclasses provide actual implementations.
Note that Store extends the Service
class, which provides many common methods for naming stores,
connecting to stores, and listening to connection events.
author: John Mani author: Bill Shannon version: 1.28, 07/05/04 See Also: javax.mail.Service See Also: javax.mail.event.ConnectionEvent See Also: javax.mail.event.StoreEvent |
Store | protected Store(Session session, URLName urlname)(Code) | | Constructor.
Parameters: session - Session object for this Store. Parameters: urlname - URLName object to be used for this Store |
addFolderListener | public synchronized void addFolderListener(FolderListener l)(Code) | | 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.
Parameters: l - the Listener for Folder events See Also: javax.mail.event.FolderEvent |
addStoreListener | public synchronized void addStoreListener(StoreListener l)(Code) | | Add a listener for StoreEvents on this Store.
The default implementation provided here adds this listener
to an internal list of StoreListeners.
Parameters: l - the Listener for Store events See Also: javax.mail.event.StoreEvent |
getDefaultFolder | abstract public Folder getDefaultFolder() throws MessagingException(Code) | | Returns a Folder object that represents the 'root' of
the default namespace presented to the user by the Store.
the root Folder exception: IllegalStateException - if this Store is not connected. |
getFolder | abstract public Folder getFolder(String name) throws MessagingException(Code) | | 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 exists()
method on the folder object indicates whether this folder really
exists.
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.
Parameters: name - The name of the Folder. In some Stores, name canbe an absolute path if it starts with thehierarchy delimiter. Else it is interpretedrelative to the 'root' of this namespace. Folder object exception: IllegalStateException - if this Store is not connected. See Also: Folder.exists See Also: Folder.create |
getFolder | abstract public Folder getFolder(URLName url) throws MessagingException(Code) | | 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 getFile() method on
URLName, and use that name to create the folder.
Parameters: url - URLName that denotes a folder See Also: URLName exception: IllegalStateException - if this Store is not connected. Folder object |
getPersonalNamespaces | public Folder[] getPersonalNamespaces() throws MessagingException(Code) | | 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 getDefaultFolder method.
Subclasses should override this method to return appropriate information.
exception: IllegalStateException - if this Store is not connected. array of Folder objects since: JavaMail 1.2 |
getSharedNamespaces | public Folder[] getSharedNamespaces() throws MessagingException(Code) | | 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.
exception: IllegalStateException - if this Store is not connected. array of Folder objects since: JavaMail 1.2 |
getUserNamespaces | public Folder[] getUserNamespaces(String user) throws MessagingException(Code) | | Return a set of folders representing the namespaces for
user . The namespaces returned represent the
personal namespaces for the user. To access mail folders in the
other user's namespace, the currently authenticated user must be
explicitly granted access rights. For example, it is common for
a manager to grant to their secretary access rights to their
mail folders.
This implementation returns an empty array. Subclasses should
override this method to return appropriate information.
exception: IllegalStateException - if this Store is not connected. array of Folder objects since: JavaMail 1.2 |
notifyFolderListeners | protected void notifyFolderListeners(int type, Folder folder)(Code) | | 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.
Parameters: type - type of FolderEvent Parameters: folder - affected Folder See Also: Store.notifyFolderRenamedListeners |
notifyFolderRenamedListeners | protected void notifyFolderRenamedListeners(Folder oldF, Folder newF)(Code) | | 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.
Parameters: oldF - the folder being renamed Parameters: newF - the folder representing the new name. since: JavaMail 1.1 |
notifyStoreListeners | protected void notifyStoreListeners(int type, String message)(Code) | | 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 | public synchronized void removeFolderListener(FolderListener l)(Code) | | Remove a listener for Folder events.
The default implementation provided here removes this listener
from the internal list of FolderListeners.
Parameters: l - the listener See Also: Store.addFolderListener |
removeStoreListener | public synchronized void removeStoreListener(StoreListener l)(Code) | | Remove a listener for Store events.
The default implementation provided here removes this listener
from the internal list of StoreListeners.
Parameters: l - the listener See Also: Store.addStoreListener |
Methods inherited from javax.mail.Service | public synchronized void addConnectionListener(ConnectionListener l)(Code)(Java Doc) public synchronized void close() throws MessagingException(Code)(Java Doc) public void connect() throws MessagingException(Code)(Java Doc) public void connect(String host, String user, String password) throws MessagingException(Code)(Java Doc) public void connect(String user, String password) throws MessagingException(Code)(Java Doc) public synchronized void connect(String host, int port, String user, String password) throws MessagingException(Code)(Java Doc) protected void finalize() throws Throwable(Code)(Java Doc) public synchronized URLName getURLName()(Code)(Java Doc) public synchronized boolean isConnected()(Code)(Java Doc) protected synchronized void notifyConnectionListeners(int type)(Code)(Java Doc) protected boolean protocolConnect(String host, int port, String user, String password) throws MessagingException(Code)(Java Doc) protected void queueEvent(MailEvent event, Vector vector)(Code)(Java Doc) public synchronized void removeConnectionListener(ConnectionListener l)(Code)(Java Doc) protected synchronized void setConnected(boolean connected)(Code)(Java Doc) protected synchronized void setURLName(URLName url)(Code)(Java Doc) public String toString()(Code)(Java Doc)
|
|
|