Interface Http2ConnectionEncoder
- All Superinterfaces:
AutoCloseable, Closeable, Http2DataWriter, Http2FrameWriter
- All Known Implementing Classes:
CompressorHttp2ConnectionEncoder, DecoratingHttp2ConnectionEncoder, DefaultHttp2ConnectionEncoder, StreamBufferingEncoder
Handler for outbound HTTP/2 traffic.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Http2FrameWriter
Http2FrameWriter.Configuration -
Method Summary
Modifier and TypeMethodDescriptionProvides direct access to the underlying connection.Provides the remote flow controller for managing outbound traffic.Provides direct access to the underlying frame writer object.voidlifecycleManager(Http2LifecycleManager lifecycleManager) Sets the lifecycle manager.Gets the local settings on the top of the queue that has been sent but not ACKed.voidremoteSettings(Http2Settings settings) Sets the settings for the remote endpoint of the HTTP/2 connection.writeFrame(ChannelHandlerContext ctx, byte frameType, int streamId, Http2Flags flags, ByteBuf payload, ChannelPromise promise) Writes the given data to the internalHttp2FrameWriterwithout performing any state checks on the connection/stream.Methods inherited from interface Http2DataWriter
writeDataModifier and TypeMethodDescriptionwriteData(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endStream, ChannelPromise promise) Writes aDATAframe to the remote endpoint.Methods inherited from interface Http2FrameWriter
close, configuration, writeGoAway, writeHeaders, writeHeaders, writePing, writePriority, writePushPromise, writeRstStream, writeSettings, writeSettingsAck, writeWindowUpdateModifier and TypeMethodDescriptionvoidclose()Closes this writer and frees any allocated resources.Get the configuration related elements for thisHttp2FrameWriterwriteGoAway(ChannelHandlerContext ctx, int lastStreamId, long errorCode, ByteBuf debugData, ChannelPromise promise) Writes a GO_AWAY frame to the remote endpoint.writeHeaders(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endStream, ChannelPromise promise) Writes a HEADERS frame to the remote endpoint.writeHeaders(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int streamDependency, short weight, boolean exclusive, int padding, boolean endStream, ChannelPromise promise) Writes a HEADERS frame with priority specified to the remote endpoint.writePing(ChannelHandlerContext ctx, boolean ack, long data, ChannelPromise promise) Writes a PING frame to the remote endpoint.writePriority(ChannelHandlerContext ctx, int streamId, int streamDependency, short weight, boolean exclusive, ChannelPromise promise) Writes a PRIORITY frame to the remote endpoint.writePushPromise(ChannelHandlerContext ctx, int streamId, int promisedStreamId, Http2Headers headers, int padding, ChannelPromise promise) Writes a PUSH_PROMISE frame to the remote endpoint.writeRstStream(ChannelHandlerContext ctx, int streamId, long errorCode, ChannelPromise promise) Writes a RST_STREAM frame to the remote endpoint.writeSettings(ChannelHandlerContext ctx, Http2Settings settings, ChannelPromise promise) Writes a SETTINGS frame to the remote endpoint.writeSettingsAck(ChannelHandlerContext ctx, ChannelPromise promise) Writes a SETTINGS acknowledgment to the remote endpoint.writeWindowUpdate(ChannelHandlerContext ctx, int streamId, int windowSizeIncrement, ChannelPromise promise) Writes a WINDOW_UPDATE frame to the remote endpoint.
-
Method Details
-
lifecycleManager
Sets the lifecycle manager. Must be called as part of initialization before the encoder is used. -
connection
Http2Connection connection()Provides direct access to the underlying connection. -
flowController
Http2RemoteFlowController flowController()Provides the remote flow controller for managing outbound traffic. -
frameWriter
Http2FrameWriter frameWriter()Provides direct access to the underlying frame writer object. -
pollSentSettings
Http2Settings pollSentSettings()Gets the local settings on the top of the queue that has been sent but not ACKed. This may returnnull. -
remoteSettings
Sets the settings for the remote endpoint of the HTTP/2 connection.- Throws:
Http2Exception
-
writeFrame
ChannelFuture writeFrame(ChannelHandlerContext ctx, byte frameType, int streamId, Http2Flags flags, ByteBuf payload, ChannelPromise promise) Writes the given data to the internalHttp2FrameWriterwithout performing any state checks on the connection/stream.- Specified by:
writeFramein interfaceHttp2FrameWriter- Parameters:
ctx- the context to use for writing.frameType- the frame type identifier.streamId- the stream for which to send the frame.flags- the flags to write for this frame.payload- the payload to write for this frame. This will be released by this method.promise- the promise for the write.- Returns:
- the future for the write.
-