public class ClientRequestResponseConverter
extends io.netty.channel.ChannelDuplexHandler
HttpClient to convert netty's http request/response objects to HttpClient's
request/response objects. It handles the following message types:
HttpResponse: Converts it to HttpClientResponse HttpContent: Converts it to the content of the previously generated
HttpClientResponseFullHttpResponse: Converts it to a HttpClientResponse with pre-populated content observable.HttpClientRequest: Converts it to a HttpRequestByteBuf to an HttpContent| Modifier and Type | Field and Description |
|---|---|
static java.io.IOException |
CONN_CLOSE_BEFORE_RESPONSE |
static io.netty.util.AttributeKey<java.lang.Boolean> |
DISCARD_CONNECTION |
static io.netty.util.AttributeKey<java.lang.Long> |
KEEP_ALIVE_TIMEOUT_MILLIS_ATTR
This attribute stores the value of any dynamic idle timeout value sent via an HTTP keep alive header.
|
| Constructor and Description |
|---|
ClientRequestResponseConverter(MetricEventsSubject<ClientMetricsEvent<?>> eventsSubject) |
ClientRequestResponseConverter(MetricEventsSubject<ClientMetricsEvent<?>> eventsSubject,
long subscriptionTimeout,
java.util.concurrent.TimeUnit subscriptionTimeoutUnit) |
| 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 |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Throwable cause) |
void |
handlerAdded(io.netty.channel.ChannelHandlerContext ctx) |
void |
userEventTriggered(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object evt) |
void |
write(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg,
io.netty.channel.ChannelPromise promise) |
protected void |
writeLastHttpContent(io.netty.channel.ChannelHandlerContext ctx,
MultipleFutureListener allWritesListener,
HttpClientRequest<?> rxRequest,
io.reactivex.netty.protocol.http.client.ClientRequestResponseConverter.ResponseState responseState) |
bind, close, connect, deregister, disconnect, flush, readchannelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChangedpublic static final io.netty.util.AttributeKey<java.lang.Long> KEEP_ALIVE_TIMEOUT_MILLIS_ATTR
HttpClientResponse.getKeepAliveTimeoutSeconds()public static final io.netty.util.AttributeKey<java.lang.Boolean> DISCARD_CONNECTION
public static final java.io.IOException CONN_CLOSE_BEFORE_RESPONSE
public ClientRequestResponseConverter(MetricEventsSubject<ClientMetricsEvent<?>> eventsSubject)
public ClientRequestResponseConverter(MetricEventsSubject<ClientMetricsEvent<?>> eventsSubject, long subscriptionTimeout, java.util.concurrent.TimeUnit subscriptionTimeoutUnit)
public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
throws java.lang.Exception
handlerAdded in interface io.netty.channel.ChannelHandlerhandlerAdded in class io.netty.channel.ChannelHandlerAdapterjava.lang.Exceptionpublic 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.Exceptionprotected void writeLastHttpContent(io.netty.channel.ChannelHandlerContext ctx,
MultipleFutureListener allWritesListener,
HttpClientRequest<?> rxRequest,
io.reactivex.netty.protocol.http.client.ClientRequestResponseConverter.ResponseState responseState)
public void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object evt)
throws java.lang.Exception
userEventTriggered in interface io.netty.channel.ChannelInboundHandleruserEventTriggered 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.Exceptionpublic void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Throwable cause)
throws java.lang.Exception
exceptionCaught in interface io.netty.channel.ChannelHandlerexceptionCaught in interface io.netty.channel.ChannelInboundHandlerexceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapterjava.lang.Exception