|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.openexchange.mail.MailProviderRegistry
public final class MailProviderRegistry
| Method Summary | |
|---|---|
static MailProvider |
getMailProvider(java.lang.String protocolName)
Gets the mail provider appropriate for specified protocol. |
static MailProvider |
getMailProviderBySession(com.openexchange.session.Session session,
int accountId)
Gets the mail provider appropriate for specified session. |
static MailProvider |
getMailProviderByURL(java.lang.String serverUrl)
Gets the mail provider appropriate for specified mail server URL. |
static boolean |
registerMailProvider(java.lang.String protocol,
MailProvider provider)
Registers a mail provider and performs its start-up actions |
static void |
unregisterAll()
Unregisters all mail providers |
static MailProvider |
unregisterMailProvider(MailProvider provider)
Unregisters the mail provider |
static MailProvider |
unregisterMailProviderByProtocol(java.lang.String protocol)
Unregisters the mail provider supporting specified protocol |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static MailProvider getMailProviderBySession(com.openexchange.session.Session session,
int accountId)
throws MailException
session - The sessionaccountId - The account ID
MailException - If no supporting mail provider can be foundpublic static MailProvider getMailProviderByURL(java.lang.String serverUrl)
The given URL should match pattern
<protocol>://<host>(:<port>)?The protocol should be present. Otherwise the configured fallback is used as protocol.
serverUrl - The mail server URL
public static MailProvider getMailProvider(java.lang.String protocolName)
protocolName - The mail protocol; e.g. "imap"
public static boolean registerMailProvider(java.lang.String protocol,
MailProvider provider)
throws MailException
protocol - The mail protocol's string representation; e.g. "imap_imaps"provider - The mail provider to register
true if mail provider has been successfully registered and no other mail provider supports the same protocol;
otherwise false
MailException - If provider's start-up failspublic static void unregisterAll()
public static MailProvider unregisterMailProvider(MailProvider provider)
throws MailException
provider - The mail provider to unregister
null
MailException - If provider's shut-down fails
public static MailProvider unregisterMailProviderByProtocol(java.lang.String protocol)
throws MailException
protocol - The protocol
MailProvider, or null if there was no provider supporting specified
protocol
MailException - If provider's shut-down fails
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||