Class HttpToHttp2ConnectionHandlerBuilder
java.lang.Object
io.netty.handler.codec.http2.AbstractHttp2ConnectionHandlerBuilder<HttpToHttp2ConnectionHandler, HttpToHttp2ConnectionHandlerBuilder>
io.netty.handler.codec.http2.HttpToHttp2ConnectionHandlerBuilder
public final class HttpToHttp2ConnectionHandlerBuilder
extends AbstractHttp2ConnectionHandlerBuilder<HttpToHttp2ConnectionHandler, HttpToHttp2ConnectionHandlerBuilder>
Builder which builds
HttpToHttp2ConnectionHandler objects.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Create a newHttp2ConnectionHandler.protected HttpToHttp2ConnectionHandlerbuild(Http2ConnectionDecoder decoder, Http2ConnectionEncoder encoder, Http2Settings initialSettings) Implement this method to create a newHttp2ConnectionHandleror its subtype instance.codec(Http2ConnectionDecoder decoder, Http2ConnectionEncoder encoder) Sets theHttp2ConnectionDecoderandHttp2ConnectionEncoderto use.connection(Http2Connection connection) Sets theHttp2Connectionto use.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.decoderEnforceMaxRstFramesPerWindow(int maxRstFramesPerWindow, int secondsPerWindow) Sets the maximum number RST frames that are allowed per window before the connection is closed.decoupleCloseAndGoAway(boolean decoupleCloseAndGoAway) Determine if theChannel.close()should be coupled with goaway and graceful close.encoderEnforceMaxConcurrentStreams(boolean encoderEnforceMaxConcurrentStreams) Sets if the encoder should queue frames if the maximum number of concurrent streams would otherwise be exceeded.encoderEnforceMaxRstFramesPerWindow(int maxRstFramesPerWindow, int secondsPerWindow) Sets the maximum number RST frames that are allowed per window before the connection is closed.encoderIgnoreMaxHeaderListSize(boolean encoderIgnoreMaxHeaderListSize) Sets if the SETTINGS_MAX_HEADER_LIST_SIZE should be ignored when encoding headers.flushPreface(boolean flushPreface) frameListener(Http2FrameListener frameListener) Sets the listener of inbound frames.frameLogger(Http2FrameLogger frameLogger) Sets the logger that is used for the encoder and decoder.gracefulShutdownTimeoutMillis(long gracefulShutdownTimeoutMillis) Sets the graceful shutdown timeout of theHttp2Connectionin milliseconds.headerSensitivityDetector(Http2HeadersEncoder.SensitivityDetector headerSensitivityDetector) Sets theHttp2HeadersEncoder.SensitivityDetectorto use.httpScheme(HttpScheme httpScheme) AddschemeinHttp2Headersif not already present.initialHuffmanDecodeCapacity(int initialHuffmanDecodeCapacity) Deprecated.initialSettings(Http2Settings settings) Sets theHttp2Settingsto use for the initial connection settings exchange.server(boolean isServer) Sets ifAbstractHttp2ConnectionHandlerBuilder.build()will to create aHttp2Connectionin server mode (true) or client mode (false).validateHeaders(boolean validateHeaders) Sets if HTTP headers should be validated according to RFC 7540, 8.1.2.6.validateRequiredPseudoHeaders(boolean validateRequiredPseudoHeaders) Sets if request and responseHEADERSthat omit a mandatory pseudo-header field are rejected, according to RFC 9113, 8.3.Methods inherited from class AbstractHttp2ConnectionHandlerBuilder
autoAckPingFrame, autoAckSettingsFrame, connection, decoder, decoderEnforceMaxConsecutiveEmptyDataFrames, decoderEnforceMaxSmallContinuationFrames, decoderEnforceMaxSmallContinuationFrames, decoupleCloseAndGoAway, encoder, encoderEnforceMaxConcurrentStreams, encoderEnforceMaxQueuedControlFrames, encoderEnforceMaxQueuedControlFrames, flushPreface, frameListener, frameLogger, gracefulShutdownTimeoutMillis, headerSensitivityDetector, initialSettings, isAutoAckPingFrame, isAutoAckSettingsFrame, isServer, isValidateHeaders, isValidateRequiredPseudoHeaders, maxReservedStreams, maxReservedStreams, promisedRequestVerifier, promisedRequestVerifier, selfModifier and TypeMethodDescriptionprotected HttpToHttp2ConnectionHandlerBuilderautoAckPingFrame(boolean autoAckPingFrame) Determine if PING frame should automatically be acknowledged or not.protected HttpToHttp2ConnectionHandlerBuilderautoAckSettingsFrame(boolean autoAckSettings) Determine if settings frame should automatically be acknowledged and applied.protected Http2ConnectionReturns theHttp2Connectionto use.protected Http2ConnectionDecoderdecoder()Returns theHttp2ConnectionDecoderto use.protected intReturns the maximum number of consecutive empty DATA frames (without end_of_stream flag) that are allowed before the connection is closed.protected intReturns the maximum number of small CONTINUATION frames per HEADERS block that are allowed before the connection is closed.protected HttpToHttp2ConnectionHandlerBuilderdecoderEnforceMaxSmallContinuationFrames(int maxSmallContinuationFrames) Returns the maximum number of small CONTINUATION frames per HEADERS block that are allowed before the connection is closed.protected booleanDetermine if theChannel.close()should be coupled with goaway and graceful close.protected Http2ConnectionEncoderencoder()Returns theHttp2ConnectionEncoderto use.protected booleanReturns if the encoder should queue frames if the maximum number of concurrent streams would otherwise be exceeded.protected intReturns the maximum number of queued control frames that are allowed before the connection is closed.protected HttpToHttp2ConnectionHandlerBuilderencoderEnforceMaxQueuedControlFrames(int maxQueuedControlFrames) Sets the maximum number of queued control frames that are allowed before the connection is closed.protected booleanprotected Http2FrameListenerReturns the listener of inbound frames.protected Http2FrameLoggerReturns the logger that is used for the encoder and decoder.protected longReturns the graceful shutdown timeout of theHttp2Connectionin milliseconds.protected Http2HeadersEncoder.SensitivityDetectorReturns theHttp2HeadersEncoder.SensitivityDetectorto use.protected Http2SettingsSets theHttp2Settingsto use for the initial connection settings exchange.protected booleanDetermine if the PING frames should be automatically acknowledged or not.protected booleanDetermine if the SETTINGS frames should be automatically acknowledged and applied.protected booleanisServer()Returns ifAbstractHttp2ConnectionHandlerBuilder.build()will to create aHttp2Connectionin server mode (true) or client mode (false).protected booleanReturns if HTTP headers should be validated according to RFC 7540, 8.1.2.6.protected booleanReturns if mandatory pseudo-header fields are validated according to RFC 9113, 8.3.protected intGet the maximum number of streams which can be in the reserved state at any given time.protected HttpToHttp2ConnectionHandlerBuildermaxReservedStreams(int maxReservedStreams) Set the maximum number of streams which can be in the reserved state at any given time.protected Http2PromisedRequestVerifierGet theHttp2PromisedRequestVerifierto use.protected HttpToHttp2ConnectionHandlerBuilderpromisedRequestVerifier(Http2PromisedRequestVerifier promisedRequestVerifier) Set theHttp2PromisedRequestVerifierto use.protected final HttpToHttp2ConnectionHandlerBuilderself()Returnsthis.
-
Constructor Details
-
HttpToHttp2ConnectionHandlerBuilder
public HttpToHttp2ConnectionHandlerBuilder()
-
-
Method Details
-
validateHeaders
Description copied from class:AbstractHttp2ConnectionHandlerBuilderSets if HTTP headers should be validated according to RFC 7540, 8.1.2.6. -
validateRequiredPseudoHeaders
public HttpToHttp2ConnectionHandlerBuilder validateRequiredPseudoHeaders(boolean validateRequiredPseudoHeaders) Description copied from class:AbstractHttp2ConnectionHandlerBuilderSets if request and responseHEADERSthat omit a mandatory pseudo-header field are rejected, according to RFC 9113, 8.3. Disabled by default. -
initialSettings
Description copied from class:AbstractHttp2ConnectionHandlerBuilderSets theHttp2Settingsto use for the initial connection settings exchange. -
frameListener
Description copied from class:AbstractHttp2ConnectionHandlerBuilderSets the listener of inbound frames. This listener will only be set if the decoder's listener isnull. -
gracefulShutdownTimeoutMillis
public HttpToHttp2ConnectionHandlerBuilder gracefulShutdownTimeoutMillis(long gracefulShutdownTimeoutMillis) Description copied from class:AbstractHttp2ConnectionHandlerBuilderSets the graceful shutdown timeout of theHttp2Connectionin milliseconds. -
server
Description copied from class:AbstractHttp2ConnectionHandlerBuilderSets ifAbstractHttp2ConnectionHandlerBuilder.build()will to create aHttp2Connectionin server mode (true) or client mode (false). -
connection
Description copied from class:AbstractHttp2ConnectionHandlerBuilderSets theHttp2Connectionto use. -
codec
public HttpToHttp2ConnectionHandlerBuilder codec(Http2ConnectionDecoder decoder, Http2ConnectionEncoder encoder) Description copied from class:AbstractHttp2ConnectionHandlerBuilderSets theHttp2ConnectionDecoderandHttp2ConnectionEncoderto use. -
frameLogger
Description copied from class:AbstractHttp2ConnectionHandlerBuilderSets the logger that is used for the encoder and decoder. -
encoderEnforceMaxConcurrentStreams
public HttpToHttp2ConnectionHandlerBuilder encoderEnforceMaxConcurrentStreams(boolean encoderEnforceMaxConcurrentStreams) Description copied from class:AbstractHttp2ConnectionHandlerBuilderSets if the encoder should queue frames if the maximum number of concurrent streams would otherwise be exceeded. -
headerSensitivityDetector
public HttpToHttp2ConnectionHandlerBuilder headerSensitivityDetector(Http2HeadersEncoder.SensitivityDetector headerSensitivityDetector) Description copied from class:AbstractHttp2ConnectionHandlerBuilderSets theHttp2HeadersEncoder.SensitivityDetectorto use. -
encoderIgnoreMaxHeaderListSize
public HttpToHttp2ConnectionHandlerBuilder encoderIgnoreMaxHeaderListSize(boolean encoderIgnoreMaxHeaderListSize) Description copied from class:AbstractHttp2ConnectionHandlerBuilderSets if the SETTINGS_MAX_HEADER_LIST_SIZE should be ignored when encoding headers.- Overrides:
encoderIgnoreMaxHeaderListSizein classAbstractHttp2ConnectionHandlerBuilder<HttpToHttp2ConnectionHandler, HttpToHttp2ConnectionHandlerBuilder>- Parameters:
encoderIgnoreMaxHeaderListSize-trueto ignore SETTINGS_MAX_HEADER_LIST_SIZE.- Returns:
- this.
-
decoderEnforceMaxConsecutiveEmptyDataFrames
public HttpToHttp2ConnectionHandlerBuilder decoderEnforceMaxConsecutiveEmptyDataFrames(int maxConsecutiveEmptyFrames) Description copied from class:AbstractHttp2ConnectionHandlerBuilderSets the maximum number of consecutive empty DATA frames (without end_of_stream flag) that are allowed before the connection is closed. This allows to protect against the remote peer flooding us with such frames and so use up a lot of CPU. There is no valid use-case for empty DATA frames without end_of_stream flag.0means no protection should be applied. -
decoderEnforceMaxRstFramesPerWindow
public HttpToHttp2ConnectionHandlerBuilder decoderEnforceMaxRstFramesPerWindow(int maxRstFramesPerWindow, int secondsPerWindow) Description copied from class:AbstractHttp2ConnectionHandlerBuilderSets the maximum number RST frames that are allowed per window before the connection is closed. This allows to protect against the remote peer flooding us with such frames and so use up a lot of CPU.0for any of the parameters means no protection should be applied. -
encoderEnforceMaxRstFramesPerWindow
public HttpToHttp2ConnectionHandlerBuilder encoderEnforceMaxRstFramesPerWindow(int maxRstFramesPerWindow, int secondsPerWindow) Description copied from class:AbstractHttp2ConnectionHandlerBuilderSets the maximum number RST frames that are allowed per window before the connection is closed. This allows to protect against the remote peer that will trigger us to generate a flood of RST frames and so use up a lot of CPU.0for any of the parameters means no protection should be applied. -
initialHuffmanDecodeCapacity
@Deprecated public HttpToHttp2ConnectionHandlerBuilder initialHuffmanDecodeCapacity(int initialHuffmanDecodeCapacity) Deprecated.Description copied from class:AbstractHttp2ConnectionHandlerBuilderDoes nothing, do not call. -
decoupleCloseAndGoAway
Description copied from class:AbstractHttp2ConnectionHandlerBuilderDetermine if theChannel.close()should be coupled with goaway and graceful close.- Overrides:
decoupleCloseAndGoAwayin classAbstractHttp2ConnectionHandlerBuilder<HttpToHttp2ConnectionHandler, HttpToHttp2ConnectionHandlerBuilder>- Parameters:
decoupleCloseAndGoAway-trueto makeChannel.close()directly close the underlying transport, and not attempt graceful closure via GOAWAY.- Returns:
this.
-
flushPreface
Description copied from class:AbstractHttp2ConnectionHandlerBuilderDetermine if the Preface should be automatically flushed when theChannelbecomes 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.
- Overrides:
flushPrefacein classAbstractHttp2ConnectionHandlerBuilder<HttpToHttp2ConnectionHandler, HttpToHttp2ConnectionHandlerBuilder>- Parameters:
flushPreface-trueto automatically flush,false otherwise.- Returns:
this.- See Also:
-
httpScheme
AddschemeinHttp2Headersif not already present.- Parameters:
httpScheme-HttpSchemetype- Returns:
this.
-
build
Description copied from class:AbstractHttp2ConnectionHandlerBuilderCreate a newHttp2ConnectionHandler. -
build
protected HttpToHttp2ConnectionHandler build(Http2ConnectionDecoder decoder, Http2ConnectionEncoder encoder, Http2Settings initialSettings) Description copied from class:AbstractHttp2ConnectionHandlerBuilderImplement this method to create a newHttp2ConnectionHandleror 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 set
- Specified by:
buildin classAbstractHttp2ConnectionHandlerBuilder<HttpToHttp2ConnectionHandler, HttpToHttp2ConnectionHandlerBuilder>
-