public class HttpRequestHandler
extends io.netty.channel.ChannelInboundHandlerAdapter
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpRequestHandler.ChunkedTransferStats |
| Modifier and Type | Field and Description |
|---|---|
static Object |
CONTENT_FINISHED_EVENT |
static io.netty.util.AttributeKey<AuthenticationToken> |
CTX_AUTH_TOKEN |
static io.netty.util.AttributeKey<HttpRequestHandler.ChunkedTransferStats> |
CTX_CHUNK_STATS |
static String |
HANDLER_NAME_CHUNKED_WRITER |
static String |
HANDLER_NAME_COMPRESSOR |
static byte[] |
NEWLINE_BYTES |
| Constructor and Description |
|---|
HttpRequestHandler(Router apiRouter,
WebConfig webConfig) |
| Modifier and Type | Method and Description |
|---|---|
void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
static <T extends com.google.protobuf.Message> |
sendMessageResponse(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpRequest req,
io.netty.handler.codec.http.HttpResponseStatus status,
T responseMsg) |
static <T extends com.google.protobuf.Message> |
sendMessageResponse(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpRequest req,
io.netty.handler.codec.http.HttpResponseStatus status,
T responseMsg,
boolean autoCloseOnError) |
static io.netty.channel.ChannelFuture |
sendPlainTextError(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpRequest req,
io.netty.handler.codec.http.HttpResponseStatus status) |
static io.netty.channel.ChannelFuture |
sendPlainTextError(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpRequest req,
io.netty.handler.codec.http.HttpResponseStatus status,
String msg) |
io.netty.channel.ChannelFuture |
sendRedirect(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpRequest req,
String newUri) |
static io.netty.channel.ChannelFuture |
sendResponse(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpRequest req,
io.netty.handler.codec.http.HttpResponse response,
boolean autoCloseOnError) |
static io.netty.channel.ChannelFuture |
startChunkedTransfer(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpRequest req,
MediaType contentType,
String filename)
Sends base HTTP response indicating the use of chunked transfer encoding
NM 11-May-2018: We do not put the ChunckedWriteHandler on the pipeline because the input is already chunked.
|
static io.netty.channel.ChannelFuture |
writeChunk(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf buf) |
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredensureNotSharable, handlerAdded, handlerRemoved, isSharablepublic static final io.netty.util.AttributeKey<HttpRequestHandler.ChunkedTransferStats> CTX_CHUNK_STATS
public static final io.netty.util.AttributeKey<AuthenticationToken> CTX_AUTH_TOKEN
public static final Object CONTENT_FINISHED_EVENT
public static final String HANDLER_NAME_COMPRESSOR
public static final String HANDLER_NAME_CHUNKED_WRITER
public static final byte[] NEWLINE_BYTES
public void channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg)
throws Exception
channelRead in interface io.netty.channel.ChannelInboundHandlerchannelRead in class io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
throws Exception
exceptionCaught in interface io.netty.channel.ChannelHandlerexceptionCaught in interface io.netty.channel.ChannelInboundHandlerexceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic io.netty.channel.ChannelFuture sendRedirect(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpRequest req,
String newUri)
public static <T extends com.google.protobuf.Message> io.netty.channel.ChannelFuture sendMessageResponse(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpRequest req,
io.netty.handler.codec.http.HttpResponseStatus status,
T responseMsg)
public static <T extends com.google.protobuf.Message> io.netty.channel.ChannelFuture sendMessageResponse(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpRequest req,
io.netty.handler.codec.http.HttpResponseStatus status,
T responseMsg,
boolean autoCloseOnError)
public static io.netty.channel.ChannelFuture sendPlainTextError(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpRequest req,
io.netty.handler.codec.http.HttpResponseStatus status)
public static io.netty.channel.ChannelFuture sendPlainTextError(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpRequest req,
io.netty.handler.codec.http.HttpResponseStatus status,
String msg)
public static io.netty.channel.ChannelFuture sendResponse(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpRequest req,
io.netty.handler.codec.http.HttpResponse response,
boolean autoCloseOnError)
public static io.netty.channel.ChannelFuture startChunkedTransfer(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpRequest req,
MediaType contentType,
String filename)
public static io.netty.channel.ChannelFuture writeChunk(io.netty.channel.ChannelHandlerContext ctx,
io.netty.buffer.ByteBuf buf)
throws IOException
IOExceptionCopyright © 2018 Space Applications Services. All rights reserved.