T
- The type of handler created by this builder.B
- The concrete type of this builder.@UnstableApi public abstract class AbstractHttp2ConnectionHandlerBuilder<T extends Http2ConnectionHandler,B extends AbstractHttp2ConnectionHandlerBuilder<T,B>> extends Object
Http2ConnectionHandler
instances.
Http2ConnectionHandler
Http2ConnectionHandler
build()
to build a new
Http2ConnectionHandler
. Setting the following properties are prohibited because they are used for
other ways of building a Http2ConnectionHandler
.
conflicts with this option:
Http2ConnectionHandler
you specifiedconnection(Http2Connection)
to tell the builder that you want to build the handler from the
Http2Connection
you specified. Setting the following properties are prohibited and thus will trigger
an IllegalStateException
because they conflict with this option.
Http2ConnectionDecoder
and Http2ConnectionEncoder
you specifiedcodec(Http2ConnectionDecoder, Http2ConnectionEncoder)
to tell the builder that you want to built the
handler from the Http2ConnectionDecoder
and Http2ConnectionEncoder
you specified. Setting the
following properties are prohibited and thus will trigger an IllegalStateException
because they conflict
with this option:
server(boolean)
connection(Http2Connection)
frameLogger(Http2FrameLogger)
#headerSensitivityDetector(SensitivityDetector)
encoderEnforceMaxConcurrentStreams(boolean)
encoderIgnoreMaxHeaderListSize(boolean)
build()
method and all property access methods are protected
. Choose the methods to expose to the
users of your builder implementation and make them public
.Constructor and Description |
---|
AbstractHttp2ConnectionHandlerBuilder() |
Modifier and Type | Method and Description |
---|---|
protected T |
build()
Create a new
Http2ConnectionHandler . |
protected abstract T |
build(Http2ConnectionDecoder decoder,
Http2ConnectionEncoder encoder,
Http2Settings initialSettings)
Implement this method to create a new
Http2ConnectionHandler or its subtype instance. |
protected B |
codec(Http2ConnectionDecoder decoder,
Http2ConnectionEncoder encoder)
Sets the
Http2ConnectionDecoder and Http2ConnectionEncoder to use. |
protected Http2Connection |
connection()
Returns the
Http2Connection to use. |
protected B |
connection(Http2Connection connection)
Sets the
Http2Connection to use. |
protected Http2ConnectionDecoder |
decoder()
Returns the
Http2ConnectionDecoder to use. |
protected Http2ConnectionEncoder |
encoder()
Returns the
Http2ConnectionEncoder to use. |
protected boolean |
encoderEnforceMaxConcurrentStreams()
Returns if the encoder should queue frames if the maximum number of concurrent streams
would otherwise be exceeded.
|
protected B |
encoderEnforceMaxConcurrentStreams(boolean encoderEnforceMaxConcurrentStreams)
Sets if the encoder should queue frames if the maximum number of concurrent streams
would otherwise be exceeded.
|
protected B |
encoderIgnoreMaxHeaderListSize(boolean ignoreMaxHeaderListSize)
Sets if the SETTINGS_MAX_HEADER_LIST_SIZE
should be ignored when encoding headers.
|
protected Http2FrameListener |
frameListener()
Returns the listener of inbound frames.
|
protected B |
frameListener(Http2FrameListener frameListener)
Sets the listener of inbound frames.
|
protected Http2FrameLogger |
frameLogger()
Returns the logger that is used for the encoder and decoder.
|
protected B |
frameLogger(Http2FrameLogger frameLogger)
Sets the logger that is used for the encoder and decoder.
|
protected long |
gracefulShutdownTimeoutMillis()
Returns the graceful shutdown timeout of the
Http2Connection in milliseconds. |
protected B |
gracefulShutdownTimeoutMillis(long gracefulShutdownTimeoutMillis)
Sets the graceful shutdown timeout of the
Http2Connection in milliseconds. |
protected Http2HeadersEncoder.SensitivityDetector |
headerSensitivityDetector()
Returns the
Http2HeadersEncoder.SensitivityDetector to use. |
protected B |
headerSensitivityDetector(Http2HeadersEncoder.SensitivityDetector headerSensitivityDetector)
Sets the
Http2HeadersEncoder.SensitivityDetector to use. |
protected Http2Settings |
initialSettings()
Sets the
Http2Settings to use for the initial connection settings exchange. |
protected B |
initialSettings(Http2Settings settings)
Sets the
Http2Settings to use for the initial connection settings exchange. |
protected boolean |
isServer()
|
protected boolean |
isValidateHeaders()
Returns if HTTP headers should be validated according to
RFC 7540, 8.1.2.6.
|
protected int |
maxReservedStreams()
Get the maximum number of streams which can be in the reserved state at any given time.
|
protected B |
maxReservedStreams(int maxReservedStreams)
Set the maximum number of streams which can be in the reserved state at any given time.
|
protected B |
self()
Returns
this . |
protected B |
server(boolean isServer)
|
protected B |
validateHeaders(boolean validateHeaders)
Sets if HTTP headers should be validated according to
RFC 7540, 8.1.2.6.
|
public AbstractHttp2ConnectionHandlerBuilder()
protected Http2Settings initialSettings()
Http2Settings
to use for the initial connection settings exchange.protected B initialSettings(Http2Settings settings)
Http2Settings
to use for the initial connection settings exchange.protected Http2FrameListener frameListener()
Http2FrameListener
if set, or null
if not set.protected B frameListener(Http2FrameListener frameListener)
null
.protected long gracefulShutdownTimeoutMillis()
Http2Connection
in milliseconds.protected B gracefulShutdownTimeoutMillis(long gracefulShutdownTimeoutMillis)
Http2Connection
in milliseconds.protected boolean isServer()
protected B server(boolean isServer)
protected int maxReservedStreams()
By default this value will be ignored on the server for local endpoint. This is because the RFC provides no way to explicitly communicate a limit to how many states can be in the reserved state, and instead relies on the peer to send RST_STREAM frames when they will be rejected.
protected B maxReservedStreams(int maxReservedStreams)
protected Http2Connection connection()
Http2Connection
to use.Http2Connection
if set, or null
if not set.protected B connection(Http2Connection connection)
Http2Connection
to use.protected Http2ConnectionDecoder decoder()
Http2ConnectionDecoder
to use.Http2ConnectionDecoder
if set, or null
if not set.protected Http2ConnectionEncoder encoder()
Http2ConnectionEncoder
to use.Http2ConnectionEncoder
if set, or null
if not set.protected B codec(Http2ConnectionDecoder decoder, Http2ConnectionEncoder encoder)
Http2ConnectionDecoder
and Http2ConnectionEncoder
to use.protected boolean isValidateHeaders()
protected B validateHeaders(boolean validateHeaders)
protected Http2FrameLogger frameLogger()
Http2FrameLogger
if set, or null
if not set.protected B frameLogger(Http2FrameLogger frameLogger)
protected boolean encoderEnforceMaxConcurrentStreams()
protected B encoderEnforceMaxConcurrentStreams(boolean encoderEnforceMaxConcurrentStreams)
protected Http2HeadersEncoder.SensitivityDetector headerSensitivityDetector()
Http2HeadersEncoder.SensitivityDetector
to use.protected B headerSensitivityDetector(Http2HeadersEncoder.SensitivityDetector headerSensitivityDetector)
Http2HeadersEncoder.SensitivityDetector
to use.protected B encoderIgnoreMaxHeaderListSize(boolean ignoreMaxHeaderListSize)
ignoreMaxHeaderListSize
- true
to ignore
SETTINGS_MAX_HEADER_LIST_SIZE.protected T build()
Http2ConnectionHandler
.protected abstract T build(Http2ConnectionDecoder decoder, Http2ConnectionEncoder encoder, Http2Settings initialSettings) throws Exception
Http2ConnectionHandler
or its subtype instance.
The return of this method will be subject to the following:
frameListener(Http2FrameListener)
will be set if not already set in the decodergracefulShutdownTimeoutMillis(long)
will always be setException
protected final B self()
this
.Copyright © 2008–2017 The Netty Project. All rights reserved.