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
HttpServerRequestFullHttpRequest: Converts it to a HttpServerRequest with pre-populated content observable.HttpServerResponse: Converts it to a HttpResponseByteBuf 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, readchannelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredhandlerAdded, handlerRemoved, isSharablepublic 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.ChannelInboundHandlerchannelRead in class io.netty.channel.ChannelInboundHandlerAdapterjava.lang.Exceptionpublic 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.ChannelOutboundHandlerwrite in class io.netty.channel.ChannelDuplexHandlerjava.lang.Exceptionpublic void channelReadComplete(io.netty.channel.ChannelHandlerContext ctx)
throws java.lang.Exception
channelReadComplete in interface io.netty.channel.ChannelInboundHandlerchannelReadComplete in class io.netty.channel.ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
throws java.lang.Exception
channelInactive in interface io.netty.channel.ChannelInboundHandlerchannelInactive in class io.netty.channel.ChannelInboundHandlerAdapterjava.lang.Exception