Class StompSubframeEncoder

All Implemented Interfaces:
ChannelHandler, ChannelOutboundHandler

public class StompSubframeEncoder extends MessageToMessageEncoder<StompSubframe>
Encodes a StompFrame or a StompSubframe into a ByteBuf.
  • Constructor Details

    • StompSubframeEncoder

      public StompSubframeEncoder()
  • Method Details

    • encode

      protected void encode(ChannelHandlerContext ctx, StompSubframe msg, List<Object> out) throws 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<StompSubframe>
      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:
      Exception - is thrown if an error occurs
    • convertFullFrame

      protected Object convertFullFrame(StompFrame original, ByteBuf encoded)
      An extension method to convert a STOMP encoded buffer to a different message type based on an original StompFrame full frame.

      By default an encoded buffer is returned as is.

    • convertHeadersSubFrame

      protected Object convertHeadersSubFrame(StompHeadersSubframe original, ByteBuf encoded)
      An extension method to convert a STOMP encoded buffer to a different message type based on an original StompHeadersSubframe headers sub frame.

      By default an encoded buffer is returned as is.

    • convertContentSubFrame

      protected Object convertContentSubFrame(StompContentSubframe original, ByteBuf encoded)
      An extension method to convert a STOMP encoded buffer to a different message type based on an original StompHeadersSubframe content sub frame.

      By default an encoded buffer is returned as is.

    • headersSubFrameSize

      protected int headersSubFrameSize(StompHeadersSubframe headersSubframe)
      Returns a heuristic size for headers (32 bytes per header line) + (2 bytes for colon and eol) + (additional command buffer).