public class ServerRequestResponseConverter
extends io.netty.channel.ChannelDuplexHandler
HttpServer
to convert netty's http request/response objects to HttpServer
's
request/response objects. It handles the following message types:
HttpRequest
: Converts it to HttpServerRequest
HttpContent
: Converts it to the content of the previously generated
HttpServerRequest
FullHttpRequest
: Converts it to a HttpServerRequest
with pre-populated content observable.HttpServerResponse
: Converts it to a HttpResponse
ByteBuf
to an HttpContent
Modifier and Type | Field and Description |
---|---|
static java.io.IOException |
CONN_CLOSE_BEFORE_REQUEST_COMPLETE |
Constructor and Description |
---|
ServerRequestResponseConverter(MetricEventsSubject<ServerMetricsEvent<?>> eventsSubject,
long requestContentSubscriptionTimeoutMs) |
Modifier and Type | Method and Description |
---|---|
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg) |
void |
channelReadComplete(io.netty.channel.ChannelHandlerContext ctx) |
void |
write(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg,
io.netty.channel.ChannelPromise promise) |
bind, close, connect, deregister, disconnect, flush, read
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
handlerAdded, handlerRemoved, isSharable
public static final java.io.IOException CONN_CLOSE_BEFORE_REQUEST_COMPLETE
public ServerRequestResponseConverter(MetricEventsSubject<ServerMetricsEvent<?>> eventsSubject, long requestContentSubscriptionTimeoutMs)
public void channelRead(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg) throws java.lang.Exception
channelRead
in interface io.netty.channel.ChannelInboundHandler
channelRead
in class io.netty.channel.ChannelInboundHandlerAdapter
java.lang.Exception
public void write(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object msg, io.netty.channel.ChannelPromise promise) throws java.lang.Exception
write
in interface io.netty.channel.ChannelOutboundHandler
write
in class io.netty.channel.ChannelDuplexHandler
java.lang.Exception
public void channelReadComplete(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception
channelReadComplete
in interface io.netty.channel.ChannelInboundHandler
channelReadComplete
in class io.netty.channel.ChannelInboundHandlerAdapter
java.lang.Exception
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception
channelInactive
in interface io.netty.channel.ChannelInboundHandler
channelInactive
in class io.netty.channel.ChannelInboundHandlerAdapter
java.lang.Exception