Package io.netty.handler.codec.http2
Class Http2Settings
- java.lang.Object
-
- io.netty.util.collection.CharObjectHashMap<Long>
-
- io.netty.handler.codec.http2.Http2Settings
-
public final class Http2Settings extends io.netty.util.collection.CharObjectHashMap<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.
-
-
Constructor Summary
Constructors Constructor Description Http2Settings()Http2Settings(int initialCapacity)Http2Settings(int initialCapacity, float loadFactor)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BooleanconnectProtocolEnabled()Gets theSETTINGS_ENABLE_CONNECT_PROTOCOLvalue.Http2SettingsconnectProtocolEnabled(boolean enabled)Sets theSETTINGS_ENABLE_CONNECT_PROTOCOLvalue.Http2SettingscopyFrom(Http2Settings settings)Clears and then copies the given settings into this object.static Http2SettingsdefaultSettings()IntegergetIntValue(char key)A helper method that returnsLong.intValue()on the return ofCharObjectHashMap.get(char), if present.LongheaderTableSize()Gets theSETTINGS_HEADER_TABLE_SIZEvalue.Http2SettingsheaderTableSize(long value)Sets theSETTINGS_HEADER_TABLE_SIZEvalue.IntegerinitialWindowSize()Gets theSETTINGS_INITIAL_WINDOW_SIZEvalue.Http2SettingsinitialWindowSize(int value)Sets theSETTINGS_INITIAL_WINDOW_SIZEvalue.protected StringkeyToString(char key)LongmaxConcurrentStreams()Gets theSETTINGS_MAX_CONCURRENT_STREAMSvalue.Http2SettingsmaxConcurrentStreams(long value)Sets theSETTINGS_MAX_CONCURRENT_STREAMSvalue.IntegermaxFrameSize()Gets theSETTINGS_MAX_FRAME_SIZEvalue.Http2SettingsmaxFrameSize(int value)Sets theSETTINGS_MAX_FRAME_SIZEvalue.LongmaxHeaderListSize()Gets theSETTINGS_MAX_HEADER_LIST_SIZEvalue.Http2SettingsmaxHeaderListSize(long value)Sets theSETTINGS_MAX_HEADER_LIST_SIZEvalue.BooleanpushEnabled()Gets theSETTINGS_ENABLE_PUSHvalue.Http2SettingspushEnabled(boolean enabled)Sets theSETTINGS_ENABLE_PUSHvalue.Longput(char key, Long value)Adds the given setting key/value pair.-
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
-
-
-
-
Method Detail
-
put
public Long put(char key, 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 interfaceio.netty.util.collection.CharObjectMap<Long>- Overrides:
putin classio.netty.util.collection.CharObjectHashMap<Long>- Throws:
IllegalArgumentException- if verification for a standard HTTP/2 setting fails.
-
headerTableSize
public Long headerTableSize()
Gets theSETTINGS_HEADER_TABLE_SIZEvalue. If unavailable, returnsnull.
-
headerTableSize
public Http2Settings headerTableSize(long value)
Sets theSETTINGS_HEADER_TABLE_SIZEvalue.- Throws:
IllegalArgumentException- if verification of the setting fails.
-
pushEnabled
public Boolean pushEnabled()
Gets theSETTINGS_ENABLE_PUSHvalue. If unavailable, returnsnull.
-
pushEnabled
public Http2Settings pushEnabled(boolean enabled)
Sets theSETTINGS_ENABLE_PUSHvalue.
-
maxConcurrentStreams
public Long maxConcurrentStreams()
Gets theSETTINGS_MAX_CONCURRENT_STREAMSvalue. If unavailable, returnsnull.
-
maxConcurrentStreams
public Http2Settings maxConcurrentStreams(long value)
Sets theSETTINGS_MAX_CONCURRENT_STREAMSvalue.- Throws:
IllegalArgumentException- if verification of the setting fails.
-
initialWindowSize
public Integer initialWindowSize()
Gets theSETTINGS_INITIAL_WINDOW_SIZEvalue. If unavailable, returnsnull.
-
initialWindowSize
public Http2Settings initialWindowSize(int value)
Sets theSETTINGS_INITIAL_WINDOW_SIZEvalue.- Throws:
IllegalArgumentException- if verification of the setting fails.
-
maxFrameSize
public Integer maxFrameSize()
Gets theSETTINGS_MAX_FRAME_SIZEvalue. If unavailable, returnsnull.
-
maxFrameSize
public Http2Settings maxFrameSize(int value)
Sets theSETTINGS_MAX_FRAME_SIZEvalue.- Throws:
IllegalArgumentException- if verification of the setting fails.
-
maxHeaderListSize
public Long maxHeaderListSize()
Gets theSETTINGS_MAX_HEADER_LIST_SIZEvalue. If unavailable, returnsnull.
-
maxHeaderListSize
public Http2Settings maxHeaderListSize(long value)
Sets theSETTINGS_MAX_HEADER_LIST_SIZEvalue.- Throws:
IllegalArgumentException- if verification of the setting fails.
-
connectProtocolEnabled
public Boolean connectProtocolEnabled()
Gets theSETTINGS_ENABLE_CONNECT_PROTOCOLvalue. If unavailable, returnsnull.
-
connectProtocolEnabled
public Http2Settings connectProtocolEnabled(boolean enabled)
Sets theSETTINGS_ENABLE_CONNECT_PROTOCOLvalue.
-
copyFrom
public Http2Settings copyFrom(Http2Settings settings)
Clears and then copies the given settings into this object.
-
getIntValue
public 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.
-
keyToString
protected String keyToString(char key)
- Overrides:
keyToStringin classio.netty.util.collection.CharObjectHashMap<Long>
-
defaultSettings
public static Http2Settings defaultSettings()
-
-