Class Http2Settings


  • public class Http2Settings
    extends Object
    HTTP2 settings, the settings is initialized with the default HTTP/2 values.

    The settings expose the parameters defined by the HTTP/2 specification, as well as extra settings for protocol extensions.

    Author:
    Julien Viet
    • Constructor Detail

      • Http2Settings

        public Http2Settings()
        Default constructor
      • Http2Settings

        public Http2Settings​(JsonObject json)
        Create an settings from JSON
        Parameters:
        json - the JSON
      • Http2Settings

        public Http2Settings​(Http2Settings other)
        Copy constructor
        Parameters:
        other - the settings to copy
    • Method Detail

      • getHeaderTableSize

        public long getHeaderTableSize()
        Returns:
        the SETTINGS_HEADER_TABLE_SIZE HTTP/2 setting
      • setHeaderTableSize

        public Http2Settings setHeaderTableSize​(long headerTableSize)
        Set SETTINGS_HEADER_TABLE_SIZE HTTP/2 setting.
        Parameters:
        headerTableSize - the new value
        Returns:
        a reference to this, so the API can be used fluently
      • isPushEnabled

        public boolean isPushEnabled()
        Returns:
        the SETTINGS_ENABLE_PUSH HTTP/2 setting
      • setPushEnabled

        public Http2Settings setPushEnabled​(boolean pushEnabled)
        Set the SETTINGS_ENABLE_PUSH HTTP/2 setting
        Parameters:
        pushEnabled - the new value
        Returns:
        a reference to this, so the API can be used fluently
      • getMaxConcurrentStreams

        public long getMaxConcurrentStreams()
        Returns:
        the SETTINGS_MAX_CONCURRENT_STREAMS HTTP/2 setting
      • setMaxConcurrentStreams

        public Http2Settings setMaxConcurrentStreams​(long maxConcurrentStreams)
        Set the SETTINGS_MAX_CONCURRENT_STREAMS HTTP/2 setting
        Parameters:
        maxConcurrentStreams - the new value
        Returns:
        a reference to this, so the API can be used fluently
      • getInitialWindowSize

        public int getInitialWindowSize()
        Returns:
        the SETTINGS_INITIAL_WINDOW_SIZE HTTP/2 setting
      • setInitialWindowSize

        public Http2Settings setInitialWindowSize​(int initialWindowSize)
        Set the SETTINGS_INITIAL_WINDOW_SIZE HTTP/2 setting
        Parameters:
        initialWindowSize - the new value
        Returns:
        a reference to this, so the API can be used fluently
      • getMaxFrameSize

        public int getMaxFrameSize()
        Returns:
        the SETTINGS_MAX_FRAME_SIZE HTTP/2 setting
      • setMaxFrameSize

        public Http2Settings setMaxFrameSize​(int maxFrameSize)
        Set the SETTINGS_MAX_FRAME_SIZE HTTP/2 setting
        Parameters:
        maxFrameSize - the new value
        Returns:
        a reference to this, so the API can be used fluently
      • getMaxHeaderListSize

        public long getMaxHeaderListSize()
        Returns:
        the SETTINGS_MAX_HEADER_LIST_SIZE HTTP/2 setting
      • setMaxHeaderListSize

        public Http2Settings setMaxHeaderListSize​(long maxHeaderListSize)
        Set the SETTINGS_MAX_HEADER_LIST_SIZE HTTP/2 setting
        Parameters:
        maxHeaderListSize - the new value
        Returns:
        a reference to this, so the API can be used fluently
      • getExtraSettings

        public Map<Integer,​Long> getExtraSettings()
        Returns:
        the extra settings used for extending HTTP/2
      • setExtraSettings

        public Http2Settings setExtraSettings​(Map<Integer,​Long> settings)
        Set the extra setting used for extending HTTP/2
        Parameters:
        settings - the new extra settings
        Returns:
        a reference to this, so the API can be used fluently
      • get

        public Long get​(int id)
        Return a setting value according to its identifier.
        Parameters:
        id - the setting identifier
        Returns:
        the setting value
      • set

        public Http2Settings set​(int id,
                                 long value)
        Set a setting value for a given setting id.
        Parameters:
        id - the setting id
        value - the setting value
        Returns:
        a reference to this, so the API can be used fluently
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object