Top Description Inners Fields Constructors Methods
io.netty5.handler.codec.http2

public Class DefaultHttp2ConnectionEncoder

extends Object
implements Http2ConnectionEncoder, Http2SettingsReceivedConsumer
Class Inheritance
All Implemented Interfaces
io.netty5.handler.codec.http2.Http2SettingsReceivedConsumer, io.netty5.handler.codec.http2.Http2ConnectionEncoder, io.netty5.handler.codec.http2.Http2FrameWriter, java.io.Closeable, java.lang.AutoCloseable, io.netty5.handler.codec.http2.Http2DataWriter
Annotations
@UnstableApi
Imports
io.netty5.buffer.Buffer, io.netty5.channel.Channel, .ChannelHandlerContext, .CoalescingBufferQueue, io.netty5.handler.codec.http.HttpStatusClass, io.netty5.handler.codec.http2.Http2CodecUtil.SimpleChannelPromiseAggregator, io.netty5.handler.codec.http2.headers.Http2Headers, io.netty5.util.concurrent.Future, .FutureListener, .Promise, io.netty5.util.internal.UnstableApi, java.util.ArrayDeque, .Queue

Default implementation of Http2ConnectionEncoder.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public abstract class
DefaultHttp2ConnectionEncoder.FlowControlledBase

Common base type for payloads to deliver via flow-control.

private class
DefaultHttp2ConnectionEncoder.FlowControlledData

Wrap a DATA frame so it can be written subject to flow-control.

private class
DefaultHttp2ConnectionEncoder.FlowControlledHeaders

Wrap headers so they can be written subject to flow-control.

Field Summary

Modifier and TypeField and Description
private final Http2Connection
private final Http2FrameWriter
private Http2LifecycleManager
private final Queue<Http2Settings>
private Queue<Http2Settings>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements io.netty5.handler.codec.http2.Http2FrameWriter.close.

Closes this writer and frees any allocated resources.
public Http2FrameWriter.Configuration
configuration()

Implements io.netty5.handler.codec.http2.Http2FrameWriter.configuration.

Get the configuration related elements for this Http2FrameWriter
public Http2Connection
connection()

Implements io.netty5.handler.codec.http2.Http2ConnectionEncoder.connection.

Provides direct access to the underlying connection.
public void
consumeReceivedSettings(Http2Settings settings)

Implements io.netty5.handler.codec.http2.Http2SettingsReceivedConsumer.consumeReceivedSettings.

Consume the most recently received but not yet ACKed settings.
public final Http2RemoteFlowController
flowController()

Implements io.netty5.handler.codec.http2.Http2ConnectionEncoder.flowController.

Provides the remote flow controller for managing outbound traffic.
public Http2FrameWriter
frameWriter()

Implements io.netty5.handler.codec.http2.Http2ConnectionEncoder.frameWriter.

Provides direct access to the underlying frame writer object.
public void
private void
public Http2Settings
pollSentSettings()

Implements io.netty5.handler.codec.http2.Http2ConnectionEncoder.pollSentSettings.

Gets the local settings on the top of the queue that has been sent but not ACKed.
public void
remoteSettings(Http2Settings settings)

Implements io.netty5.handler.codec.http2.Http2ConnectionEncoder.remoteSettings.

Sets the settings for the remote endpoint of the HTTP/2 connection.
private Http2Stream
requireStream(int streamId)

private static Future<Void>
sendHeaders(Http2FrameWriter frameWriter, ChannelHandlerContext ctx, int streamId, Http2Headers headers, final boolean hasPriority, int streamDependency, final short weight, boolean exclusive, final int padding, boolean endOfStream)

Write headers via Http2FrameWriter.

private static boolean
validateHeadersSentState(Http2Stream stream, Http2Headers headers, boolean isServer, boolean endOfStream)

public Future<Void>
writeData(final ChannelHandlerContext
the context to use for writing.
ctx
,
final int
the stream for which to send the frame.
streamId
,
Buffer
the payload of the frame. This will be released by this method.
data
,
int
additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive). A 1 byte padding is encoded as just the pad length field with value 0. A 256 byte padding is encoded as the pad length field with value 255 and 255 padding bytes appended to the end of the frame.
padding
,
final boolean
indicates if this is the last frame to be sent for the stream.
endOfStream
)

Implements io.netty5.handler.codec.http2.Http2DataWriter.writeData.

Writes a DATA frame to the remote endpoint.
public Future<Void>
writeFrame(ChannelHandlerContext
the context to use for writing.
ctx
,
byte
the frame type identifier.
frameType
,
int
the stream for which to send the frame.
streamId
,
Http2Flags
the flags to write for this frame.
flags
,
Buffer
the payload to write for this frame. This will be released by this method.
payload
)

Implements io.netty5.handler.codec.http2.Http2ConnectionEncoder.writeFrame.

Writes the given data to the internal Http2FrameWriter without performing any state checks on the connection/stream.
public Future<Void>
writeGoAway(ChannelHandlerContext
the context to use for writing.
ctx
,
int
the last known stream of this endpoint.
lastStreamId
,
long
the error code, if the connection was abnormally terminated.
errorCode
,
Buffer
application-defined debug data. This will be released by this method.
debugData
)

Implements io.netty5.handler.codec.http2.Http2FrameWriter.writeGoAway.

Writes a GO_AWAY frame to the remote endpoint.
public Future<Void>
writeHeaders(ChannelHandlerContext
the context to use for writing.
ctx
,
int
the stream for which to send the frame.
streamId
,
Http2Headers
the headers to be sent.
headers
,
int
additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).
padding
,
boolean
indicates if this is the last frame to be sent for the stream.
endStream
)

Implements io.netty5.handler.codec.http2.Http2FrameWriter.writeHeaders.

Writes a HEADERS frame to the remote endpoint.
public Future<Void>
writeHeaders(final ChannelHandlerContext
the context to use for writing.
ctx
,
final int
the stream for which to send the frame.
streamId
,
final Http2Headers
the headers to be sent.
headers
,
final int
the stream on which this stream should depend, or 0 if it should depend on the connection.
streamDependency
,
final short
the weight for this stream.
weight
,
final boolean
whether this stream should be the exclusive dependant of its parent.
exclusive
,
final int
additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).
padding
,
final boolean
indicates if this is the last frame to be sent for the stream.
endOfStream
)

Implements io.netty5.handler.codec.http2.Http2FrameWriter.writeHeaders.

Writes a HEADERS frame with priority specified to the remote endpoint.
private Future<Void>
writeHeaders0(final ChannelHandlerContext ctx, final int streamId, final Http2Headers headers, final boolean hasPriority, final int streamDependency, final short weight, final boolean exclusive, final int padding, final boolean endOfStream)

public Future<Void>
writePing(ChannelHandlerContext
the context to use for writing.
ctx
,
boolean
indicates whether this is an ack of a PING frame previously received from the remote endpoint.
ack
,
long
the payload of the frame.
data
)

Implements io.netty5.handler.codec.http2.Http2FrameWriter.writePing.

Writes a PING frame to the remote endpoint.
public Future<Void>
writePriority(ChannelHandlerContext
the context to use for writing.
ctx
,
int
the stream for which to send the frame.
streamId
,
int
the stream on which this stream should depend, or 0 if it should depend on the connection.
streamDependency
,
short
the weight for this stream.
weight
,
boolean
whether this stream should be the exclusive dependant of its parent.
exclusive
)

Implements io.netty5.handler.codec.http2.Http2FrameWriter.writePriority.

Writes a PRIORITY frame to the remote endpoint.
public Future<Void>
writePushPromise(ChannelHandlerContext
the context to use for writing.
ctx
,
int
the stream for which to send the frame.
streamId
,
int
the ID of the promised stream.
promisedStreamId
,
Http2Headers
the headers to be sent.
headers
,
int
additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).
padding
)

Implements io.netty5.handler.codec.http2.Http2FrameWriter.writePushPromise.

Writes a PUSH_PROMISE frame to the remote endpoint.
public Future<Void>
writeRstStream(ChannelHandlerContext
the context to use for writing.
ctx
,
int
the stream for which to send the frame.
streamId
,
long
the error code indicating the nature of the failure.
errorCode
)

Implements io.netty5.handler.codec.http2.Http2FrameWriter.writeRstStream.

Writes a RST_STREAM frame to the remote endpoint.
public Future<Void>
writeSettings(ChannelHandlerContext
the context to use for writing.
ctx
,
Http2Settings
the settings to be sent.
settings
)

Implements io.netty5.handler.codec.http2.Http2FrameWriter.writeSettings.

Writes a SETTINGS frame to the remote endpoint.
public Future<Void>
writeSettingsAck(ChannelHandlerContext
the context to use for writing.
ctx
)

Implements io.netty5.handler.codec.http2.Http2FrameWriter.writeSettingsAck.

Writes a SETTINGS acknowledgment to the remote endpoint.
public Future<Void>
writeWindowUpdate(ChannelHandlerContext
the context to use for writing.
ctx
,
int
the stream for which to send the frame.
streamId
,
int
the number of bytes by which the local inbound flow control window is increasing.
windowSizeIncrement
)

Implements io.netty5.handler.codec.http2.Http2FrameWriter.writeWindowUpdate.

Writes a WINDOW_UPDATE frame to the remote endpoint.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait