java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.handler.codec.ByteToMessageDecoder
io.netty.handler.ssl.SslClientHelloHandler<T>
io.netty.handler.ssl.AbstractSniHandler<io.netty.handler.ssl.SslContext>
io.netty.handler.ssl.SniHandler
org.infinispan.server.router.router.impl.hotrod.handlers.SniRouteHandler
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, io.netty.channel.ChannelOutboundHandler

public class SniRouteHandler extends io.netty.handler.ssl.SniHandler
Handler responsible for routing requests to proper backend based on SNI Host Name.
Author:
Sebastian Ɓaskawiec
  • Nested Class Summary

    Nested classes/interfaces inherited from class io.netty.handler.codec.ByteToMessageDecoder

    io.netty.handler.codec.ByteToMessageDecoder.Cumulator

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

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

    Fields inherited from class io.netty.handler.ssl.SniHandler

    mapping

    Fields inherited from class io.netty.handler.codec.ByteToMessageDecoder

    COMPOSITE_CUMULATOR, MERGE_CUMULATOR
  • Constructor Summary

    Constructors
    Constructor
    Description
    SniRouteHandler(io.netty.util.DomainNameMapping<? extends io.netty.handler.ssl.SslContext> mapping, RoutingTable routingTable)
    Creates new SniRouteHandler based on SNI Domain mapping and the RoutingTable.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    decode(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf in, List<Object> out)
     
    boolean
    Return true if handshake was successful.

    Methods inherited from class io.netty.handler.ssl.SniHandler

    hostname, lookup, newSslHandler, onLookupComplete, replaceHandler, sslContext

    Methods inherited from class io.netty.handler.ssl.AbstractSniHandler

    lookup, onLookupComplete

    Methods inherited from class io.netty.handler.ssl.SslClientHelloHandler

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

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

    actualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggered

    Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

    channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught

    Methods inherited from class io.netty.channel.ChannelHandlerAdapter

    ensureNotSharable, handlerAdded, isSharable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.netty.channel.ChannelHandler

    handlerAdded, handlerRemoved
  • Constructor Details

    • SniRouteHandler

      public SniRouteHandler(io.netty.util.DomainNameMapping<? extends io.netty.handler.ssl.SslContext> mapping, RoutingTable routingTable)
      Creates new SniRouteHandler based on SNI Domain mapping and the RoutingTable.
      Parameters:
      mapping - SNI Host Name mapping.
      routingTable - The RoutingTable for supplying the Routes.
  • Method Details

    • decode

      protected void decode(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf in, List<Object> out) throws Exception
      Overrides:
      decode in class io.netty.handler.ssl.SslClientHelloHandler<io.netty.handler.ssl.SslContext>
      Throws:
      Exception
    • isHandShaked

      public boolean isHandShaked()
      Return true if handshake was successful.