Class HttpStreamsClientHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
software.amazon.awssdk.http.nio.netty.internal.nrs.HttpStreamsClientHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
,io.netty.channel.ChannelOutboundHandler
public class HttpStreamsClientHandler
extends io.netty.channel.ChannelDuplexHandler
Handler that converts written
StreamedHttpRequest
messages into HttpRequest
messages
followed by HttpContent
messages and reads HttpResponse
messages followed by
HttpContent
messages and produces StreamedHttpResponse
messages.
This allows request and response bodies to be handled using reactive streams.
There are two types of messages that this handler accepts for writing, StreamedHttpRequest
and
FullHttpRequest
. Writing any other messages may potentially lead to HTTP message mangling.
There are two types of messages that this handler will send down the chain, StreamedHttpResponse
,
and FullHttpResponse
. If ChannelOption.AUTO_READ
is false for the channel,
then any StreamedHttpResponse
messages must be subscribed to consume the body, otherwise
it's possible that no read will be done of the messages.
As long as messages are returned in the order that they arrive, this handler implicitly supports HTTP
pipelining.
This class contains source imported from https://github.com/playframework/netty-reactive-streams,
licensed under the Apache License 2.0, available at the time of the fork (1/31/2020) here:
https://github.com/playframework/netty-reactive-streams/blob/master/LICENSE.txt
All original source licensed under the Apache License 2.0 by playframework. All modifications are
licensed under the Apache License 2.0 by Amazon Web Services.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
channelRead
(io.netty.channel.ChannelHandlerContext ctx, Object msg) void
channelReadComplete
(io.netty.channel.ChannelHandlerContext ctx) void
close
(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise future) void
write
(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, connect, deregister, disconnect, flush, read
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
handlerAdded, handlerRemoved, isSharable
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Constructor Details
-
HttpStreamsClientHandler
public HttpStreamsClientHandler()
-
-
Method Details
-
close
public void close(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise future) throws Exception - Specified by:
close
in interfaceio.netty.channel.ChannelOutboundHandler
- Overrides:
close
in classio.netty.channel.ChannelDuplexHandler
- Throws:
Exception
-
channelRead
- Specified by:
channelRead
in interfaceio.netty.channel.ChannelInboundHandler
- Throws:
Exception
-
channelReadComplete
- Specified by:
channelReadComplete
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelReadComplete
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-
write
public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) throws Exception - Specified by:
write
in interfaceio.netty.channel.ChannelOutboundHandler
- Overrides:
write
in classio.netty.channel.ChannelDuplexHandler
- Throws:
Exception
-