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 byte[] |
NEWLINE_BYTES |
| Constructor and Description |
|---|
HttpRequestHandler(Router apiRouter) |
| 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.MessageLite> |
sendMessageResponse(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpRequest req,
io.netty.handler.codec.http.HttpResponseStatus status,
T responseMsg,
io.protostuff.Schema<T> responseSchema) |
static <T extends com.google.protobuf.MessageLite> |
sendMessageResponse(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpRequest req,
io.netty.handler.codec.http.HttpResponseStatus status,
T responseMsg,
io.protostuff.Schema<T> responseSchema,
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
|
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 byte[] NEWLINE_BYTES
public HttpRequestHandler(Router apiRouter)
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.MessageLite> 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,
io.protostuff.Schema<T> responseSchema)
public static <T extends com.google.protobuf.MessageLite> 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,
io.protostuff.Schema<T> responseSchema,
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 © 2017 Space Applications Services. All rights reserved.