Class Http2Configuration

java.lang.Object
org.glassfish.grizzly.http2.Http2Configuration

public class Http2Configuration extends Object
Configuration information for HTTP/2 Filter implementations.
See Also:
  • Field Details

    • DEFAULT_MAX_HEADER_LIST_SIZE

      public static final int DEFAULT_MAX_HEADER_LIST_SIZE
      See Also:
    • DEFAULT_STREAMS_HIGH_WATER_MARK

      public static final float DEFAULT_STREAMS_HIGH_WATER_MARK
      See Also:
    • DEFAULT_STREAMS_CLEAN_PERCENTAGE

      public static final float DEFAULT_STREAMS_CLEAN_PERCENTAGE
      See Also:
    • DEFAULT_CLEAN_FREQUENCY_CHECK

      public static final int DEFAULT_CLEAN_FREQUENCY_CHECK
      See Also:
  • Method Details

    • builder

      Returns:
      a new Http2Configuration.Http2ConfigurationBuilder instance.
    • getMaxConcurrentStreams

      public int getMaxConcurrentStreams()
      Returns:
      the default maximum number of concurrent streams allowed for one session. Negative value means "unlimited".
    • setMaxConcurrentStreams

      public void setMaxConcurrentStreams(int maxConcurrentStreams)
      Sets the default maximum number of concurrent streams allowed for one session. Negative value means "unlimited".
    • getInitialWindowSize

      public int getInitialWindowSize()
      Returns:
      the default initial stream window size (in bytes) for new HTTP2 connections.
    • setInitialWindowSize

      public void setInitialWindowSize(int initialWindowSize)
      Sets the default initial stream window size (in bytes) for new HTTP2 connections.
    • getMaxFramePayloadSize

      public int getMaxFramePayloadSize()
      Returns:
      the maximum allowed HTTP2 frame payload size.
    • setMaxFramePayloadSize

      public void setMaxFramePayloadSize(int maxFramePayloadSize)
      Sets the maximum allowed HTTP2 frame payload size.
    • getMaxHeaderListSize

      public int getMaxHeaderListSize()
      Returns:
      the maximum size, in bytes, of header list. If not explicitly configured, the default of DEFAULT_MAX_HEADER_LIST_SIZE is used.
    • setMaxHeaderListSize

      public void setMaxHeaderListSize(int maxHeaderListSize)
      Set the maximum size, in bytes, of the header list.
    • isDisableCipherCheck

      public boolean isDisableCipherCheck()
      Returns:
      whether or not strict cipher suite checking against RFC 7540's blacklist is performed or not. If not explicitly configured, checking will be performed.
    • setDisableCipherCheck

      public void setDisableCipherCheck(boolean disableCipherCheck)
      Allows the developer to disable strict cipher suite checking of the connection against RFC 7540's blacklist.
      Parameters:
      disableCipherCheck - pass true to disable the checking.
    • isPriorKnowledge

      public boolean isPriorKnowledge()
      Returns:
      true if this filter will bypass using the HTTP/1.1 upgrade mechanism and send the client preface immediately with the knowledge that the remote endpoint supports HTTP/2.
    • setPriorKnowledge

      public void setPriorKnowledge(boolean priorKnowledge)
      Control how the HTTP/2 connection is established with the server.
      Parameters:
      priorKnowledge - true if it's known that the server supports HTTP/2. By default no prior knowledge is assumed.
    • isPushEnabled

      public boolean isPushEnabled()
      Returns:
      true if push to be allowed by the server endpoint, otherwise false.
    • setPushEnabled

      public void setPushEnabled(boolean pushEnabled)
      Configure whether push should be allowed by the server endpoint.
    • getStreamsHighWaterMark

      public float getStreamsHighWaterMark()
      Returns:
      the high-water mark indicating streams old closed streams should be cleaned up. If not explicitly configured, this returns 0.5f.
    • setStreamsHighWaterMark

      public void setStreamsHighWaterMark(float streamsHighWaterMark)
      Streams are maintained and periodically cleaned when the stream count (open or otherwise) surpasses the the specified high-water mark. This value is applied against the max concurrent streams for the endpoint which HTTP2 is being configured for. For example, if the max concurrent streams is 100 and the mark percentage is .5, then the high water mark for a clean attempt would be 50.
    • getCleanPercentage

      public float getCleanPercentage()
      Returns:
      the number of streams to attempt to remove from the streams structure. Note that only closed streams will ultimately be removed. If not explicitly configured, this returns 0.5f.
    • setCleanPercentage

      public void setCleanPercentage(float cleanPercentage)
      The number of streams to attempt to remove from the streams structure. Note that only closed streams will ultimately be removed. This value is applied against the computed result for the streams high water mark. For example, if the max concurrent streams is 100 and the mark percentage is .5, then the high water mark for a clean attempt would be 50. The number of streams to process in the clean attempt, assuming the clean percentage is .5, would be 25.
    • getCleanFrequencyCheck

      public int getCleanFrequencyCheck()
      Returns:
      how often, in terms of closed streams, the streams structure will be checked for cleaning. If not explicitly configured, this returns 50
    • setCleanFrequencyCheck

      public void setCleanFrequencyCheck(int cleanFrequencyCheck)
      Set the number of streams that must be closed before checking if the number of streams exceeds the high-water mark.
    • getThreadPoolConfig

      public ThreadPoolConfig getThreadPoolConfig()
      Returns:
      the thread pool configuration for servicing HTTP/2 streams, if any.
    • getExecutorService

      public ExecutorService getExecutorService()
      Returns:
      a pre-existing ExecutorService, if any.