Class AbstractHandler<T extends RestfulGateway,​R extends RequestBody,​M extends MessageParameters>

    • 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
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      CompletableFuture<Void> closeAsync()  
      protected CompletableFuture<Void> closeHandlerAsync()  
      protected void respondAsLeader​(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx, RoutedRequest routedRequest, T gateway)  
      protected abstract CompletableFuture<Void> respondToRequest​(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx, org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpRequest httpRequest, HandlerRequest<R> handlerRequest, T gateway)
      Respond to the given HandlerRequest.
      • 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 interface org.apache.flink.util.AutoCloseableAsync

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

        handlerAdded, handlerRemoved
    • Field Detail

      • log

        protected final org.slf4j.Logger log
      • MAPPER

        protected static final org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper MAPPER
    • Method Detail

      • closeAsync

        public final CompletableFuture<Void> closeAsync()
        Specified by:
        closeAsync in interface org.apache.flink.util.AutoCloseableAsync
      • respondToRequest

        protected abstract CompletableFuture<Void> respondToRequest​(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx,
                                                                    org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpRequest httpRequest,
                                                                    HandlerRequest<R> handlerRequest,
                                                                    T gateway)
                                                             throws RestHandlerException
        Respond to the given HandlerRequest.
        Parameters:
        ctx - channel handler context to write the response
        httpRequest - original http request
        handlerRequest - typed handler request
        gateway - leader gateway
        Returns:
        Future which is completed once the request has been processed
        Throws:
        RestHandlerException - if an exception occurred while responding