Top Description Inners Fields Constructors Methods
org.glassfish.grizzly.http2

public Class Http2Configuration

extends Object
Class Inheritance
Imports
java.util.concurrent.ExecutorService, org.glassfish.grizzly.filterchain.Filter, org.glassfish.grizzly.threadpool.ThreadPoolConfig

Configuration information for HTTP/2 Filter implementations.
See Also
Http2ClientFilter, Http2ServerFilter

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private volatile int
private volatile float
public static final int
public static final int
public static final float
public static final float
private volatile boolean
private final ExecutorService
private volatile int
private volatile int
private volatile int
private volatile int
private volatile boolean
private volatile boolean
private volatile float
private final ThreadPoolConfig

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Http2Configuration.Http2ConfigurationBuilder
builder()

Returns: a new Http2ConfigurationBuilder instance.

public int
getCleanFrequencyCheck()

Returns: how often, in terms of closed streams, the streams structure will be checked for cleaning.

public float
getCleanPercentage()

Returns: the number of streams to attempt to remove from the streams structure.

public ExecutorService
getExecutorService()

Returns: a pre-existing ExecutorService, if any.

public int
getInitialWindowSize()

Returns: the default initial stream window size (in bytes) for new HTTP2 connections.

public int
getMaxConcurrentStreams()

Returns: the default maximum number of concurrent streams allowed for one session.

public int
getMaxFramePayloadSize()

Returns: the maximum allowed HTTP2 frame payload size.

public int
getMaxHeaderListSize()

Returns: the maximum size, in bytes, of header list.

public float
getStreamsHighWaterMark()

Returns: the high-water mark indicating streams old closed streams should be cleaned up.

public ThreadPoolConfig
getThreadPoolConfig()

Returns: the thread pool configuration for servicing HTTP/2 streams, if any.

public boolean
isDisableCipherCheck()

Returns: whether or not strict cipher suite checking against RFC 7540's blacklist is performed or not.

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.

public boolean
isPushEnabled()

Returns: true if push to be allowed by the server endpoint, otherwise false.

public void
setCleanFrequencyCheck(final int cleanFrequencyCheck)

Set the number of streams that must be closed before checking if the number of streams exceeds the high-water mark.

public void
setCleanPercentage(final float cleanPercentage)

The number of streams to attempt to remove from the streams structure.

public void
setDisableCipherCheck(final boolean
pass true to disable the checking.
disableCipherCheck
)

Allows the developer to disable strict cipher suite checking of the connection against RFC 7540's blacklist.

public void
setInitialWindowSize(final int initialWindowSize)

Sets the default initial stream window size (in bytes) for new HTTP2 connections.

public void
setMaxConcurrentStreams(final int maxConcurrentStreams)

Sets the default maximum number of concurrent streams allowed for one session.

public void
setMaxFramePayloadSize(final int maxFramePayloadSize)

Sets the maximum allowed HTTP2 frame payload size.

public void
setMaxHeaderListSize(final int maxHeaderListSize)

Set the maximum size, in bytes, of the header list.

public void
setPriorKnowledge(final boolean
true if it's known that the server supports HTTP/2. By default no prior knowledge is assumed.
priorKnowledge
)

Control how the HTTP/2 connection is established with the server.

public void
setPushEnabled(final boolean pushEnabled)

Configure whether push should be allowed by the server endpoint.

public void
setStreamsHighWaterMark(final float streamsHighWaterMark)

Streams are maintained and periodically cleaned when the stream count (open or otherwise) surpasses the the specified high-water mark.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cleanFrequencyCheckback to summary
private volatile int cleanFrequencyCheck
cleanPercentageback to summary
private volatile float cleanPercentage
DEFAULT_CLEAN_FREQUENCY_CHECKback to summary
public static final int DEFAULT_CLEAN_FREQUENCY_CHECK
DEFAULT_MAX_HEADER_LIST_SIZEback to summary
public static final int DEFAULT_MAX_HEADER_LIST_SIZE
DEFAULT_STREAMS_CLEAN_PERCENTAGEback to summary
public static final float DEFAULT_STREAMS_CLEAN_PERCENTAGE
DEFAULT_STREAMS_HIGH_WATER_MARKback to summary
public static final float DEFAULT_STREAMS_HIGH_WATER_MARK
disableCipherCheckback to summary
private volatile boolean disableCipherCheck
executorServiceback to summary
private final ExecutorService executorService
initialWindowSizeback to summary
private volatile int initialWindowSize
maxConcurrentStreamsback to summary
private volatile int maxConcurrentStreams
maxFramePayloadSizeback to summary
private volatile int maxFramePayloadSize
maxHeaderListSizeback to summary
private volatile int maxHeaderListSize
priorKnowledgeback to summary
private volatile boolean priorKnowledge
pushEnabledback to summary
private volatile boolean pushEnabled
streamsHighWaterMarkback to summary
private volatile float streamsHighWaterMark
threadPoolConfigback to summary
private final ThreadPoolConfig threadPoolConfig

Constructor Detail

Http2Configurationback to summary
private Http2Configuration(final Http2Configuration.Http2ConfigurationBuilder builder)

Method Detail

builderback to summary
public static Http2Configuration.Http2ConfigurationBuilder builder()
Returns:Http2Configuration.Http2ConfigurationBuilder

a new Http2ConfigurationBuilder instance.

getCleanFrequencyCheckback to summary
public int getCleanFrequencyCheck()
Returns:int

how often, in terms of closed streams, the streams structure will be checked for cleaning. If not explicitly configured, this returns 50

getCleanPercentageback to summary
public float getCleanPercentage()
Returns:float

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.5.

getExecutorServiceback to summary
public ExecutorService getExecutorService()
Returns:ExecutorService

a pre-existing ExecutorService, if any.

getInitialWindowSizeback to summary
public int getInitialWindowSize()
Returns:int

the default initial stream window size (in bytes) for new HTTP2 connections.

getMaxConcurrentStreamsback to summary
public int getMaxConcurrentStreams()
Returns:int

the default maximum number of concurrent streams allowed for one session. Negative value means "unlimited".

getMaxFramePayloadSizeback to summary
public int getMaxFramePayloadSize()
Returns:int

the maximum allowed HTTP2 frame payload size.

getMaxHeaderListSizeback to summary
public int getMaxHeaderListSize()
Returns:int

the maximum size, in bytes, of header list. If not explicitly configured, the default of DEFAULT_MAX_HEADER_LIST_SIZE is used.

getStreamsHighWaterMarkback to summary
public float getStreamsHighWaterMark()
Returns:float

the high-water mark indicating streams old closed streams should be cleaned up. If not explicitly configured, this returns 0.5.

getThreadPoolConfigback to summary
public ThreadPoolConfig getThreadPoolConfig()
Returns:ThreadPoolConfig

the thread pool configuration for servicing HTTP/2 streams, if any.

isDisableCipherCheckback to summary
public boolean isDisableCipherCheck()
Returns:boolean

whether or not strict cipher suite checking against RFC 7540's blacklist is performed or not. If not explicitly configured, checking will be performed.

isPriorKnowledgeback to summary
public boolean isPriorKnowledge()
Returns:boolean

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.

isPushEnabledback to summary
public boolean isPushEnabled()
Returns:boolean

true if push to be allowed by the server endpoint, otherwise false.

setCleanFrequencyCheckback to summary
public void setCleanFrequencyCheck(final int cleanFrequencyCheck)

Set the number of streams that must be closed before checking if the number of streams exceeds the high-water mark.

setCleanPercentageback to summary
public void setCleanPercentage(final 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.

setDisableCipherCheckback to summary
public void setDisableCipherCheck(final boolean disableCipherCheck)

Allows the developer to disable strict cipher suite checking of the connection against RFC 7540's blacklist.

Parameters
disableCipherCheck:boolean

pass true to disable the checking.

setInitialWindowSizeback to summary
public void setInitialWindowSize(final int initialWindowSize)

Sets the default initial stream window size (in bytes) for new HTTP2 connections.

setMaxConcurrentStreamsback to summary
public void setMaxConcurrentStreams(final int maxConcurrentStreams)

Sets the default maximum number of concurrent streams allowed for one session. Negative value means "unlimited".

setMaxFramePayloadSizeback to summary
public void setMaxFramePayloadSize(final int maxFramePayloadSize)

Sets the maximum allowed HTTP2 frame payload size.

setMaxHeaderListSizeback to summary
public void setMaxHeaderListSize(final int maxHeaderListSize)

Set the maximum size, in bytes, of the header list.

setPriorKnowledgeback to summary
public void setPriorKnowledge(final boolean priorKnowledge)

Control how the HTTP/2 connection is established with the server.

Parameters
priorKnowledge:boolean

true if it's known that the server supports HTTP/2. By default no prior knowledge is assumed.

setPushEnabledback to summary
public void setPushEnabled(final boolean pushEnabled)

Configure whether push should be allowed by the server endpoint.

setStreamsHighWaterMarkback to summary
public void setStreamsHighWaterMark(final 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.

org.glassfish.grizzly.http2 back to summary

public final Class Http2Configuration.Http2ConfigurationBuilder

extends Object
Class Inheritance
  • java.lang.Object
  • org.glassfish.grizzly.http2.Http2Configuration.Http2ConfigurationBuilder

Field Summary

Modifier and TypeField and Description
private int
private float
private boolean
private ExecutorService
private int
private int
private int
private int
private boolean
private boolean
private float
private ThreadPoolConfig

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Http2Configuration
build()

Returns: a new Http2Configuration instances based on the values of this builder.

public Http2Configuration.Http2ConfigurationBuilder
cleanFrequencyCheck(final int val)

public Http2Configuration.Http2ConfigurationBuilder
cleanPercentage(final float val)

public Http2Configuration.Http2ConfigurationBuilder
disableCipherCheck(final boolean val)

public Http2Configuration.Http2ConfigurationBuilder
enablePush(final boolean val)

public Http2Configuration.Http2ConfigurationBuilder
executorService(final ExecutorService val)

Specifies a pre-existing ExecutorService for handling HTTP/2 streams.

public Http2Configuration.Http2ConfigurationBuilder
initialWindowSize(final int val)

public Http2Configuration.Http2ConfigurationBuilder
maxConcurrentStreams(final int val)

public Http2Configuration.Http2ConfigurationBuilder
maxFramePayloadSize(final int val)

public Http2Configuration.Http2ConfigurationBuilder
maxHeaderListSize(final int val)

public Http2Configuration.Http2ConfigurationBuilder
priorKnowledge(final boolean val)

public Http2Configuration.Http2ConfigurationBuilder
streamsHighWaterMark(final float val)

public Http2Configuration.Http2ConfigurationBuilder
threadPoolConfig(final ThreadPoolConfig val)

Specifies a thread pool configuration that will be used to create a new ExecutorService handling HTTP/2 streams.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cleanFrequencyCheckback to summary
private int cleanFrequencyCheck
cleanPercentageback to summary
private float cleanPercentage
disableCipherCheckback to summary
private boolean disableCipherCheck
executorServiceback to summary
private ExecutorService executorService
initialWindowSizeback to summary
private int initialWindowSize
maxConcurrentStreamsback to summary
private int maxConcurrentStreams
maxFramePayloadSizeback to summary
private int maxFramePayloadSize
maxHeaderListSizeback to summary
private int maxHeaderListSize
priorKnowledgeback to summary
private boolean priorKnowledge
pushEnabledback to summary
private boolean pushEnabled
streamsHighWaterMarkback to summary
private float streamsHighWaterMark
threadPoolConfigback to summary
private ThreadPoolConfig threadPoolConfig

Constructor Detail

Http2ConfigurationBuilderback to summary
private Http2ConfigurationBuilder()

Method Detail

buildback to summary
public Http2Configuration build()
Returns:Http2Configuration

a new Http2Configuration instances based on the values of this builder.

cleanFrequencyCheckback to summary
public Http2Configuration.Http2ConfigurationBuilder cleanFrequencyCheck(final int val)
See Also
setCleanFrequencyCheck(int)
cleanPercentageback to summary
public Http2Configuration.Http2ConfigurationBuilder cleanPercentage(final float val)
See Also
setCleanPercentage(float)
disableCipherCheckback to summary
public Http2Configuration.Http2ConfigurationBuilder disableCipherCheck(final boolean val)
See Also
setDisableCipherCheck(boolean)
enablePushback to summary
public Http2Configuration.Http2ConfigurationBuilder enablePush(final boolean val)
See Also
setPushEnabled(boolean)
executorServiceback to summary
public Http2Configuration.Http2ConfigurationBuilder executorService(final ExecutorService val)

Specifies a pre-existing ExecutorService for handling HTTP/2 streams. If called, it will clear any value set previously by threadPoolConfig(ThreadPoolConfig).

initialWindowSizeback to summary
public Http2Configuration.Http2ConfigurationBuilder initialWindowSize(final int val)
See Also
setInitialWindowSize(int)
maxConcurrentStreamsback to summary
public Http2Configuration.Http2ConfigurationBuilder maxConcurrentStreams(final int val)
See Also
setMaxConcurrentStreams(int)
maxFramePayloadSizeback to summary
public Http2Configuration.Http2ConfigurationBuilder maxFramePayloadSize(final int val)
See Also
setMaxFramePayloadSize(int)
maxHeaderListSizeback to summary
public Http2Configuration.Http2ConfigurationBuilder maxHeaderListSize(final int val)
See Also
setMaxHeaderListSize(int)
priorKnowledgeback to summary
public Http2Configuration.Http2ConfigurationBuilder priorKnowledge(final boolean val)
See Also
setPriorKnowledge(boolean)
streamsHighWaterMarkback to summary
public Http2Configuration.Http2ConfigurationBuilder streamsHighWaterMark(final float val)
See Also
setStreamsHighWaterMark(float)
threadPoolConfigback to summary
public Http2Configuration.Http2ConfigurationBuilder threadPoolConfig(final ThreadPoolConfig val)

Specifies a thread pool configuration that will be used to create a new ExecutorService handling HTTP/2 streams.