Class LegacySimpleServerHandshakeCodec

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
io.netty.handler.codec.ByteToMessageCodec<ControlMessage>
pt.unl.fct.di.novasys.babel2.channels.legacy.simpleServer.LegacySimpleServerHandshakeCodec
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, io.netty.channel.ChannelOutboundHandler

public class LegacySimpleServerHandshakeCodec extends io.netty.handler.codec.ByteToMessageCodec<ControlMessage>
Netty codec for encoding and decoding legacy control and handshake messages.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

    io.netty.channel.ChannelHandler.Sharable
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Magic number expected in legacy control message payloads.
    static final byte
    Discriminant byte identifying legacy control frames.
    static final io.netty.util.AsciiString
    ASCII attribute tag identifying the client magic number in legacy handshakes.
    static final int
    Byte length of MAGIC_NUMBER_TAG.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new LegacySimpleServerHandshakeCodec.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    decode(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf in, List<Object> out)
     
    protected void
    encode(io.netty.channel.ChannelHandlerContext ctx, ControlMessage msg, io.netty.buffer.ByteBuf out)
     

    Methods inherited from class io.netty.handler.codec.ByteToMessageCodec

    acceptOutboundMessage, channelInactive, channelRead, channelReadComplete, decodeLast, handlerAdded, handlerRemoved, write

    Methods inherited from class io.netty.channel.ChannelDuplexHandler

    bind, close, connect, deregister, disconnect, flush, read

    Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

    channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered

    Methods inherited from class io.netty.channel.ChannelHandlerAdapter

    ensureNotSharable, isSharable

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CONTROL_MESSAGE_CODE

      public static final byte CONTROL_MESSAGE_CODE
      Discriminant byte identifying legacy control frames.
      See Also:
    • CONTROL_MAGIC_NUMBER

      public static final int CONTROL_MAGIC_NUMBER
      Magic number expected in legacy control message payloads.
      See Also:
    • MAGIC_NUMBER_TAG

      public static final io.netty.util.AsciiString MAGIC_NUMBER_TAG
      ASCII attribute tag identifying the client magic number in legacy handshakes.
    • MAGIC_NUMBER_TAG_SIZE

      public static final int MAGIC_NUMBER_TAG_SIZE
      Byte length of MAGIC_NUMBER_TAG.
  • Constructor Details

    • LegacySimpleServerHandshakeCodec

      public LegacySimpleServerHandshakeCodec()
      Constructs a new LegacySimpleServerHandshakeCodec.
  • Method Details

    • encode

      protected void encode(io.netty.channel.ChannelHandlerContext ctx, ControlMessage msg, io.netty.buffer.ByteBuf out) throws Exception
      Specified by:
      encode in class io.netty.handler.codec.ByteToMessageCodec<ControlMessage>
      Throws:
      Exception
    • decode

      protected void decode(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf in, List<Object> out) throws Exception
      Specified by:
      decode in class io.netty.handler.codec.ByteToMessageCodec<ControlMessage>
      Throws:
      Exception