Class HttpRequestHandler
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.HttpObject>
org.apache.flink.runtime.webmonitor.HttpRequestHandler
- All Implemented Interfaces:
org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler,org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler
@Sharable
public class HttpRequestHandler
extends org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler<org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpObject>
Simple code which handles all HTTP requests from the user, and passes them to the Router handler
directly if they do not involve file upload requests. If a file is required to be uploaded, it
handles the upload, and in the http request to the next handler, passes the name of the file to
the next handler.
-
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelRead0(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx, org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpObject msg) voidchannelUnregistered(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx) static voidcheckAndCreateUploadDir(File uploadDir) Checks whether the given directory exists and is writable.static voidlogExternalUploadDirDeletion(File uploadDir) Methods inherited from class org.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelReadMethods inherited from class org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Constructor Details
-
HttpRequestHandler
-
-
Method Details
-
channelUnregistered
public void channelUnregistered(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx) throws Exception - Specified by:
channelUnregisteredin interfaceorg.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler- Overrides:
channelUnregisteredin classorg.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-
channelRead0
public void channelRead0(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx, org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpObject msg) - Specified by:
channelRead0in classorg.apache.flink.shaded.netty4.io.netty.channel.SimpleChannelInboundHandler<org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpObject>
-
logExternalUploadDirDeletion
-
checkAndCreateUploadDir
Checks whether the given directory exists and is writable. If it doesn't exist this method will attempt to create it.- Parameters:
uploadDir- directory to check- Throws:
IOException- if the directory does not exist and cannot be created, or if the directory isn't writable
-