Class NoAuthenticationMailTransport
java.lang.Object
com.atlassian.crowd.manager.mail.transport.MailTransport
com.atlassian.crowd.manager.mail.transport.NoAuthenticationMailTransport
-
Field Summary
Fields inherited from class com.atlassian.crowd.manager.mail.transport.MailTransport
FORMAT_MAILER_AUTH_MECHANISMS, FORMAT_MAILER_SMTP_AUTH, FORMAT_MAILER_SMTP_CHECKSERVERIDENTITY, FORMAT_MAILER_SMTP_CONNECTIONTIMEOUT, FORMAT_MAILER_SMTP_HOST, FORMAT_MAILER_SMTP_PORT, FORMAT_MAILER_SMTP_STARTTLS_ENABLE, FORMAT_MAILER_SMTP_TIMEOUT, XOAUTH2
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> T
connectAndExecuteCallback
(BiFunction<javax.mail.Transport, MailSessionWrapper, T> callback, SMTPServer smtpServer, PrintStream debugStream) Opens a connection to an SMTP server, executes a callback and closes the connection.Methods inherited from class com.atlassian.crowd.manager.mail.transport.MailTransport
getCommonSessionProperties, getProtocol
-
Constructor Details
-
NoAuthenticationMailTransport
public NoAuthenticationMailTransport()
-
-
Method Details
-
connectAndExecuteCallback
public <T> T connectAndExecuteCallback(@Nonnull BiFunction<javax.mail.Transport, MailSessionWrapper, throws MailSendExceptionT> callback, @Nonnull SMTPServer smtpServer, PrintStream debugStream) Description copied from class:MailTransport
Opens a connection to an SMTP server, executes a callback and closes the connection.- Specified by:
connectAndExecuteCallback
in classMailTransport
- Type Parameters:
T
- type of the value returned by the callback.- Parameters:
callback
- executed after opening the connection to the SMTP server.smtpServer
- SMTP server configuration which is used to determine the host, port and other connection parameters.debugStream
- PrintStream to output debug information to. Can be null.- Returns:
- return value of the callback.
- Throws:
MailSendException
- if a connection to the SMTP server cannot be established.
-