Package org.glassfish.grizzly.http2
Class Http2Configuration
java.lang.Object
org.glassfish.grizzly.http2.Http2Configuration
Configuration information for HTTP/2
Filter implementations.- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final floatstatic final float -
Method Summary
Modifier and TypeMethodDescriptionbuilder()intfloatintintintintfloatbooleanbooleanbooleanvoidsetCleanFrequencyCheck(int cleanFrequencyCheck) Set the number of streams that must be closed before checking if the number of streams exceeds the high-water mark.voidsetCleanPercentage(float cleanPercentage) The number of streams to attempt to remove from the streams structure.voidsetDisableCipherCheck(boolean disableCipherCheck) Allows the developer to disable strict cipher suite checking of the connection against RFC 7540's blacklist.voidsetInitialWindowSize(int initialWindowSize) Sets the default initial stream window size (in bytes) for new HTTP2 connections.voidsetMaxConcurrentStreams(int maxConcurrentStreams) Sets the default maximum number of concurrent streams allowed for one session.voidsetMaxFramePayloadSize(int maxFramePayloadSize) Sets the maximum allowed HTTP2 frame payload size.voidsetMaxHeaderListSize(int maxHeaderListSize) Set the maximum size, in bytes, of the header list.voidsetPriorKnowledge(boolean priorKnowledge) Control how the HTTP/2 connection is established with the server.voidsetPushEnabled(boolean pushEnabled) Configure whether push should be allowed by the server endpoint.voidsetStreamsHighWaterMark(float streamsHighWaterMark) Streams are maintained and periodically cleaned when the stream count (open or otherwise) surpasses the the specified high-water mark.
-
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.Http2ConfigurationBuilderinstance.
-
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_SIZEis 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- passtrueto disable the checking.
-
isPriorKnowledge
public boolean isPriorKnowledge()- Returns:
trueif 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-trueif it's known that the server supports HTTP/2. By default no prior knowledge is assumed.
-
isPushEnabled
public boolean isPushEnabled()- Returns:
trueif push to be allowed by the server endpoint, otherwisefalse.
-
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
- Returns:
- the thread pool configuration for servicing HTTP/2 streams, if any.
-
getExecutorService
- Returns:
- a pre-existing
ExecutorService, if any.
-