Class RouterHandler

java.lang.Object
org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerAdapter
org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapter
org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler<org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpRequest>
org.apache.flink.runtime.rest.handler.router.RouterHandler
All Implemented Interfaces:
org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler, org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler

public class RouterHandler extends org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler<org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpRequest>
Inbound handler that converts HttpRequest to Routed and passes Routed to the matched handler.

This class replaces the standard error response to be identical with those sent by the AbstractRestHandler.

This class is based on: https://github.com/sinetja/netty-router/blob/1.10/src/main/java/io/netty/handler/codec/http/router/AbstractHandler.java https://github.com/sinetja/netty-router/blob/1.10/src/main/java/io/netty/handler/codec/http/router/Handler.java

  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler

    org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler.Sharable
  • Constructor Summary

    Constructors
    Constructor
    Description
    RouterHandler(Router router, Map<String,String> responseHeaders)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    channelRead0(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext channelHandlerContext, org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpRequest httpRequest)
     
     

    Methods inherited from class org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler

    acceptInboundMessage, channelRead

    Methods inherited from class org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapter

    channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered

    Methods inherited from class org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerAdapter

    ensureNotSharable, handlerAdded, handlerRemoved, isSharable

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler

    handlerAdded, handlerRemoved
  • Constructor Details

  • Method Details

    • getName

      public String getName()
    • channelRead0

      protected void channelRead0(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext channelHandlerContext, org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpRequest httpRequest)
      Specified by:
      channelRead0 in class org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler<org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpRequest>