Class Transaction

java.lang.Object
com.mimecast.robin.smtp.transaction.Transaction
All Implemented Interfaces:
Serializable

public class Transaction extends Object implements Serializable
Transaction.

This provides a container for SMTP transaction details.

See Also:
  • Field Details

    • log

      private static final org.apache.logging.log4j.Logger log
    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • command

      private final String command
      Records the SMTP command of this transaction.
    • payload

      private String payload
      Records the SMTP command payload if any.
    • response

      private String response
      Records the SMTP response if any.
    • error

      private boolean error
      Records the SMTP response is in error.
  • Constructor Details

    • Transaction

      public Transaction(String command)
      Constructor.
      Parameters:
      command - Command string.
  • Method Details

    • getCommand

      public String getCommand()
      Gets the SMTP command of this transaction.
      Returns:
      Command string.
    • setPayload

      public Transaction setPayload(String payload)
      Sets the SMTP command payload.
      Parameters:
      payload - Payload string.
      Returns:
      Self.
    • getPayload

      public String getPayload()
      Gets the SMTP command payload.
      Returns:
      Payload string.
    • getAddress

      public String getAddress()
      Gets the SMTP command address if any.
      Returns:
      Payload string.
    • setResponse

      public Transaction setResponse(String response)
      Sets the SMTP command response.
      Parameters:
      response - Response string.
      Returns:
      Self.
    • getResponse

      public String getResponse()
      Gets the SMTP command response.
      Returns:
      Response string.
    • getResponseCode

      public String getResponseCode()
      Gets the SMTP command response code (first three characters).

      Returns 102 if response length too short.

      Returns:
      Response code string.
    • getResponseString

      public String getResponseString()
      Gets the SMTP command response as a single line string.
      Returns:
      Response string.
    • setError

      public Transaction setError(boolean error)
      Sets the SMTP command error.
      Parameters:
      error - Error enablement.
      Returns:
      Self
    • isError

      public boolean isError()
      Is the SMTP command in error.
      Returns:
      Is error boolean.
    • toString

      public String toString()
      Transactions as string.
      Overrides:
      toString in class Object
      Returns:
      Transaction string.