public class Http2FrameCodecBuilder extends AbstractHttp2ConnectionHandlerBuilder<Http2FrameCodec,Http2FrameCodecBuilder>
Http2FrameCodec
.Modifier | Constructor and Description |
---|---|
protected |
Http2FrameCodecBuilder()
Allows overriding behavior of existing builder.
|
Modifier and Type | Method and Description |
---|---|
Http2FrameCodecBuilder |
autoAckPingFrame(boolean autoAckPingFrame)
Determine if PING frame should automatically be acknowledged or not.
|
Http2FrameCodecBuilder |
autoAckSettingsFrame(boolean autoAckSettings)
Determine if settings frame should automatically be acknowledged and applied.
|
Http2FrameCodec |
build()
Build a
Http2FrameCodec object. |
protected Http2FrameCodec |
build(Http2ConnectionDecoder decoder,
Http2ConnectionEncoder encoder,
Http2Settings initialSettings)
Implement this method to create a new
Http2ConnectionHandler or its subtype instance. |
int |
decoderEnforceMaxConsecutiveEmptyDataFrames()
Returns the maximum number of consecutive empty DATA frames (without end_of_stream flag) that are allowed before
the connection is closed.
|
Http2FrameCodecBuilder |
decoderEnforceMaxConsecutiveEmptyDataFrames(int maxConsecutiveEmptyFrames)
Sets the maximum number of consecutive empty DATA frames (without end_of_stream flag) that are allowed before
the connection is closed.
|
Http2FrameCodecBuilder |
decoderEnforceMaxRstFramesPerWindow(int maxRstFramesPerWindow,
int secondsPerWindow)
Sets the maximum number RST frames that are allowed per window before
the connection is closed.
|
Http2FrameCodecBuilder |
decoupleCloseAndGoAway(boolean decoupleCloseAndGoAway)
Determine if the
ChannelOutboundInvoker.close() should be coupled with goaway and graceful close. |
boolean |
encoderEnforceMaxConcurrentStreams()
Returns if the encoder should queue frames if the maximum number of concurrent streams
would otherwise be exceeded.
|
Http2FrameCodecBuilder |
encoderEnforceMaxConcurrentStreams(boolean encoderEnforceMaxConcurrentStreams)
Sets if the encoder should queue frames if the maximum number of concurrent streams
would otherwise be exceeded.
|
int |
encoderEnforceMaxQueuedControlFrames()
Returns the maximum number of queued control frames that are allowed before the connection is closed.
|
Http2FrameCodecBuilder |
encoderEnforceMaxQueuedControlFrames(int maxQueuedControlFrames)
Sets the maximum number of queued control frames that are allowed before the connection is closed.
|
Http2FrameCodecBuilder |
encoderIgnoreMaxHeaderListSize(boolean ignoreMaxHeaderListSize)
Sets if the SETTINGS_MAX_HEADER_LIST_SIZE
should be ignored when encoding headers.
|
Http2FrameCodecBuilder |
flushPreface(boolean flushPreface)
|
static Http2FrameCodecBuilder |
forClient()
Creates a builder for an HTTP/2 client.
|
static Http2FrameCodecBuilder |
forServer()
Creates a builder for an HTTP/2 server.
|
Http2FrameLogger |
frameLogger()
Returns the logger that is used for the encoder and decoder.
|
Http2FrameCodecBuilder |
frameLogger(Http2FrameLogger frameLogger)
Sets the logger that is used for the encoder and decoder.
|
long |
gracefulShutdownTimeoutMillis()
Returns the graceful shutdown timeout of the
Http2Connection in milliseconds. |
Http2FrameCodecBuilder |
gracefulShutdownTimeoutMillis(long gracefulShutdownTimeoutMillis)
Sets the graceful shutdown timeout of the
Http2Connection in milliseconds. |
Http2HeadersEncoder.SensitivityDetector |
headerSensitivityDetector()
Returns the
Http2HeadersEncoder.SensitivityDetector to use. |
Http2FrameCodecBuilder |
headerSensitivityDetector(Http2HeadersEncoder.SensitivityDetector headerSensitivityDetector)
Sets the
Http2HeadersEncoder.SensitivityDetector to use. |
Http2FrameCodecBuilder |
initialHuffmanDecodeCapacity(int initialHuffmanDecodeCapacity)
Deprecated.
|
Http2Settings |
initialSettings()
Sets the
Http2Settings to use for the initial connection settings exchange. |
Http2FrameCodecBuilder |
initialSettings(Http2Settings settings)
Sets the
Http2Settings to use for the initial connection settings exchange. |
boolean |
isServer()
Returns if
AbstractHttp2ConnectionHandlerBuilder.build() will to create a Http2Connection in server mode (true )
or client mode (false ). |
boolean |
isValidateHeaders()
Returns if HTTP headers should be validated according to
RFC 7540, 8.1.2.6.
|
int |
maxReservedStreams()
Get the maximum number of streams which can be in the reserved state at any given time.
|
Http2FrameCodecBuilder |
maxReservedStreams(int maxReservedStreams)
Set the maximum number of streams which can be in the reserved state at any given time.
|
Http2FrameCodecBuilder |
validateHeaders(boolean validateHeaders)
Sets if HTTP headers should be validated according to
RFC 7540, 8.1.2.6.
|
codec, connection, connection, decoder, decoupleCloseAndGoAway, encoder, flushPreface, frameListener, frameListener, isAutoAckPingFrame, isAutoAckSettingsFrame, promisedRequestVerifier, promisedRequestVerifier, self, server
protected Http2FrameCodecBuilder()
Users of this constructor are responsible for invoking AbstractHttp2ConnectionHandlerBuilder.server(boolean)
method or overriding
isServer()
method to give the builder information if the Http2Connection
(s) it creates are in
server or client mode.
AbstractHttp2ConnectionHandlerBuilder
public static Http2FrameCodecBuilder forClient()
public static Http2FrameCodecBuilder forServer()
public Http2Settings initialSettings()
AbstractHttp2ConnectionHandlerBuilder
Http2Settings
to use for the initial connection settings exchange.initialSettings
in class AbstractHttp2ConnectionHandlerBuilder<Http2FrameCodec,Http2FrameCodecBuilder>
public Http2FrameCodecBuilder initialSettings(Http2Settings settings)
AbstractHttp2ConnectionHandlerBuilder
Http2Settings
to use for the initial connection settings exchange.initialSettings
in class AbstractHttp2ConnectionHandlerBuilder<Http2FrameCodec,Http2FrameCodecBuilder>
public long gracefulShutdownTimeoutMillis()
AbstractHttp2ConnectionHandlerBuilder
Http2Connection
in milliseconds. Returns -1 if the
timeout is indefinite.public Http2FrameCodecBuilder gracefulShutdownTimeoutMillis(long gracefulShutdownTimeoutMillis)
AbstractHttp2ConnectionHandlerBuilder
Http2Connection
in milliseconds.public boolean isServer()
AbstractHttp2ConnectionHandlerBuilder
AbstractHttp2ConnectionHandlerBuilder.build()
will to create a Http2Connection
in server mode (true
)
or client mode (false
).isServer
in class AbstractHttp2ConnectionHandlerBuilder<Http2FrameCodec,Http2FrameCodecBuilder>
public int maxReservedStreams()
AbstractHttp2ConnectionHandlerBuilder
By default this value will be ignored on the server for local endpoint. This is because the RFC provides no way to explicitly communicate a limit to how many states can be in the reserved state, and instead relies on the peer to send RST_STREAM frames when they will be rejected.
maxReservedStreams
in class AbstractHttp2ConnectionHandlerBuilder<Http2FrameCodec,Http2FrameCodecBuilder>
public Http2FrameCodecBuilder maxReservedStreams(int maxReservedStreams)
AbstractHttp2ConnectionHandlerBuilder
maxReservedStreams
in class AbstractHttp2ConnectionHandlerBuilder<Http2FrameCodec,Http2FrameCodecBuilder>
public boolean isValidateHeaders()
AbstractHttp2ConnectionHandlerBuilder
isValidateHeaders
in class AbstractHttp2ConnectionHandlerBuilder<Http2FrameCodec,Http2FrameCodecBuilder>
public Http2FrameCodecBuilder validateHeaders(boolean validateHeaders)
AbstractHttp2ConnectionHandlerBuilder
validateHeaders
in class AbstractHttp2ConnectionHandlerBuilder<Http2FrameCodec,Http2FrameCodecBuilder>
public Http2FrameLogger frameLogger()
AbstractHttp2ConnectionHandlerBuilder
frameLogger
in class AbstractHttp2ConnectionHandlerBuilder<Http2FrameCodec,Http2FrameCodecBuilder>
Http2FrameLogger
if set, or null
if not set.public Http2FrameCodecBuilder frameLogger(Http2FrameLogger frameLogger)
AbstractHttp2ConnectionHandlerBuilder
frameLogger
in class AbstractHttp2ConnectionHandlerBuilder<Http2FrameCodec,Http2FrameCodecBuilder>
public boolean encoderEnforceMaxConcurrentStreams()
AbstractHttp2ConnectionHandlerBuilder
public Http2FrameCodecBuilder encoderEnforceMaxConcurrentStreams(boolean encoderEnforceMaxConcurrentStreams)
AbstractHttp2ConnectionHandlerBuilder
public int encoderEnforceMaxQueuedControlFrames()
AbstractHttp2ConnectionHandlerBuilder
0
means no protection is in place.public Http2FrameCodecBuilder encoderEnforceMaxQueuedControlFrames(int maxQueuedControlFrames)
AbstractHttp2ConnectionHandlerBuilder
0
means no protection should be applied.public Http2HeadersEncoder.SensitivityDetector headerSensitivityDetector()
AbstractHttp2ConnectionHandlerBuilder
Http2HeadersEncoder.SensitivityDetector
to use.public Http2FrameCodecBuilder headerSensitivityDetector(Http2HeadersEncoder.SensitivityDetector headerSensitivityDetector)
AbstractHttp2ConnectionHandlerBuilder
Http2HeadersEncoder.SensitivityDetector
to use.public Http2FrameCodecBuilder encoderIgnoreMaxHeaderListSize(boolean ignoreMaxHeaderListSize)
AbstractHttp2ConnectionHandlerBuilder
encoderIgnoreMaxHeaderListSize
in class AbstractHttp2ConnectionHandlerBuilder<Http2FrameCodec,Http2FrameCodecBuilder>
ignoreMaxHeaderListSize
- true
to ignore
SETTINGS_MAX_HEADER_LIST_SIZE.@Deprecated public Http2FrameCodecBuilder initialHuffmanDecodeCapacity(int initialHuffmanDecodeCapacity)
AbstractHttp2ConnectionHandlerBuilder
public Http2FrameCodecBuilder autoAckSettingsFrame(boolean autoAckSettings)
AbstractHttp2ConnectionHandlerBuilder
autoAckSettingsFrame
in class AbstractHttp2ConnectionHandlerBuilder<Http2FrameCodec,Http2FrameCodecBuilder>
public Http2FrameCodecBuilder autoAckPingFrame(boolean autoAckPingFrame)
AbstractHttp2ConnectionHandlerBuilder
autoAckPingFrame
in class AbstractHttp2ConnectionHandlerBuilder<Http2FrameCodec,Http2FrameCodecBuilder>
public Http2FrameCodecBuilder decoupleCloseAndGoAway(boolean decoupleCloseAndGoAway)
AbstractHttp2ConnectionHandlerBuilder
ChannelOutboundInvoker.close()
should be coupled with goaway and graceful close.decoupleCloseAndGoAway
in class AbstractHttp2ConnectionHandlerBuilder<Http2FrameCodec,Http2FrameCodecBuilder>
decoupleCloseAndGoAway
- true
to make ChannelOutboundInvoker.close()
directly close the underlying
transport, and not attempt graceful closure via GOAWAY.this
.public Http2FrameCodecBuilder flushPreface(boolean flushPreface)
AbstractHttp2ConnectionHandlerBuilder
Channel
becomes active or not.
Client may choose to opt-out from this automatic behavior and manage flush manually if it's ready to send request frames immediately after the preface. It may help to avoid unnecessary latency.
flushPreface
in class AbstractHttp2ConnectionHandlerBuilder<Http2FrameCodec,Http2FrameCodecBuilder>
flushPreface
- true
to automatically flush, false otherwise
.this
.public int decoderEnforceMaxConsecutiveEmptyDataFrames()
AbstractHttp2ConnectionHandlerBuilder
0
means no protection is in place.public Http2FrameCodecBuilder decoderEnforceMaxConsecutiveEmptyDataFrames(int maxConsecutiveEmptyFrames)
AbstractHttp2ConnectionHandlerBuilder
0
means no protection should be applied.public Http2FrameCodecBuilder decoderEnforceMaxRstFramesPerWindow(int maxRstFramesPerWindow, int secondsPerWindow)
AbstractHttp2ConnectionHandlerBuilder
0
for any of the parameters means no protection should be applied.public Http2FrameCodec build()
Http2FrameCodec
object.build
in class AbstractHttp2ConnectionHandlerBuilder<Http2FrameCodec,Http2FrameCodecBuilder>
protected Http2FrameCodec build(Http2ConnectionDecoder decoder, Http2ConnectionEncoder encoder, Http2Settings initialSettings)
AbstractHttp2ConnectionHandlerBuilder
Http2ConnectionHandler
or its subtype instance.
The return of this method will be subject to the following:
AbstractHttp2ConnectionHandlerBuilder.frameListener(Http2FrameListener)
will be set if not already set in the decoderAbstractHttp2ConnectionHandlerBuilder.gracefulShutdownTimeoutMillis(long)
will always be setbuild
in class AbstractHttp2ConnectionHandlerBuilder<Http2FrameCodec,Http2FrameCodecBuilder>
Copyright © 2008–2024 The Netty Project. All rights reserved.