public abstract class AbstractEmailConnection extends Object
Performs the creation of a persistent set of properties that are used to configure the Session instance.
| Modifier and Type | Field and Description |
|---|---|
static String |
PASSWORD_NO_USERNAME_ERROR |
protected EmailProtocol |
protocol |
protected javax.mail.Session |
session |
static String |
USERNAME_NO_PASSWORD_ERROR |
| Constructor and Description |
|---|
AbstractEmailConnection(EmailProtocol protocol,
String username,
String password,
String host,
String port,
long connectionTimeout,
long readTimeout,
long writeTimeout,
Map<String,String> properties)
Base constructor for
AbstractEmailConnection implementations. |
AbstractEmailConnection(EmailProtocol protocol,
String username,
String password,
String host,
String port,
long connectionTimeout,
long readTimeout,
long writeTimeout,
Map<String,String> properties,
org.mule.runtime.api.tls.TlsContextFactory tlsContextFactory)
Base constructor for
AbstractEmailConnection implementations that aims to be secured by TLS. |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
disconnect()
disconnects the internal client used by the
AbstractEmailConnection instance. |
javax.mail.Session |
getSession() |
abstract org.mule.runtime.api.connection.ConnectionValidationResult |
validate()
Checks if the current
AbstractEmailConnection instance is valid or not. |
public static final String PASSWORD_NO_USERNAME_ERROR
public static final String USERNAME_NO_PASSWORD_ERROR
protected final EmailProtocol protocol
protected final javax.mail.Session session
public AbstractEmailConnection(EmailProtocol protocol, String username, String password, String host, String port, long connectionTimeout, long readTimeout, long writeTimeout, Map<String,String> properties) throws EmailConnectionException
AbstractEmailConnection implementations.protocol - the protocol used to send mails.username - the username to establish connection with the mail server.password - the password corresponding to the usernamehost - the host name of the mail server.port - the port number of the mail server.connectionTimeout - the socket connection timeoutreadTimeout - the socket read timeoutwriteTimeout - the socket write timeoutproperties - the custom properties added to configure the session.EmailConnectionExceptionpublic AbstractEmailConnection(EmailProtocol protocol, String username, String password, String host, String port, long connectionTimeout, long readTimeout, long writeTimeout, Map<String,String> properties, org.mule.runtime.api.tls.TlsContextFactory tlsContextFactory) throws EmailConnectionException
AbstractEmailConnection implementations that aims to be secured by TLS.protocol - the protocol used to send mails.username - the username to establish connection with the mail server.password - the password corresponding to the usernamehost - the host name of the mail server.port - the port number of the mail server.connectionTimeout - the socket connection timeoutreadTimeout - the socket read timeoutwriteTimeout - the socket write timeoutproperties - the custom properties added to configure the session.tlsContextFactory - the tls context factory for creating the context to secure the connectionEmailConnectionExceptionpublic javax.mail.Session getSession()
Session used by the connection.public abstract void disconnect()
AbstractEmailConnection instance.public abstract org.mule.runtime.api.connection.ConnectionValidationResult validate()
AbstractEmailConnection instance is valid or not.ConnectionValidationResult indicating if the connection is valid or not.Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.