Movatterモバイル変換


[0]ホーム

URL:


         


Class Store

java.lang.Object  |  +--javax.mail.Service        |        +--javax.mail.Store

public abstract classStore
extendsService

An abstract class that models a message store and its access protocol, for storing and retrieving messages. Subclasses provide actual implementations.

Note thatStore extends theService class, which provides many common methods for naming stores, connecting to stores, and listening to connection events.

See Also:
Service,ConnectionEvent,StoreEvent

Fields inherited from class javax.mail.Service
debug,session,url
 
Store(Session session,URLName urlname)
          Constructor.
 
addFolderListener(FolderListener l)
          Add a listener for Folder events on any Folder object obtained from this Store.
addStoreListener(StoreListener l)
          Add a listener for StoreEvents on this Store.
getDefaultFolder()
          Returns a Folder object that represents the 'root' of the default namespace presented to the user by the Store.
getFolder(java.lang.String name)
          Return the Folder object corresponding to the given name.
getFolder(URLName url)
          Return a closed Folder object, corresponding to the given URLName.
notifyFolderListeners(int type,Folder folder)
          Notify all FolderListeners.
notifyFolderRenamedListeners(Folder oldF,Folder newF)
          Notify all FolderListeners about the renaming of a folder.
notifyStoreListeners(int type, java.lang.String message)
          Notify all StoreListeners.
removeFolderListener(FolderListener l)
          Remove a listener for Folder events.
removeStoreListener(StoreListener l)
          Remove a listener for Store events.
 
Methods inherited from class javax.mail.Service
addConnectionListener,close,connect,connect,connect,finalize,getURLName,isConnected,notifyConnectionListeners,protocolConnect,queueEvent,removeConnectionListener,setConnected,setURLName,toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Store

protectedStore(Session session,URLName urlname)
Constructor.
Parameters:
session - Session object for this Store.
url - URLName object to be used for this Store

getDefaultFolder

public abstractFoldergetDefaultFolder()                                 throwsMessagingException
Returns a Folder object that represents the 'root' of the default namespace presented to the user by the Store.
Returns:
the root Folder
Throws:
java.lang.IllegalStateException - if this Store is not connected.

getFolder

public abstractFoldergetFolder(java.lang.String name)                          throwsMessagingException
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. Theexists() 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.
Returns:
Folder object
Throws:
java.lang.IllegalStateException - if this Store is not connected.
See Also:
Folder.exists(),Folder.create(int)

getFolder

public abstractFoldergetFolder(URLName url)                          throwsMessagingException
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 thegetFile() method on URLName, and use that name to create the folder.

Parameters:
url - URLName that denotes a folder
Returns:
Folder object
Throws:
java.lang.IllegalStateException - if this Store is not connected.
See Also:
URLName

addStoreListener

public voidaddStoreListener(StoreListener l)
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:
StoreEvent

removeStoreListener

public voidremoveStoreListener(StoreListener l)
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:
addStoreListener(javax.mail.event.StoreListener)

notifyStoreListeners

protected voidnotifyStoreListeners(int type,                                    java.lang.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.


addFolderListener

public voidaddFolderListener(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.

Parameters:
l - the Listener for Folder events
See Also:
FolderEvent

removeFolderListener

public voidremoveFolderListener(FolderListener l)
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:
addFolderListener(javax.mail.event.FolderListener)

notifyFolderListeners

protected voidnotifyFolderListeners(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.

Parameters:
type - type of FolderEvent
folder - affected Folder
See Also:
notifyFolderRenamedListeners(javax.mail.Folder, javax.mail.Folder)

notifyFolderRenamedListeners

protected voidnotifyFolderRenamedListeners(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.

Parameters:
oldF - the folder being renamed
newF - the folder representing the new name.
Since:
JavaMail 1.1

         


[8]ページ先頭

©2009-2025 Movatter.jp