Package io.netty.handler.codec.http2
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>
public final class Http2Settings extends CharObjectHashMap<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 io.netty.util.collection.CharObjectMap
CharObjectMap.PrimitiveEntry<V>
-
-
Field Summary
-
Fields inherited from class io.netty.util.collection.CharObjectHashMap
DEFAULT_LOAD_FACTOR
-
-
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 java.lang.Boolean
connectProtocolEnabled()
Gets theSETTINGS_ENABLE_CONNECT_PROTOCOL
value.Http2Settings
connectProtocolEnabled(boolean enabled)
Sets theSETTINGS_ENABLE_CONNECT_PROTOCOL
value.Http2Settings
copyFrom(Http2Settings settings)
Clears and then copies the given settings into this object.static Http2Settings
defaultSettings()
java.lang.Integer
getIntValue(char key)
A helper method that returnsLong.intValue()
on the return ofCharObjectHashMap.get(char)
, if present.java.lang.Long
headerTableSize()
Gets theSETTINGS_HEADER_TABLE_SIZE
value.Http2Settings
headerTableSize(long value)
Sets theSETTINGS_HEADER_TABLE_SIZE
value.java.lang.Integer
initialWindowSize()
Gets theSETTINGS_INITIAL_WINDOW_SIZE
value.Http2Settings
initialWindowSize(int value)
Sets theSETTINGS_INITIAL_WINDOW_SIZE
value.protected java.lang.String
keyToString(char key)
Helper method called byCharObjectHashMap.toString()
in order to convert a single map key into a string.java.lang.Long
maxConcurrentStreams()
Gets theSETTINGS_MAX_CONCURRENT_STREAMS
value.Http2Settings
maxConcurrentStreams(long value)
Sets theSETTINGS_MAX_CONCURRENT_STREAMS
value.java.lang.Integer
maxFrameSize()
Gets theSETTINGS_MAX_FRAME_SIZE
value.Http2Settings
maxFrameSize(int value)
Sets theSETTINGS_MAX_FRAME_SIZE
value.java.lang.Long
maxHeaderListSize()
Gets theSETTINGS_MAX_HEADER_LIST_SIZE
value.Http2Settings
maxHeaderListSize(long value)
Sets theSETTINGS_MAX_HEADER_LIST_SIZE
value.java.lang.Boolean
pushEnabled()
Gets theSETTINGS_ENABLE_PUSH
value.Http2Settings
pushEnabled(boolean enabled)
Sets theSETTINGS_ENABLE_PUSH
value.java.lang.Long
put(char key, java.lang.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
-
-
-
-
Method Detail
-
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:
put
in interfaceCharObjectMap<java.lang.Long>
- Overrides:
put
in 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
null
if 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_SIZE
value. If unavailable, returnsnull
.
-
headerTableSize
public Http2Settings headerTableSize(long value)
Sets theSETTINGS_HEADER_TABLE_SIZE
value.- Throws:
java.lang.IllegalArgumentException
- if verification of the setting fails.
-
pushEnabled
public java.lang.Boolean pushEnabled()
Gets theSETTINGS_ENABLE_PUSH
value. If unavailable, returnsnull
.
-
pushEnabled
public Http2Settings pushEnabled(boolean enabled)
Sets theSETTINGS_ENABLE_PUSH
value.
-
maxConcurrentStreams
public java.lang.Long maxConcurrentStreams()
Gets theSETTINGS_MAX_CONCURRENT_STREAMS
value. If unavailable, returnsnull
.
-
maxConcurrentStreams
public Http2Settings maxConcurrentStreams(long value)
Sets theSETTINGS_MAX_CONCURRENT_STREAMS
value.- Throws:
java.lang.IllegalArgumentException
- if verification of the setting fails.
-
initialWindowSize
public java.lang.Integer initialWindowSize()
Gets theSETTINGS_INITIAL_WINDOW_SIZE
value. If unavailable, returnsnull
.
-
initialWindowSize
public Http2Settings initialWindowSize(int value)
Sets theSETTINGS_INITIAL_WINDOW_SIZE
value.- Throws:
java.lang.IllegalArgumentException
- if verification of the setting fails.
-
maxFrameSize
public java.lang.Integer maxFrameSize()
Gets theSETTINGS_MAX_FRAME_SIZE
value. If unavailable, returnsnull
.
-
maxFrameSize
public Http2Settings maxFrameSize(int value)
Sets theSETTINGS_MAX_FRAME_SIZE
value.- Throws:
java.lang.IllegalArgumentException
- if verification of the setting fails.
-
maxHeaderListSize
public java.lang.Long maxHeaderListSize()
Gets theSETTINGS_MAX_HEADER_LIST_SIZE
value. If unavailable, returnsnull
.
-
maxHeaderListSize
public Http2Settings maxHeaderListSize(long value)
Sets theSETTINGS_MAX_HEADER_LIST_SIZE
value.- Throws:
java.lang.IllegalArgumentException
- if verification of the setting fails.
-
connectProtocolEnabled
public java.lang.Boolean connectProtocolEnabled()
Gets theSETTINGS_ENABLE_CONNECT_PROTOCOL
value. If unavailable, returnsnull
.
-
connectProtocolEnabled
public Http2Settings connectProtocolEnabled(boolean enabled)
Sets theSETTINGS_ENABLE_CONNECT_PROTOCOL
value.
-
copyFrom
public Http2Settings copyFrom(Http2Settings settings)
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.
-
keyToString
protected java.lang.String keyToString(char key)
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<java.lang.Long>
-
defaultSettings
public static Http2Settings defaultSettings()
-
-