Top Description Fields Constructors Methods
org.apache.hc.core5.http2.impl.nio.bootstrap

public Class H2ServerBootstrap

extends Object
Class Inheritance
Imports
java.util.ArrayList, .List, org.apache.hc.core5.function.Callback, .Decorator, .Supplier, org.apache.hc.core5.http.config.CharCodingConfig, .Http1Config, .NamedElementChain, org.apache.hc.core5.http.impl.DefaultConnectionReuseStrategy, .DefaultContentLengthStrategy, .Http1StreamListener, .HttpProcessors, org.apache.hc.core5.http.impl.bootstrap.HttpAsyncServer, .StandardFilter, org.apache.hc.core5.http.impl.nio.DefaultHttpRequestParserFactory, .DefaultHttpResponseWriterFactory, .ServerHttp1StreamDuplexerFactory, org.apache.hc.core5.http.nio.AsyncFilterHandler, .AsyncServerExchangeHandler, .AsyncServerRequestHandler, .HandlerFactory, org.apache.hc.core5.http.nio.ssl.TlsStrategy, org.apache.hc.core5.http.nio.support.AsyncServerExpectationFilter, .AsyncServerFilterChainElement, .AsyncServerFilterChainExchangeHandlerFactory, .BasicAsyncServerExpectationDecorator, .BasicServerExchangeHandler, .DefaultAsyncResponseExchangeHandlerFactory, .TerminalAsyncServerFilter, org.apache.hc.core5.http.protocol.HttpProcessor, .LookupRegistry, .RequestHandlerRegistry, .UriPatternType, org.apache.hc.core5.http2.HttpVersionPolicy, org.apache.hc.core5.http2.config.H2Config, org.apache.hc.core5.http2.impl.H2Processors, org.apache.hc.core5.http2.impl.nio.H2StreamListener, .ServerH2StreamMultiplexerFactory, .ServerHttpProtocolNegotiationStarter, org.apache.hc.core5.http2.ssl.H2ServerTlsStrategy, org.apache.hc.core5.net.InetAddressUtils, org.apache.hc.core5.reactor.IOEventHandlerFactory, .IOReactorConfig, .IOSession, .IOSessionListener, org.apache.hc.core5.util.Args, .Timeout

HTTP/2 capable HttpAsyncServer bootstrap.
Since
5.0

Field Summary

Modifier and TypeField and Description
private String
private CharCodingConfig
private Callback<Exception>
private final List<FilterEntry<AsyncFilterHandler>>
private H2Config
private H2StreamListener
private final List<HandlerEntry<Supplier<AsyncServerExchangeHandler>>>
private Timeout
private Http1Config
private Http1StreamListener
private HttpProcessor
private IOReactorConfig
private Decorator<IOSession>
private LookupRegistry<Supplier<AsyncServerExchangeHandler>>
private IOSessionListener
private TlsStrategy
private HttpVersionPolicy

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public final H2ServerBootstrap
addFilterAfter(final String existing, final String name, final AsyncFilterHandler filterHandler)

Adds the filter after the filter with the given name.

public final H2ServerBootstrap
addFilterBefore(final String existing, final String name, final AsyncFilterHandler filterHandler)

Adds the filter before the filter with the given name.

public final H2ServerBootstrap
addFilterFirst(final String name, final AsyncFilterHandler filterHandler)

Add an filter to the head of the processing list.

public final H2ServerBootstrap
addFilterLast(final String name, final AsyncFilterHandler filterHandler)

Add an filter to the tail of the processing list.

public static H2ServerBootstrap
public HttpAsyncServer
public final H2ServerBootstrap
register(final String
the pattern to register the handler for.
uriPattern
,
final Supplier<AsyncServerExchangeHandler>
the handler supplier.
supplier
)

Registers the given AsyncServerExchangeHandler Supplier as a default handler for URIs matching the given pattern.

public final <T> H2ServerBootstrap
register(final String
the pattern to register the handler for.
uriPattern
,
final AsyncServerRequestHandler<T>
the handler.
requestHandler
)

Registers the given AsyncServerRequestHandler as a default handler for URIs matching the given pattern.

public final H2ServerBootstrap
registerVirtual(final String
the host name
hostname
,
final String
the pattern to register the handler for.
uriPattern
,
final Supplier<AsyncServerExchangeHandler>
the handler supplier.
supplier
)

Registers the given AsyncServerExchangeHandler Supplier as a handler for URIs matching the given host and the pattern.

public final <T> H2ServerBootstrap
registerVirtual(final String
the host name
hostname
,
final String
the pattern to register the handler for.
uriPattern
,
final AsyncServerRequestHandler<T>
the handler.
requestHandler
)

Registers the given AsyncServerRequestHandler as a handler for URIs matching the given host and the pattern.

public final H2ServerBootstrap
replaceFilter(final String existing, final AsyncFilterHandler filterHandler)

Replace an existing filter with the given name with new filter.

public final H2ServerBootstrap
setCanonicalHostName(final String canonicalHostName)

Sets canonical name (fully qualified domain name) of the server.

public final H2ServerBootstrap
setCharset(final CharCodingConfig charCodingConfig)

Sets message char coding.

public final H2ServerBootstrap
setExceptionCallback(final Callback<Exception> exceptionCallback)

Assigns Exception Callback instance.

public final H2ServerBootstrap
setH2Config(final H2Config h2Config)

Sets HTTP/2 protocol parameters

public final H2ServerBootstrap
setHandshakeTimeout(final Timeout handshakeTimeout)

public final H2ServerBootstrap
setHttp1Config(final Http1Config http1Config)

Sets HTTP/1.1 protocol parameters

public final H2ServerBootstrap
setHttpProcessor(final HttpProcessor httpProcessor)

Assigns HttpProcessor instance.

public final H2ServerBootstrap
setIOReactorConfig(final IOReactorConfig ioReactorConfig)

Sets I/O reactor configuration.

public final H2ServerBootstrap
setIOSessionDecorator(final Decorator<IOSession> ioSessionDecorator)

Assigns IOSession Decorator instance.

public final H2ServerBootstrap
setIOSessionListener(final IOSessionListener sessionListener)

Assigns IOSessionListener instance.

public final H2ServerBootstrap
public final H2ServerBootstrap
setStreamListener(final H2StreamListener h2StreamListener)

Assigns H2StreamListener instance.

public final H2ServerBootstrap
setStreamListener(final Http1StreamListener http1StreamListener)

Assigns Http1StreamListener instance.

public final H2ServerBootstrap
setTlsStrategy(final TlsStrategy tlsStrategy)

Assigns TlsStrategy instance.

public final H2ServerBootstrap
setVersionPolicy(final HttpVersionPolicy versionPolicy)

Sets HTTP protocol version policy

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

canonicalHostNameback to summary
private String canonicalHostName
charCodingConfigback to summary
private CharCodingConfig charCodingConfig
exceptionCallbackback to summary
private Callback<Exception> exceptionCallback
filtersback to summary
private final List<FilterEntry<AsyncFilterHandler>> filters
h2Configback to summary
private H2Config h2Config
h2StreamListenerback to summary
private H2StreamListener h2StreamListener
handlerListback to summary
private final List<HandlerEntry<Supplier<AsyncServerExchangeHandler>>> handlerList
handshakeTimeoutback to summary
private Timeout handshakeTimeout
http1Configback to summary
private Http1Config http1Config
http1StreamListenerback to summary
private Http1StreamListener http1StreamListener
httpProcessorback to summary
private HttpProcessor httpProcessor
ioReactorConfigback to summary
private IOReactorConfig ioReactorConfig
ioSessionDecoratorback to summary
private Decorator<IOSession> ioSessionDecorator
lookupRegistryback to summary
private LookupRegistry<Supplier<AsyncServerExchangeHandler>> lookupRegistry
sessionListenerback to summary
private IOSessionListener sessionListener
tlsStrategyback to summary
private TlsStrategy tlsStrategy
versionPolicyback to summary
private HttpVersionPolicy versionPolicy

Constructor Detail

H2ServerBootstrapback to summary
private H2ServerBootstrap()

Method Detail

addFilterAfterback to summary
public final H2ServerBootstrap addFilterAfter(final String existing, final String name, final AsyncFilterHandler filterHandler)

Adds the filter after the filter with the given name.

addFilterBeforeback to summary
public final H2ServerBootstrap addFilterBefore(final String existing, final String name, final AsyncFilterHandler filterHandler)

Adds the filter before the filter with the given name.

addFilterFirstback to summary
public final H2ServerBootstrap addFilterFirst(final String name, final AsyncFilterHandler filterHandler)

Add an filter to the head of the processing list.

addFilterLastback to summary
public final H2ServerBootstrap addFilterLast(final String name, final AsyncFilterHandler filterHandler)

Add an filter to the tail of the processing list.

bootstrapback to summary
public static H2ServerBootstrap bootstrap()
createback to summary
public HttpAsyncServer create()
registerback to summary
public final H2ServerBootstrap register(final String uriPattern, final Supplier<AsyncServerExchangeHandler> supplier)

Registers the given AsyncServerExchangeHandler Supplier as a default handler for URIs matching the given pattern.

Parameters
uriPattern:String

the pattern to register the handler for.

supplier:Supplier<AsyncServerExchangeHandler>

the handler supplier.

registerback to summary
public final <T> H2ServerBootstrap register(final String uriPattern, final AsyncServerRequestHandler<T> requestHandler)

Registers the given AsyncServerRequestHandler as a default handler for URIs matching the given pattern.

Parameters
uriPattern:String

the pattern to register the handler for.

requestHandler:AsyncServerRequestHandler<T>

the handler.

registerVirtualback to summary
public final H2ServerBootstrap registerVirtual(final String hostname, final String uriPattern, final Supplier<AsyncServerExchangeHandler> supplier)

Registers the given AsyncServerExchangeHandler Supplier as a handler for URIs matching the given host and the pattern.

Parameters
hostname:String

the host name

uriPattern:String

the pattern to register the handler for.

supplier:Supplier<AsyncServerExchangeHandler>

the handler supplier.

registerVirtualback to summary
public final <T> H2ServerBootstrap registerVirtual(final String hostname, final String uriPattern, final AsyncServerRequestHandler<T> requestHandler)

Registers the given AsyncServerRequestHandler as a handler for URIs matching the given host and the pattern.

Parameters
hostname:String

the host name

uriPattern:String

the pattern to register the handler for.

requestHandler:AsyncServerRequestHandler<T>

the handler.

replaceFilterback to summary
public final H2ServerBootstrap replaceFilter(final String existing, final AsyncFilterHandler filterHandler)

Replace an existing filter with the given name with new filter.

setCanonicalHostNameback to summary
public final H2ServerBootstrap setCanonicalHostName(final String canonicalHostName)

Sets canonical name (fully qualified domain name) of the server.

Since
5.0
setCharsetback to summary
public final H2ServerBootstrap setCharset(final CharCodingConfig charCodingConfig)

Sets message char coding.

setExceptionCallbackback to summary
public final H2ServerBootstrap setExceptionCallback(final Callback<Exception> exceptionCallback)

Assigns Exception Callback instance.

setH2Configback to summary
public final H2ServerBootstrap setH2Config(final H2Config h2Config)

Sets HTTP/2 protocol parameters

setHandshakeTimeoutback to summary
public final H2ServerBootstrap setHandshakeTimeout(final Timeout handshakeTimeout)
setHttp1Configback to summary
public final H2ServerBootstrap setHttp1Config(final Http1Config http1Config)

Sets HTTP/1.1 protocol parameters

setHttpProcessorback to summary
public final H2ServerBootstrap setHttpProcessor(final HttpProcessor httpProcessor)

Assigns HttpProcessor instance.

setIOReactorConfigback to summary
public final H2ServerBootstrap setIOReactorConfig(final IOReactorConfig ioReactorConfig)

Sets I/O reactor configuration.

setIOSessionDecoratorback to summary
public final H2ServerBootstrap setIOSessionDecorator(final Decorator<IOSession> ioSessionDecorator)

Assigns IOSession Decorator instance.

setIOSessionListenerback to summary
public final H2ServerBootstrap setIOSessionListener(final IOSessionListener sessionListener)

Assigns IOSessionListener instance.

setLookupRegistryback to summary
public final H2ServerBootstrap setLookupRegistry(final LookupRegistry<Supplier<AsyncServerExchangeHandler>> lookupRegistry)

Assigns LookupRegistry instance.

setStreamListenerback to summary
public final H2ServerBootstrap setStreamListener(final H2StreamListener h2StreamListener)

Assigns H2StreamListener instance.

setStreamListenerback to summary
public final H2ServerBootstrap setStreamListener(final Http1StreamListener http1StreamListener)

Assigns Http1StreamListener instance.

setTlsStrategyback to summary
public final H2ServerBootstrap setTlsStrategy(final TlsStrategy tlsStrategy)

Assigns TlsStrategy instance.

setVersionPolicyback to summary
public final H2ServerBootstrap setVersionPolicy(final HttpVersionPolicy versionPolicy)

Sets HTTP protocol version policy