Class Http3Settings
java.lang.Object
io.netty.handler.codec.http3.Http3Settings
Represents a collection of HTTP/3 settings as defined by the
HTTP/3 specification.
This class provides type-safe accessors for standard HTTP/3 settings such as:
QPACK_MAX_TABLE_CAPACITY(0x1)MAX_FIELD_SECTION_SIZE(0x6)QPACK_BLOCKED_STREAMS(0x7)ENABLE_CONNECT_PROTOCOL(0x8)H3_DATAGRAM(0x33)invalid input: '<'/>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAllows to handle non-standard settings. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instanceHttp3Settings(Http3Settings.NonStandardHttp3SettingsValidator nonStandardSettingsValidator) Creates a new instance -
Method Summary
Modifier and TypeMethodDescriptionReturns whether theENABLE_CONNECT_PROTOCOLsetting is enabled.static Http3SettingsReturns a newHttp3Settingsinstance with default values:QPACK_MAX_TABLE_CAPACITY= 0QPACK_BLOCKED_STREAMS= 0ENABLE_CONNECT_PROTOCOL= falseMAX_FIELD_SECTION_SIZE= 8192H3_DATAGRAM= false invalid input: '<'/>enableConnectProtocol(boolean enabled) Sets theENABLE_CONNECT_PROTOCOLflag.enableH3Datagram(boolean enabled) Sets theH3_DATAGRAMsettings identifier.booleanCompares this settings object to another for equality.get(long key) Returns the value of the specified setting identifier.longgetOrDefault(long key, long defaultValue) Returns the value associated with the specified setting identifier, ordefaultValueif no value is present for the given key.Returns whether theH3_DATAGRAMsetting is enabled.inthashCode()Returns the hash code of this settings object, based on its key–value pairs.iterator()Returns an iterator over the settings entries in this object.Returns theMAX_FIELD_SECTION_SIZEvalue.maxFieldSectionSize(long value) Sets theMAX_FIELD_SECTION_SIZEvalue.Stores a setting value for the specified identifier.putAll(Http3Settings http3Settings) Replaces all current settings with those from anotherHttp3Settingsinstance.Returns theQPACK_BLOCKED_STREAMSvalue.qpackBlockedStreams(long value) Sets theQPACK_BLOCKED_STREAMSvalue.Returns theQPACK_MAX_TABLE_CAPACITYvalue.qpackMaxTableCapacity(long value) Sets theQPACK_MAX_TABLE_CAPACITYvalue.toString()Returns a string representation of this settings object in the form:Methods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
Http3Settings
public Http3Settings()Creates a new instance -
Http3Settings
Creates a new instance- Parameters:
nonStandardSettingsValidator- theHttp3Settings.NonStandardHttp3SettingsValidatorto use to check if a specific setting that is non-standard should be supported or not.
-
-
Method Details
-
put
Stores a setting value for the specified identifier.The key and value are validated according to the HTTP/3 specification. Reserved HTTP/2 setting identifiers and negative values are not allowed. Ignore any unknown id/key as per invalid input: '<'a href="https://www.rfc-editor.org/rfc/rfc9114.html#section-7.2.4-9>rfc9114
- Parameters:
key- the numeric setting identifiervalue- the setting value (non-null)- Returns:
- the previous value associated with the key, or
nullif none - Throws:
IllegalArgumentException- if the key or value is invalid
-
get
Returns the value of the specified setting identifier.- Parameters:
key- the numeric setting identifier- Returns:
- the setting value, or
nullif not set
-
getOrDefault
public long getOrDefault(long key, long defaultValue) Returns the value associated with the specified setting identifier, ordefaultValueif no value is present for the given key.- Parameters:
key- the numeric setting identifierdefaultValue- the value to return if the setting is not present- Returns:
- the configured value for the specified key, or
defaultValue, if the key is not found
-
qpackMaxTableCapacity
Returns theQPACK_MAX_TABLE_CAPACITYvalue.- Returns:
- the current QPACK maximum table capacity, or
nullif not set
-
qpackMaxTableCapacity
Sets theQPACK_MAX_TABLE_CAPACITYvalue.- Parameters:
value- QPACK maximum table capacity (must be ≥ 0)- Returns:
- this instance for method chaining
-
maxFieldSectionSize
Returns theMAX_FIELD_SECTION_SIZEvalue.- Returns:
- the maximum field section size, or
nullif not set
-
maxFieldSectionSize
Sets theMAX_FIELD_SECTION_SIZEvalue.- Parameters:
value- maximum field section size (must be ≥ 0)- Returns:
- this instance for method chaining
-
qpackBlockedStreams
Returns theQPACK_BLOCKED_STREAMSvalue.- Returns:
- the number of blocked streams, or
nullif not set
-
qpackBlockedStreams
Sets theQPACK_BLOCKED_STREAMSvalue.- Parameters:
value- number of blocked streams (must be ≥ 0)- Returns:
- this instance for method chaining
-
connectProtocolEnabled
Returns whether theENABLE_CONNECT_PROTOCOLsetting is enabled.- Returns:
trueif enabled,falseif disabled, ornullif not set
-
enableConnectProtocol
Sets theENABLE_CONNECT_PROTOCOLflag.- Parameters:
enabled- whether to enable the CONNECT protocol- Returns:
- this instance for method chaining
-
h3DatagramEnabled
Returns whether theH3_DATAGRAMsetting is enabled.- Returns:
trueif enabled,falseif disabled, ornullif not set
-
enableH3Datagram
Sets theH3_DATAGRAMsettings identifier.- Parameters:
enabled- whether to enable the H3 Datagram- Returns:
- this instance for method chaining
-
putAll
Replaces all current settings with those from anotherHttp3Settingsinstance.- Parameters:
http3Settings- the source settings (non-null)- Returns:
- this instance for method chaining
-
defaultSettings
Returns a newHttp3Settingsinstance with default values:QPACK_MAX_TABLE_CAPACITY= 0QPACK_BLOCKED_STREAMS= 0ENABLE_CONNECT_PROTOCOL= falseMAX_FIELD_SECTION_SIZE= 8192H3_DATAGRAM= false invalid input: '<'/>
- Returns:
- a default
Http3Settingsinstance
-
iterator
Returns an iterator over the settings entries in this object. Each entry’s key is the numeric setting identifier, and the value is its numeric value. -
equals
-
hashCode
-
toString
-