|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.mail.Service javax.mail.Store org.apache.geronimo.javamail.store.imap.IMAPStore
public class IMAPStore
IMAP implementation of javax.mail.Store POP protocol spec is implemented in org.apache.geronimo.javamail.store.pop3.IMAPConnection
Field Summary | |
---|---|
protected IMAPConnectionPool |
connectionPool
|
protected boolean |
debug
|
protected PrintStream |
debugStream
|
protected static int |
DEFAULT_IMAP_PORT
|
protected static int |
DEFAULT_IMAP_SSL_PORT
|
protected static int |
DEFAULT_STATUS_TIMEOUT
|
protected static String |
MAIL_STATUS_TIMEOUT
|
protected List |
openFolders
|
protected ProtocolProperties |
props
|
protected IMAPRootFolder |
root
|
Fields inherited from class javax.mail.Service |
---|
session, url |
Constructor Summary | |
---|---|
|
IMAPStore(Session session,
URLName urlName)
Construct an IMAPStore item. |
protected |
IMAPStore(Session session,
URLName urlName,
String protocol,
boolean sslConnection,
int defaultPort)
Protected common constructor used by both the IMAPStore and the IMAPSSLStore to initialize the Store instance. |
Method Summary | |
---|---|
void |
close()
Close this service and terminate its physical connection. |
protected void |
closeOpenFolders()
Close all open folders. |
protected void |
finalize()
Finalizer to perform IMAPStore() cleanup when no longer in use. |
Folder |
getDefaultFolder()
Return a Folder object that represents the root of the namespace for the current user. |
Folder |
getFolder(String name)
Return the Folder corresponding to the given name. |
Folder |
getFolder(URLName url)
Return the folder identified by the URLName; the URLName must refer to this Store. |
protected Folder[] |
getNamespaceFolders(List namespaces)
Convert a List of IMAPNamespace definitions into an array of Folder instances. |
protected IMAPNamespaceResponse |
getNamespaces()
Get the namespace information from the IMAP server. |
Folder[] |
getPersonalNamespaces()
Return the root folders of the personal namespace belonging to the current user. |
Quota[] |
getQuota(String root)
Get the quotas for the specified root element. |
Folder[] |
getSharedNamespaces()
Return the root folders of namespaces that are intended to be shared between users. |
protected IMAPConnection |
getStoreConnection()
Retrieve the server connection created by this store. |
Folder[] |
getUserNamespaces(String user)
Return the root folders of the personal namespaces belonging to the supplied user. |
boolean |
handleResponse(IMAPUntaggedResponse response)
Handle an unsolicited response from the server. |
boolean |
hasCapability(String capability)
Test if this connection has a given capability. |
boolean |
isConnected()
Test to see if we're still connected. |
protected boolean |
protocolConnect(String host,
int port,
String username,
String password)
Attempt the protocol-specific connection; subclasses should override this to establish a connection in the appropriate manner. |
protected void |
releaseStoreConnection(IMAPConnection connection)
|
void |
setQuota(Quota quota)
Set a quota item. |
Methods inherited from class javax.mail.Store |
---|
addFolderListener, addStoreListener, notifyFolderListeners, notifyFolderRenamedListeners, notifyStoreListeners, removeFolderListener, removeStoreListener |
Methods inherited from class javax.mail.Service |
---|
addConnectionListener, connect, connect, connect, connect, getURLName, notifyConnectionListeners, queueEvent, removeConnectionListener, setConnected, setURLName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final int DEFAULT_IMAP_PORT
protected static final int DEFAULT_IMAP_SSL_PORT
protected static final String MAIL_STATUS_TIMEOUT
protected static final int DEFAULT_STATUS_TIMEOUT
protected ProtocolProperties props
protected IMAPConnectionPool connectionPool
protected IMAPRootFolder root
protected List openFolders
protected PrintStream debugStream
protected boolean debug
Constructor Detail |
---|
public IMAPStore(Session session, URLName urlName)
session
- The owning javamail Session.urlName
- The Store urlName, which can contain server target information.protected IMAPStore(Session session, URLName urlName, String protocol, boolean sslConnection, int defaultPort)
session
- The Session we're attached to.urlName
- The urlName.protocol
- The protocol name.sslConnection
- The sslConnection flag.defaultPort
- The default connection port.Method Detail |
---|
protected boolean protocolConnect(String host, int port, String username, String password) throws MessagingException
Service.connect(String, int, String, String)
method to
reattempt the connection after trying to obtain user and password information from the user.
Alternatively it may throw a AuthenticatedFailedException to abandon the conection attempt.
protocolConnect
in class Service
host
- The target host name of the service.port
- The connection port for the service.user
- The user name used for the connection.password
- The password used for the connection.
AuthenticationFailedException
- if authentication fails
MessagingException
- for other failurespublic void close() throws MessagingException
close
in class Service
MessagingException
- if there were errors closing; the connection is still closedpublic Folder getDefaultFolder() throws MessagingException
getDefaultFolder
in class Store
MessagingException
- if there was a problem accessing the storepublic Folder getFolder(String name) throws MessagingException
Folder.exists()
method can be used
to determine if it is real.
getFolder
in class Store
name
- the name of the Folder to return
MessagingException
- if there was a problem accessing the storepublic Folder getFolder(URLName url) throws MessagingException
URLName.getFile()
method to determined the folder name.
getFolder
in class Store
url
-
MessagingException
- if there was a problem accessing the storepublic Folder[] getPersonalNamespaces() throws MessagingException
getDefaultFolder()
.
getPersonalNamespaces
in class Store
MessagingException
- if there was a problem accessing the storepublic Folder[] getUserNamespaces(String user) throws MessagingException
getUserNamespaces
in class Store
user
- the user whose namespaces should be returned
MessagingException
- if there was a problem accessing the storepublic Folder[] getSharedNamespaces() throws MessagingException
getSharedNamespaces
in class Store
MessagingException
- if there was a problem accessing the storepublic Quota[] getQuota(String root) throws MessagingException
getQuota
in interface QuotaAwareStore
root
- The root name for the quota information.
MessagingException
- if the quotas cannot be retrievedpublic void setQuota(Quota quota) throws MessagingException
setQuota
in interface QuotaAwareStore
quota
- The source quota item.
MessagingException
- if the quota cannot be setpublic boolean isConnected()
isConnected
in class Service
protected IMAPConnection getStoreConnection() throws MessagingException
MessagingException
protected void releaseStoreConnection(IMAPConnection connection) throws MessagingException
MessagingException
protected void closeOpenFolders()
protected IMAPNamespaceResponse getNamespaces() throws MessagingException
MessagingException
protected Folder[] getNamespaceFolders(List namespaces) throws MessagingException
namespaces
- The namespace List
MessagingException
public boolean hasCapability(String capability)
capability
- The capability name.
public boolean handleResponse(IMAPUntaggedResponse response)
handleResponse
in interface IMAPUntaggedResponseHandler
response
- The UntaggedResponse to process.
protected void finalize() throws Throwable
finalize
in class Service
Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |