|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.openexchange.mail.api.MailConfig
public abstract class MailConfig
MailConfig - The user-specific mail properties; e.g. containing user's login data.
Provides access to global mail properties.
| Nested Class Summary | |
|---|---|
static class |
MailConfig.BoolCapVal
|
static class |
MailConfig.LoginSource
|
static class |
MailConfig.PasswordSource
|
static class |
MailConfig.ServerSource
|
| Method Summary | ||
|---|---|---|
boolean |
equals(java.lang.Object obj)
|
|
int |
getAccountId()
Gets the account ID. |
|
abstract MailCapabilities |
getCapabilities()
Gets the mail system's capabilities |
|
static
|
getConfig(java.lang.Class<? extends C> clazz,
C mailConfig,
com.openexchange.session.Session session,
int accountId)
Gets the user-specific mail configuration. |
|
java.lang.String |
getLogin()
Gets the login. |
|
static java.lang.String |
getMailLogin(com.openexchange.mailaccount.MailAccount mailAccount,
java.lang.String userLoginInfo)
Gets the mail login with respect to configured login source. |
|
abstract IMailProperties |
getMailProperties()
Gets the mail properties for this mail configuration. |
|
static java.lang.String |
getMailServerURL(com.openexchange.mailaccount.MailAccount mailAccount)
Gets the mail server URL appropriate to configured mail server source. |
|
static java.lang.String |
getMailServerURL(com.openexchange.session.Session session,
int accountId)
Gets the mail server URL appropriate to configured mail server source. |
|
static PartModifier |
getPartModifier()
Gets the part modifier. |
|
java.lang.String |
getPassword()
Gets the password. |
|
abstract int |
getPort()
Gets the optional port of the server. |
|
abstract java.lang.String |
getServer()
Gets the host name or IP address of the server. |
|
static int[] |
getUserIDsByMailLogin(java.lang.String pattern,
boolean isDefaultAccount,
java.net.InetSocketAddress server,
com.openexchange.groupware.contexts.Context ctx)
Resolves the user IDs by specified pattern dependent on configuration's setting for mail login source. |
|
int |
hashCode()
|
|
abstract boolean |
isSecure()
Checks if a secure connection shall be established. |
|
static java.lang.String[] |
parseProtocol(java.lang.String server)
Parses protocol out of specified server string according to URL specification; e.g. |
|
void |
setAccountId(int accountId)
Sets the account ID (externally). |
|
void |
setLogin(java.lang.String login)
Sets the login (externally). |
|
abstract void |
setMailProperties(IMailProperties mailProperties)
Sets the mail properties for this mail configuration. |
|
void |
setPassword(java.lang.String password)
Sets the password (externally). |
|
abstract void |
setPort(int port)
Sets the port (externally). |
|
abstract void |
setSecure(boolean secure)
Sets (externally) whether a secure connection should be established or not. |
|
abstract void |
setServer(java.lang.String server)
Sets the host name or IP address of the server (externally). |
|
static boolean |
usePartModifier()
Checks if a part modifier shall be used, that is PartModifier.getInstance() is not null and not
assignment-compatible to DummyPartModifier (which does nothing at all). |
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static final <C extends MailConfig> C getConfig(java.lang.Class<? extends C> clazz,
C mailConfig,
com.openexchange.session.Session session,
int accountId)
throws MailException
C - The return value typeclazz - The mail configuration typemailConfig - A newly created mail configurationsession - The session providing needed user dataaccountId - The mail account ID
MailException - If user-specific mail configuration cannot be determined
public static final java.lang.String getMailLogin(com.openexchange.mailaccount.MailAccount mailAccount,
java.lang.String userLoginInfo)
mailAccount - The mail account used to determine the loginuserLoginInfo - The login information of the user
public static final java.lang.String getMailServerURL(com.openexchange.mailaccount.MailAccount mailAccount)
mailAccount - The user
null
public static final java.lang.String getMailServerURL(com.openexchange.session.Session session,
int accountId)
throws MailException
session - The user sessionaccountId - The account ID
null
MailException - If mail server URL cannot be returnedpublic static final PartModifier getPartModifier()
public static int[] getUserIDsByMailLogin(java.lang.String pattern,
boolean isDefaultAccount,
java.net.InetSocketAddress server,
com.openexchange.groupware.contexts.Context ctx)
throws com.openexchange.groupware.AbstractOXException
pattern - The patternserver - The server addressctx - The context
com.openexchange.groupware.AbstractOXException - If resolving user by specified pattern failspublic static final java.lang.String[] parseProtocol(java.lang.String server)
server - The server string
String with length 2. The first element is the protocol and the second the server. If no
protocol pattern could be found null is returned; meaning no protocol is present in specified server string.public static final boolean usePartModifier()
PartModifier.getInstance() is not null and not
assignment-compatible to DummyPartModifier (which does nothing at all).
true if part modifier shall be used; otherwise falsepublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int getAccountId()
public abstract MailCapabilities getCapabilities()
public final java.lang.String getLogin()
public final java.lang.String getPassword()
public abstract int getPort()
getServer() or -1 if no port needed.public abstract java.lang.String getServer()
public int hashCode()
hashCode in class java.lang.Objectpublic abstract boolean isSecure()
true if a secure connection shall be established; otherwise falsepublic void setAccountId(int accountId)
accountId - The account IDpublic void setLogin(java.lang.String login)
login - The loginpublic void setPassword(java.lang.String password)
password - The passwordpublic abstract void setPort(int port)
port - The portpublic abstract void setSecure(boolean secure)
secure - true if a secure connection should be established; otherwise falsepublic abstract void setServer(java.lang.String server)
server - The host name or IP address of the serverpublic abstract IMailProperties getMailProperties()
public abstract void setMailProperties(IMailProperties mailProperties)
mailProperties - The mail properties for this mail configuration
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||