Class Http2Settings

  • All Implemented Interfaces:
    io.netty.util.collection.CharObjectMap<Long>, Map<Character,​Long>

    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 Detail

      • Http2Settings

        public Http2Settings()
      • Http2Settings

        public Http2Settings​(int initialCapacity,
                             float loadFactor)
      • Http2Settings

        public Http2Settings​(int initialCapacity)
    • 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:
        put in interface io.netty.util.collection.CharObjectMap<Long>
        Overrides:
        put in class io.netty.util.collection.CharObjectHashMap<Long>
        Throws:
        IllegalArgumentException - if verification for a standard HTTP/2 setting fails.
      • headerTableSize

        public Long headerTableSize()
        Gets the SETTINGS_HEADER_TABLE_SIZE value. If unavailable, returns null.
      • headerTableSize

        public Http2Settings headerTableSize​(long value)
        Sets the SETTINGS_HEADER_TABLE_SIZE value.
        Throws:
        IllegalArgumentException - if verification of the setting fails.
      • pushEnabled

        public Boolean pushEnabled()
        Gets the SETTINGS_ENABLE_PUSH value. If unavailable, returns null.
      • pushEnabled

        public Http2Settings pushEnabled​(boolean enabled)
        Sets the SETTINGS_ENABLE_PUSH value.
      • maxConcurrentStreams

        public Long maxConcurrentStreams()
        Gets the SETTINGS_MAX_CONCURRENT_STREAMS value. If unavailable, returns null.
      • maxConcurrentStreams

        public Http2Settings maxConcurrentStreams​(long value)
        Sets the SETTINGS_MAX_CONCURRENT_STREAMS value.
        Throws:
        IllegalArgumentException - if verification of the setting fails.
      • initialWindowSize

        public Integer initialWindowSize()
        Gets the SETTINGS_INITIAL_WINDOW_SIZE value. If unavailable, returns null.
      • initialWindowSize

        public Http2Settings initialWindowSize​(int value)
        Sets the SETTINGS_INITIAL_WINDOW_SIZE value.
        Throws:
        IllegalArgumentException - if verification of the setting fails.
      • maxFrameSize

        public Integer maxFrameSize()
        Gets the SETTINGS_MAX_FRAME_SIZE value. If unavailable, returns null.
      • maxHeaderListSize

        public Long maxHeaderListSize()
        Gets the SETTINGS_MAX_HEADER_LIST_SIZE value. If unavailable, returns null.
      • maxHeaderListSize

        public Http2Settings maxHeaderListSize​(long value)
        Sets the SETTINGS_MAX_HEADER_LIST_SIZE value.
        Throws:
        IllegalArgumentException - if verification of the setting fails.
      • connectProtocolEnabled

        public Boolean connectProtocolEnabled()
        Gets the SETTINGS_ENABLE_CONNECT_PROTOCOL value. If unavailable, returns null.
      • connectProtocolEnabled

        public Http2Settings connectProtocolEnabled​(boolean enabled)
        Sets the SETTINGS_ENABLE_CONNECT_PROTOCOL value.
      • 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 returns Long.intValue() on the return of CharObjectHashMap.get(char), if present. Note that if the range of the value exceeds Integer.MAX_VALUE, the CharObjectHashMap.get(char) method should be used instead to avoid truncation of the value.
      • keyToString

        protected String keyToString​(char key)
        Overrides:
        keyToString in class io.netty.util.collection.CharObjectHashMap<Long>
      • defaultSettings

        public static Http2Settings defaultSettings()