Class H2ServerBootstrap
java.lang.Object
org.apache.hc.core5.http2.impl.nio.bootstrap.H2ServerBootstrap
HTTP/2 capable
HttpAsyncServer bootstrap.- Since:
- 5.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate CharCodingConfigprivate final List<FilterEntry<AsyncFilterHandler>> private H2Configprivate H2StreamListenerprivate final List<HandlerEntry<Supplier<AsyncServerExchangeHandler>>> private Timeoutprivate Http1Configprivate Http1StreamListenerprivate HttpProcessorprivate IOReactorConfigprivate LookupRegistry<Supplier<AsyncServerExchangeHandler>> private IOSessionListenerprivate TlsStrategyprivate HttpVersionPolicy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal H2ServerBootstrapaddFilterAfter(String existing, String name, AsyncFilterHandler filterHandler) Adds the filter after the filter with the given name.final H2ServerBootstrapaddFilterBefore(String existing, String name, AsyncFilterHandler filterHandler) Adds the filter before the filter with the given name.final H2ServerBootstrapaddFilterFirst(String name, AsyncFilterHandler filterHandler) Add an filter to the head of the processing list.final H2ServerBootstrapaddFilterLast(String name, AsyncFilterHandler filterHandler) Add an filter to the tail of the processing list.static H2ServerBootstrapcreate()final H2ServerBootstrapregister(String uriPattern, Supplier<AsyncServerExchangeHandler> supplier) Registers the givenAsyncServerExchangeHandlerSupplieras a default handler for URIs matching the given pattern.final <T> H2ServerBootstrapregister(String uriPattern, AsyncServerRequestHandler<T> requestHandler) Registers the givenAsyncServerRequestHandleras a default handler for URIs matching the given pattern.final H2ServerBootstrapregisterVirtual(String hostname, String uriPattern, Supplier<AsyncServerExchangeHandler> supplier) Registers the givenAsyncServerExchangeHandlerSupplieras a handler for URIs matching the given host and the pattern.final <T> H2ServerBootstrapregisterVirtual(String hostname, String uriPattern, AsyncServerRequestHandler<T> requestHandler) Registers the givenAsyncServerRequestHandleras a handler for URIs matching the given host and the pattern.final H2ServerBootstrapreplaceFilter(String existing, AsyncFilterHandler filterHandler) Replace an existing filter with the given name with new filter.final H2ServerBootstrapsetCanonicalHostName(String canonicalHostName) Sets canonical name (fully qualified domain name) of the server.final H2ServerBootstrapsetCharset(CharCodingConfig charCodingConfig) Sets message char coding.final H2ServerBootstrapsetExceptionCallback(Callback<Exception> exceptionCallback) final H2ServerBootstrapsetH2Config(H2Config h2Config) Sets HTTP/2 protocol parametersfinal H2ServerBootstrapsetHandshakeTimeout(Timeout handshakeTimeout) final H2ServerBootstrapsetHttp1Config(Http1Config http1Config) Sets HTTP/1.1 protocol parametersfinal H2ServerBootstrapsetHttpProcessor(HttpProcessor httpProcessor) AssignsHttpProcessorinstance.final H2ServerBootstrapsetIOReactorConfig(IOReactorConfig ioReactorConfig) Sets I/O reactor configuration.final H2ServerBootstrapsetIOSessionDecorator(Decorator<IOSession> ioSessionDecorator) final H2ServerBootstrapsetIOSessionListener(IOSessionListener sessionListener) AssignsIOSessionListenerinstance.final H2ServerBootstrapsetLookupRegistry(LookupRegistry<Supplier<AsyncServerExchangeHandler>> lookupRegistry) AssignsLookupRegistryinstance.final H2ServerBootstrapsetStreamListener(Http1StreamListener http1StreamListener) AssignsHttp1StreamListenerinstance.final H2ServerBootstrapsetStreamListener(H2StreamListener h2StreamListener) AssignsH2StreamListenerinstance.final H2ServerBootstrapsetTlsStrategy(TlsStrategy tlsStrategy) AssignsTlsStrategyinstance.final H2ServerBootstrapsetVersionPolicy(HttpVersionPolicy versionPolicy) Sets HTTP protocol version policy
-
Field Details
-
handlerList
-
filters
-
canonicalHostName
-
lookupRegistry
-
ioReactorConfig
-
httpProcessor
-
charCodingConfig
-
versionPolicy
-
h2Config
-
http1Config
-
tlsStrategy
-
handshakeTimeout
-
ioSessionDecorator
-
exceptionCallback
-
sessionListener
-
h2StreamListener
-
http1StreamListener
-
-
Constructor Details
-
H2ServerBootstrap
private H2ServerBootstrap()
-
-
Method Details
-
bootstrap
-
setCanonicalHostName
Sets canonical name (fully qualified domain name) of the server.- Since:
- 5.0
-
setIOReactorConfig
Sets I/O reactor configuration. -
setHttpProcessor
AssignsHttpProcessorinstance. -
setVersionPolicy
Sets HTTP protocol version policy -
setH2Config
Sets HTTP/2 protocol parameters -
setHttp1Config
Sets HTTP/1.1 protocol parameters -
setCharset
Sets message char coding. -
setTlsStrategy
AssignsTlsStrategyinstance. -
setHandshakeTimeout
-
setIOSessionDecorator
-
setExceptionCallback
-
setIOSessionListener
AssignsIOSessionListenerinstance. -
setStreamListener
AssignsH2StreamListenerinstance. -
setStreamListener
AssignsHttp1StreamListenerinstance. -
setLookupRegistry
public final H2ServerBootstrap setLookupRegistry(LookupRegistry<Supplier<AsyncServerExchangeHandler>> lookupRegistry) AssignsLookupRegistryinstance. -
register
public final H2ServerBootstrap register(String uriPattern, Supplier<AsyncServerExchangeHandler> supplier) Registers the givenAsyncServerExchangeHandlerSupplieras 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(String hostname, String uriPattern, Supplier<AsyncServerExchangeHandler> supplier) Registers the givenAsyncServerExchangeHandlerSupplieras 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(String uriPattern, AsyncServerRequestHandler<T> requestHandler) Registers the givenAsyncServerRequestHandleras 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(String hostname, String uriPattern, AsyncServerRequestHandler<T> requestHandler) Registers the givenAsyncServerRequestHandleras 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(String existing, String name, AsyncFilterHandler filterHandler) Adds the filter before the filter with the given name. -
addFilterAfter
public final H2ServerBootstrap addFilterAfter(String existing, String name, AsyncFilterHandler filterHandler) Adds the filter after the filter with the given name. -
replaceFilter
Replace an existing filter with the given name with new filter. -
addFilterFirst
Add an filter to the head of the processing list. -
addFilterLast
Add an filter to the tail of the processing list. -
create
-