Package io.netty.handler.codec.http2
Class Http2Settings
- All Implemented Interfaces:
CharObjectMap<Long>
,Map<Character,
Long>
Settings for one endpoint in an HTTP/2 connection. Each of the values are optional as defined in
the spec for the SETTINGS frame. Permits storage of arbitrary key/value pairs but provides helper
methods for standard settings.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.util.collection.CharObjectMap
CharObjectMap.PrimitiveEntry<V>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
Default capacity based on the number of standard settings from the HTTP/2 spec, adjusted so that adding all of the standard settings will not cause the map capacity to change.private static final Long
private static final Long
Fields inherited from class io.netty.util.collection.CharObjectHashMap
DEFAULT_LOAD_FACTOR
-
Constructor Summary
ConstructorsConstructorDescriptionHttp2Settings
(int initialCapacity) Http2Settings
(int initialCapacity, float loadFactor) -
Method Summary
Modifier and TypeMethodDescriptioncopyFrom
(Http2Settings settings) Clears and then copies the given settings into this object.static Http2Settings
getIntValue
(char key) A helper method that returnsLong.intValue()
on the return ofCharObjectHashMap.get(char)
, if present.Gets theSETTINGS_HEADER_TABLE_SIZE
value.headerTableSize
(long value) Sets theSETTINGS_HEADER_TABLE_SIZE
value.Gets theSETTINGS_INITIAL_WINDOW_SIZE
value.initialWindowSize
(int value) Sets theSETTINGS_INITIAL_WINDOW_SIZE
value.protected String
keyToString
(char key) Helper method called byCharObjectHashMap.toString()
in order to convert a single map key into a string.Gets theSETTINGS_MAX_CONCURRENT_STREAMS
value.maxConcurrentStreams
(long value) Sets theSETTINGS_MAX_CONCURRENT_STREAMS
value.Gets theSETTINGS_MAX_FRAME_SIZE
value.maxFrameSize
(int value) Sets theSETTINGS_MAX_FRAME_SIZE
value.Gets theSETTINGS_MAX_HEADER_LIST_SIZE
value.maxHeaderListSize
(long value) Sets theSETTINGS_MAX_HEADER_LIST_SIZE
value.Gets theSETTINGS_ENABLE_PUSH
value.pushEnabled
(boolean enabled) Sets theSETTINGS_ENABLE_PUSH
value.Adds the given setting key/value pair.private static void
verifyStandardSetting
(int key, Long value) Methods inherited from class io.netty.util.collection.CharObjectHashMap
clear, containsKey, containsKey, containsValue, entries, entrySet, equals, get, get, hashCode, isEmpty, keySet, put, putAll, remove, remove, size, toString, values
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
DEFAULT_CAPACITY
private static final int DEFAULT_CAPACITYDefault capacity based on the number of standard settings from the HTTP/2 spec, adjusted so that adding all of the standard settings will not cause the map capacity to change.- See Also:
-
FALSE
-
TRUE
-
-
Constructor Details
-
Http2Settings
public Http2Settings() -
Http2Settings
public Http2Settings(int initialCapacity, float loadFactor) -
Http2Settings
public Http2Settings(int initialCapacity)
-
-
Method Details
-
put
Adds the given setting key/value pair. For standard settings defined by the HTTP/2 spec, performs validation on the values.- Specified by:
put
in interfaceCharObjectMap<Long>
- Overrides:
put
in classCharObjectHashMap<Long>
- Parameters:
key
- the key of the entry.value
- the value of the entry.- Returns:
- the previous value for this key or
null
if there was no previous mapping. - Throws:
IllegalArgumentException
- if verification for a standard HTTP/2 setting fails.
-
headerTableSize
Gets theSETTINGS_HEADER_TABLE_SIZE
value. If unavailable, returnsnull
. -
headerTableSize
Sets theSETTINGS_HEADER_TABLE_SIZE
value.- Throws:
IllegalArgumentException
- if verification of the setting fails.
-
pushEnabled
Gets theSETTINGS_ENABLE_PUSH
value. If unavailable, returnsnull
. -
pushEnabled
Sets theSETTINGS_ENABLE_PUSH
value. -
maxConcurrentStreams
Gets theSETTINGS_MAX_CONCURRENT_STREAMS
value. If unavailable, returnsnull
. -
maxConcurrentStreams
Sets theSETTINGS_MAX_CONCURRENT_STREAMS
value.- Throws:
IllegalArgumentException
- if verification of the setting fails.
-
initialWindowSize
Gets theSETTINGS_INITIAL_WINDOW_SIZE
value. If unavailable, returnsnull
. -
initialWindowSize
Sets theSETTINGS_INITIAL_WINDOW_SIZE
value.- Throws:
IllegalArgumentException
- if verification of the setting fails.
-
maxFrameSize
Gets theSETTINGS_MAX_FRAME_SIZE
value. If unavailable, returnsnull
. -
maxFrameSize
Sets theSETTINGS_MAX_FRAME_SIZE
value.- Throws:
IllegalArgumentException
- if verification of the setting fails.
-
maxHeaderListSize
Gets theSETTINGS_MAX_HEADER_LIST_SIZE
value. If unavailable, returnsnull
. -
maxHeaderListSize
Sets theSETTINGS_MAX_HEADER_LIST_SIZE
value.- Throws:
IllegalArgumentException
- if verification of the setting fails.
-
copyFrom
Clears and then copies the given settings into this object. -
getIntValue
A helper method that returnsLong.intValue()
on the return ofCharObjectHashMap.get(char)
, if present. Note that if the range of the value exceedsInteger.MAX_VALUE
, theCharObjectHashMap.get(char)
method should be used instead to avoid truncation of the value. -
verifyStandardSetting
-
keyToString
Description copied from class:CharObjectHashMap
Helper method called byCharObjectHashMap.toString()
in order to convert a single map key into a string. This is protected to allow subclasses to override the appearance of a given key.- Overrides:
keyToString
in classCharObjectHashMap<Long>
-
defaultSettings
-