Class SmtpRequestEncoder

All Implemented Interfaces:
ChannelHandler, ChannelOutboundHandler

@UnstableApi public final class SmtpRequestEncoder extends MessageToMessageEncoder<java.lang.Object>
Encoder for SMTP requests.
  • Field Details

    • CRLF_SHORT

      private static final int CRLF_SHORT
      See Also:
    • SP

      private static final byte SP
      See Also:
    • DOT_CRLF_BUFFER

      private static final ByteBuf DOT_CRLF_BUFFER
    • contentExpected

      private boolean contentExpected
  • Constructor Details

    • SmtpRequestEncoder

      public SmtpRequestEncoder()
  • Method Details

    • acceptOutboundMessage

      public boolean acceptOutboundMessage(java.lang.Object msg) throws java.lang.Exception
      Description copied from class: MessageToMessageEncoder
      Returns true if the given message should be handled. If false it will be passed to the next ChannelOutboundHandler in the ChannelPipeline.
      Overrides:
      acceptOutboundMessage in class MessageToMessageEncoder<java.lang.Object>
      Throws:
      java.lang.Exception
    • encode

      protected void encode(ChannelHandlerContext ctx, java.lang.Object msg, java.util.List<java.lang.Object> out) throws java.lang.Exception
      Description copied from class: MessageToMessageEncoder
      Encode from one message to an other. This method will be called for each written message that can be handled by this encoder.
      Specified by:
      encode in class MessageToMessageEncoder<java.lang.Object>
      Parameters:
      ctx - the ChannelHandlerContext which this MessageToMessageEncoder belongs to
      msg - the message to encode to an other one
      out - the List into which the encoded msg should be added needs to do some kind of aggregation
      Throws:
      java.lang.Exception - is thrown if an error occurs
    • writeParameters

      private static void writeParameters(java.util.List<java.lang.CharSequence> parameters, ByteBuf out, boolean commandNotEmpty)