Class OAuth2MailTransport

java.lang.Object
com.atlassian.crowd.manager.mail.transport.MailTransport
com.atlassian.crowd.manager.mail.transport.OAuth2MailTransport

public class OAuth2MailTransport extends MailTransport
  • Constructor Details

  • Method Details

    • connectAndExecuteCallback

      public <T> T connectAndExecuteCallback(@Nonnull BiFunction<javax.mail.Transport,MailSessionWrapper,T> callback, @Nonnull SMTPServer smtpServer, PrintStream debugStream) throws MailSendException
      Description copied from class: MailTransport
      Opens a connection to an SMTP server, executes a callback and closes the connection.
      Specified by:
      connectAndExecuteCallback in class MailTransport
      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.