Class Http2Settings
java.lang.Object
io.netty.util.collection.CharObjectHashMap<java.lang.Long>
io.netty.handler.codec.http2.Http2Settings
- All Implemented Interfaces:
CharObjectMap<java.lang.Long>, java.util.Map<java.lang.Character, java.lang.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 CharObjectMap
CharObjectMap.PrimitiveEntry<V>Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intDefault 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 java.lang.Longprivate static final java.lang.LongFields inherited from class CharObjectHashMap
DEFAULT_LOAD_FACTOR -
Constructor Summary
ConstructorsConstructorDescriptionHttp2Settings(int initialCapacity) Http2Settings(int initialCapacity, float loadFactor) -
Method Summary
Modifier and TypeMethodDescriptionjava.lang.BooleanGets theSETTINGS_ENABLE_CONNECT_PROTOCOLvalue.connectProtocolEnabled(boolean enabled) Sets theSETTINGS_ENABLE_CONNECT_PROTOCOLvalue.copyFrom(Http2Settings settings) Clears and then copies the given settings into this object.static Http2Settingsjava.lang.IntegergetIntValue(char key) A helper method that returnsLong.intValue()on the return ofCharObjectHashMap.get(char), if present.java.lang.LongGets theSETTINGS_HEADER_TABLE_SIZEvalue.headerTableSize(long value) Sets theSETTINGS_HEADER_TABLE_SIZEvalue.java.lang.IntegerGets theSETTINGS_INITIAL_WINDOW_SIZEvalue.initialWindowSize(int value) Sets theSETTINGS_INITIAL_WINDOW_SIZEvalue.protected java.lang.StringkeyToString(char key) Helper method called byCharObjectHashMap.toString()in order to convert a single map key into a string.java.lang.LongGets theSETTINGS_MAX_CONCURRENT_STREAMSvalue.maxConcurrentStreams(long value) Sets theSETTINGS_MAX_CONCURRENT_STREAMSvalue.java.lang.IntegerGets theSETTINGS_MAX_FRAME_SIZEvalue.maxFrameSize(int value) Sets theSETTINGS_MAX_FRAME_SIZEvalue.java.lang.LongGets theSETTINGS_MAX_HEADER_LIST_SIZEvalue.maxHeaderListSize(long value) Sets theSETTINGS_MAX_HEADER_LIST_SIZEvalue.java.lang.BooleanGets theSETTINGS_ENABLE_PUSHvalue.pushEnabled(boolean enabled) Sets theSETTINGS_ENABLE_PUSHvalue.java.lang.Longput(char key, java.lang.Long value) Adds the given setting key/value pair.private static voidverifyStandardSetting(int key, java.lang.Long value) Methods inherited from class CharObjectHashMap
clear, containsKey, containsKey, containsValue, entries, entrySet, equals, get, get, hashCode, isEmpty, keySet, put, putAll, remove, remove, size, toString, valuesMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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
private static final java.lang.Long FALSE -
TRUE
private static final java.lang.Long TRUE
-
-
Constructor Details
-
Http2Settings
public Http2Settings() -
Http2Settings
public Http2Settings(int initialCapacity, float loadFactor) -
Http2Settings
public Http2Settings(int initialCapacity)
-
-
Method Details
-
put
public java.lang.Long put(char key, java.lang.Long value) Adds the given setting key/value pair. For standard settings defined by the HTTP/2 spec, performs validation on the values.- Specified by:
putin interfaceCharObjectMap<java.lang.Long>- Overrides:
putin classCharObjectHashMap<java.lang.Long>- Parameters:
key- the key of the entry.value- the value of the entry.- Returns:
- the previous value for this key or
nullif there was no previous mapping. - Throws:
java.lang.IllegalArgumentException- if verification for a standard HTTP/2 setting fails.
-
headerTableSize
public java.lang.Long headerTableSize()Gets theSETTINGS_HEADER_TABLE_SIZEvalue. If unavailable, returnsnull. -
headerTableSize
Sets theSETTINGS_HEADER_TABLE_SIZEvalue.- Throws:
java.lang.IllegalArgumentException- if verification of the setting fails.
-
pushEnabled
public java.lang.Boolean pushEnabled()Gets theSETTINGS_ENABLE_PUSHvalue. If unavailable, returnsnull. -
pushEnabled
Sets theSETTINGS_ENABLE_PUSHvalue. -
maxConcurrentStreams
public java.lang.Long maxConcurrentStreams()Gets theSETTINGS_MAX_CONCURRENT_STREAMSvalue. If unavailable, returnsnull. -
maxConcurrentStreams
Sets theSETTINGS_MAX_CONCURRENT_STREAMSvalue.- Throws:
java.lang.IllegalArgumentException- if verification of the setting fails.
-
initialWindowSize
public java.lang.Integer initialWindowSize()Gets theSETTINGS_INITIAL_WINDOW_SIZEvalue. If unavailable, returnsnull. -
initialWindowSize
Sets theSETTINGS_INITIAL_WINDOW_SIZEvalue.- Throws:
java.lang.IllegalArgumentException- if verification of the setting fails.
-
maxFrameSize
public java.lang.Integer maxFrameSize()Gets theSETTINGS_MAX_FRAME_SIZEvalue. If unavailable, returnsnull. -
maxFrameSize
Sets theSETTINGS_MAX_FRAME_SIZEvalue.- Throws:
java.lang.IllegalArgumentException- if verification of the setting fails.
-
maxHeaderListSize
public java.lang.Long maxHeaderListSize()Gets theSETTINGS_MAX_HEADER_LIST_SIZEvalue. If unavailable, returnsnull. -
maxHeaderListSize
Sets theSETTINGS_MAX_HEADER_LIST_SIZEvalue.- Throws:
java.lang.IllegalArgumentException- if verification of the setting fails.
-
connectProtocolEnabled
public java.lang.Boolean connectProtocolEnabled()Gets theSETTINGS_ENABLE_CONNECT_PROTOCOLvalue. If unavailable, returnsnull. -
connectProtocolEnabled
Sets theSETTINGS_ENABLE_CONNECT_PROTOCOLvalue. -
copyFrom
Clears and then copies the given settings into this object. -
getIntValue
public java.lang.Integer getIntValue(char key) 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
private static void verifyStandardSetting(int key, java.lang.Long value) -
keyToString
protected java.lang.String keyToString(char key) Description copied from class:CharObjectHashMapHelper 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:
keyToStringin classCharObjectHashMap<java.lang.Long>
-
defaultSettings
-