com.openexchange.mail.transport.config
Class TransportConfig

java.lang.Object
  extended by com.openexchange.mail.api.MailConfig
      extended by com.openexchange.mail.transport.config.TransportConfig

public abstract class TransportConfig
extends MailConfig

TransportConfig - The user-specific transport configuration

Provides access to global transport properties.

Author:
Thorben Betten

Nested Class Summary
 
Nested classes/interfaces inherited from class com.openexchange.mail.api.MailConfig
MailConfig.BoolCapVal, MailConfig.LoginSource, MailConfig.PasswordSource, MailConfig.ServerSource
 
Method Summary
 IMailProperties getMailProperties()
          Gets the mail properties for this mail configuration.
static
<C extends TransportConfig>
C
getTransportConfig(java.lang.Class<? extends C> clazz, C transportConfig, com.openexchange.session.Session session, int accountId)
          Gets the user-specific transport configuration
abstract  ITransportProperties getTransportProperties()
          Gets the transport properties for this transport configuration.
static java.lang.String getTransportServerURL(com.openexchange.mailaccount.MailAccount mailAccount)
          Gets the transport server URL appropriate to configured transport server source.
static java.lang.String getTransportServerURL(com.openexchange.session.Session session, int accountId)
          Gets the transport server URL appropriate to configured login type
 void setMailProperties(IMailProperties mailProperties)
          Sets the mail properties for this mail configuration.
abstract  void setTransportProperties(ITransportProperties transportProperties)
          Sets the transport properties for this transport configuration.
 
Methods inherited from class com.openexchange.mail.api.MailConfig
equals, getAccountId, getCapabilities, getConfig, getLogin, getMailLogin, getMailServerURL, getMailServerURL, getPartModifier, getPassword, getPort, getServer, getUserIDsByMailLogin, hashCode, isSecure, parseProtocol, setAccountId, setLogin, setPassword, setPort, setSecure, setServer, usePartModifier
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTransportConfig

public static final <C extends TransportConfig> C getTransportConfig(java.lang.Class<? extends C> clazz,
                                                                     C transportConfig,
                                                                     com.openexchange.session.Session session,
                                                                     int accountId)
                                                          throws MailException
Gets the user-specific transport configuration

Parameters:
clazz - The transport configuration type
transportConfig - A newly created transport configuration
session - The session providing needed user data
accountId - The mail account ID
Returns:
The user-specific transport configuration
Throws:
MailException - If user-specific transport configuration cannot be determined

getTransportServerURL

public static java.lang.String getTransportServerURL(com.openexchange.mailaccount.MailAccount mailAccount)
Gets the transport server URL appropriate to configured transport server source.

Parameters:
mailAccount - The mail account
Returns:
The appropriate transport server URL or null

getTransportServerURL

public static java.lang.String getTransportServerURL(com.openexchange.session.Session session,
                                                     int accountId)
                                              throws MailException
Gets the transport server URL appropriate to configured login type

Parameters:
session - The user session
accountId - The account ID
Returns:
The appropriate transport server URL or null
Throws:
MailException - If transport server URL cannot be returned

getMailProperties

public IMailProperties getMailProperties()
Description copied from class: MailConfig
Gets the mail properties for this mail configuration.

Specified by:
getMailProperties in class MailConfig
Returns:
The mail properties for this mail configuration

setMailProperties

public void setMailProperties(IMailProperties mailProperties)
Description copied from class: MailConfig
Sets the mail properties for this mail configuration.

Specified by:
setMailProperties in class MailConfig
Parameters:
mailProperties - The mail properties for this mail configuration

getTransportProperties

public abstract ITransportProperties getTransportProperties()
Gets the transport properties for this transport configuration.

Returns:
The transport properties for this transport configuration

setTransportProperties

public abstract void setTransportProperties(ITransportProperties transportProperties)
Sets the transport properties for this transport configuration.

Parameters:
transportProperties - The transport properties for this transport configuration