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
HttpClientResponse
FullHttpResponse
: Converts it to a HttpClientResponse
with pre-populated content observable.HttpClientRequest
: Converts it to a HttpRequest
ByteBuf
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) |
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 |
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, read
channelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged
handlerAdded, handlerRemoved, isSharable
public 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 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
protected 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.ChannelInboundHandler
userEventTriggered
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
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause) throws java.lang.Exception
exceptionCaught
in interface io.netty.channel.ChannelHandler
exceptionCaught
in interface io.netty.channel.ChannelInboundHandler
exceptionCaught
in class io.netty.channel.ChannelInboundHandlerAdapter
java.lang.Exception