Class H2ServerBootstrap
- java.lang.Object
-
- org.apache.hc.core5.http2.impl.nio.bootstrap.H2ServerBootstrap
-
public class H2ServerBootstrap extends java.lang.Object
HTTP/2 capableHttpAsyncServer
bootstrap.- Since:
- 5.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
canonicalHostName
private CharCodingConfig
charCodingConfig
private Callback<java.lang.Exception>
exceptionCallback
private java.util.List<FilterEntry<AsyncFilterHandler>>
filters
private H2Config
h2Config
private H2StreamListener
h2StreamListener
private java.util.List<HandlerEntry<Supplier<AsyncServerExchangeHandler>>>
handlerList
private Timeout
handshakeTimeout
private Http1Config
http1Config
private Http1StreamListener
http1StreamListener
private HttpProcessor
httpProcessor
private IOReactorConfig
ioReactorConfig
private Decorator<IOSession>
ioSessionDecorator
private LookupRegistry<Supplier<AsyncServerExchangeHandler>>
lookupRegistry
private IOSessionListener
sessionListener
private TlsStrategy
tlsStrategy
private HttpVersionPolicy
versionPolicy
-
Constructor Summary
Constructors Modifier Constructor Description private
H2ServerBootstrap()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description H2ServerBootstrap
addFilterAfter(java.lang.String existing, java.lang.String name, AsyncFilterHandler filterHandler)
Adds the filter after the filter with the given name.H2ServerBootstrap
addFilterBefore(java.lang.String existing, java.lang.String name, AsyncFilterHandler filterHandler)
Adds the filter before the filter with the given name.H2ServerBootstrap
addFilterFirst(java.lang.String name, AsyncFilterHandler filterHandler)
Add an filter to the head of the processing list.H2ServerBootstrap
addFilterLast(java.lang.String name, AsyncFilterHandler filterHandler)
Add an filter to the tail of the processing list.static H2ServerBootstrap
bootstrap()
HttpAsyncServer
create()
H2ServerBootstrap
register(java.lang.String uriPattern, Supplier<AsyncServerExchangeHandler> supplier)
Registers the givenAsyncServerExchangeHandler
Supplier
as a default handler for URIs matching the given pattern.<T> H2ServerBootstrap
register(java.lang.String uriPattern, AsyncServerRequestHandler<T> requestHandler)
Registers the givenAsyncServerRequestHandler
as a default handler for URIs matching the given pattern.H2ServerBootstrap
registerVirtual(java.lang.String hostname, java.lang.String uriPattern, Supplier<AsyncServerExchangeHandler> supplier)
Registers the givenAsyncServerExchangeHandler
Supplier
as a handler for URIs matching the given host and the pattern.<T> H2ServerBootstrap
registerVirtual(java.lang.String hostname, java.lang.String uriPattern, AsyncServerRequestHandler<T> requestHandler)
Registers the givenAsyncServerRequestHandler
as a handler for URIs matching the given host and the pattern.H2ServerBootstrap
replaceFilter(java.lang.String existing, AsyncFilterHandler filterHandler)
Replace an existing filter with the given name with new filter.H2ServerBootstrap
setCanonicalHostName(java.lang.String canonicalHostName)
Sets canonical name (fully qualified domain name) of the server.H2ServerBootstrap
setCharset(CharCodingConfig charCodingConfig)
Sets message char coding.H2ServerBootstrap
setExceptionCallback(Callback<java.lang.Exception> exceptionCallback)
AssignsException
Callback
instance.H2ServerBootstrap
setH2Config(H2Config h2Config)
Sets HTTP/2 protocol parametersH2ServerBootstrap
setHandshakeTimeout(Timeout handshakeTimeout)
H2ServerBootstrap
setHttp1Config(Http1Config http1Config)
Sets HTTP/1.1 protocol parametersH2ServerBootstrap
setHttpProcessor(HttpProcessor httpProcessor)
AssignsHttpProcessor
instance.H2ServerBootstrap
setIOReactorConfig(IOReactorConfig ioReactorConfig)
Sets I/O reactor configuration.H2ServerBootstrap
setIOSessionDecorator(Decorator<IOSession> ioSessionDecorator)
H2ServerBootstrap
setIOSessionListener(IOSessionListener sessionListener)
AssignsIOSessionListener
instance.H2ServerBootstrap
setLookupRegistry(LookupRegistry<Supplier<AsyncServerExchangeHandler>> lookupRegistry)
AssignsLookupRegistry
instance.H2ServerBootstrap
setStreamListener(Http1StreamListener http1StreamListener)
AssignsHttp1StreamListener
instance.H2ServerBootstrap
setStreamListener(H2StreamListener h2StreamListener)
AssignsH2StreamListener
instance.H2ServerBootstrap
setTlsStrategy(TlsStrategy tlsStrategy)
AssignsTlsStrategy
instance.H2ServerBootstrap
setVersionPolicy(HttpVersionPolicy versionPolicy)
Sets HTTP protocol version policy
-
-
-
Field Detail
-
handlerList
private final java.util.List<HandlerEntry<Supplier<AsyncServerExchangeHandler>>> handlerList
-
filters
private final java.util.List<FilterEntry<AsyncFilterHandler>> filters
-
canonicalHostName
private java.lang.String canonicalHostName
-
lookupRegistry
private LookupRegistry<Supplier<AsyncServerExchangeHandler>> lookupRegistry
-
ioReactorConfig
private IOReactorConfig ioReactorConfig
-
httpProcessor
private HttpProcessor httpProcessor
-
charCodingConfig
private CharCodingConfig charCodingConfig
-
versionPolicy
private HttpVersionPolicy versionPolicy
-
h2Config
private H2Config h2Config
-
http1Config
private Http1Config http1Config
-
tlsStrategy
private TlsStrategy tlsStrategy
-
handshakeTimeout
private Timeout handshakeTimeout
-
exceptionCallback
private Callback<java.lang.Exception> exceptionCallback
-
sessionListener
private IOSessionListener sessionListener
-
h2StreamListener
private H2StreamListener h2StreamListener
-
http1StreamListener
private Http1StreamListener http1StreamListener
-
-
Method Detail
-
bootstrap
public static H2ServerBootstrap bootstrap()
-
setCanonicalHostName
public final H2ServerBootstrap setCanonicalHostName(java.lang.String canonicalHostName)
Sets canonical name (fully qualified domain name) of the server.- Since:
- 5.0
-
setIOReactorConfig
public final H2ServerBootstrap setIOReactorConfig(IOReactorConfig ioReactorConfig)
Sets I/O reactor configuration.
-
setHttpProcessor
public final H2ServerBootstrap setHttpProcessor(HttpProcessor httpProcessor)
AssignsHttpProcessor
instance.
-
setVersionPolicy
public final H2ServerBootstrap setVersionPolicy(HttpVersionPolicy versionPolicy)
Sets HTTP protocol version policy
-
setH2Config
public final H2ServerBootstrap setH2Config(H2Config h2Config)
Sets HTTP/2 protocol parameters
-
setHttp1Config
public final H2ServerBootstrap setHttp1Config(Http1Config http1Config)
Sets HTTP/1.1 protocol parameters
-
setCharset
public final H2ServerBootstrap setCharset(CharCodingConfig charCodingConfig)
Sets message char coding.
-
setTlsStrategy
public final H2ServerBootstrap setTlsStrategy(TlsStrategy tlsStrategy)
AssignsTlsStrategy
instance.
-
setHandshakeTimeout
public final H2ServerBootstrap setHandshakeTimeout(Timeout handshakeTimeout)
-
setIOSessionDecorator
public final H2ServerBootstrap setIOSessionDecorator(Decorator<IOSession> ioSessionDecorator)
-
setExceptionCallback
public final H2ServerBootstrap setExceptionCallback(Callback<java.lang.Exception> exceptionCallback)
AssignsException
Callback
instance.
-
setIOSessionListener
public final H2ServerBootstrap setIOSessionListener(IOSessionListener sessionListener)
AssignsIOSessionListener
instance.
-
setStreamListener
public final H2ServerBootstrap setStreamListener(H2StreamListener h2StreamListener)
AssignsH2StreamListener
instance.
-
setStreamListener
public final H2ServerBootstrap setStreamListener(Http1StreamListener http1StreamListener)
AssignsHttp1StreamListener
instance.
-
setLookupRegistry
public final H2ServerBootstrap setLookupRegistry(LookupRegistry<Supplier<AsyncServerExchangeHandler>> lookupRegistry)
AssignsLookupRegistry
instance.
-
register
public final H2ServerBootstrap register(java.lang.String uriPattern, Supplier<AsyncServerExchangeHandler> supplier)
Registers the givenAsyncServerExchangeHandler
Supplier
as a default handler for URIs matching the given pattern.- Parameters:
uriPattern
- the pattern to register the handler for.supplier
- the handler supplier.
-
registerVirtual
public final H2ServerBootstrap registerVirtual(java.lang.String hostname, java.lang.String uriPattern, Supplier<AsyncServerExchangeHandler> supplier)
Registers the givenAsyncServerExchangeHandler
Supplier
as a handler for URIs matching the given host and the pattern.- Parameters:
hostname
- the host nameuriPattern
- the pattern to register the handler for.supplier
- the handler supplier.
-
register
public final <T> H2ServerBootstrap register(java.lang.String uriPattern, AsyncServerRequestHandler<T> requestHandler)
Registers the givenAsyncServerRequestHandler
as a default handler for URIs matching the given pattern.- Parameters:
uriPattern
- the pattern to register the handler for.requestHandler
- the handler.
-
registerVirtual
public final <T> H2ServerBootstrap registerVirtual(java.lang.String hostname, java.lang.String uriPattern, AsyncServerRequestHandler<T> requestHandler)
Registers the givenAsyncServerRequestHandler
as a handler for URIs matching the given host and the pattern.- Parameters:
hostname
- the host nameuriPattern
- the pattern to register the handler for.requestHandler
- the handler.
-
addFilterBefore
public final H2ServerBootstrap addFilterBefore(java.lang.String existing, java.lang.String name, AsyncFilterHandler filterHandler)
Adds the filter before the filter with the given name.
-
addFilterAfter
public final H2ServerBootstrap addFilterAfter(java.lang.String existing, java.lang.String name, AsyncFilterHandler filterHandler)
Adds the filter after the filter with the given name.
-
replaceFilter
public final H2ServerBootstrap replaceFilter(java.lang.String existing, AsyncFilterHandler filterHandler)
Replace an existing filter with the given name with new filter.
-
addFilterFirst
public final H2ServerBootstrap addFilterFirst(java.lang.String name, AsyncFilterHandler filterHandler)
Add an filter to the head of the processing list.
-
addFilterLast
public final H2ServerBootstrap addFilterLast(java.lang.String name, AsyncFilterHandler filterHandler)
Add an filter to the tail of the processing list.
-
create
public HttpAsyncServer create()
-
-