Class H2ServerBootstrap
java.lang.Object
org.apache.hc.core5.http2.impl.nio.bootstrap.H2ServerBootstrap
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate CharCodingConfigprivate final List<FilterEntry<AsyncFilterHandler>> private FrameFactoryprivate H2Configprivate H2StreamListenerprivate Timeoutprivate Http1Configprivate Http1StreamListenerprivate HttpProcessorprivate IOReactorConfigprivate LookupRegistry<Supplier<AsyncServerExchangeHandler>> private final List<RequestRouter.Entry<Supplier<AsyncServerExchangeHandler>>> private IOSessionListenerprivate IOReactorMetricsListenerprivate 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 hostname, String uriPattern, Supplier<AsyncServerExchangeHandler> supplier) Registers the givenAsyncServerExchangeHandlerSupplieras a handler for URIs matching the given host and the pattern.final <T> H2ServerBootstrapregister(String hostname, String uriPattern, AsyncServerRequestHandler<T> requestHandler) Registers the givenAsyncServerRequestHandleras a handler for URIs matching the given host and the pattern.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) Deprecated.final <T> H2ServerBootstrapregisterVirtual(String hostname, String uriPattern, AsyncServerRequestHandler<T> requestHandler) Deprecated.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 H2ServerBootstrapsetFrameFactory(FrameFactory frameFactory) SetsFrameFactoryinstance.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) SetsHttpProcessorinstance.final H2ServerBootstrapsetIOReactorConfig(IOReactorConfig ioReactorConfig) Sets I/O reactor configuration.final H2ServerBootstrapsetIOReactorMetricsListener(IOReactorMetricsListener threadPoolListener) SetsIOReactorMetricsListenerinstance.final H2ServerBootstrapsetIOSessionDecorator(Decorator<IOSession> ioSessionDecorator) final H2ServerBootstrapsetIOSessionListener(IOSessionListener sessionListener) SetsIOSessionListenerinstance.final H2ServerBootstrapsetLookupRegistry(LookupRegistry<Supplier<AsyncServerExchangeHandler>> lookupRegistry) Deprecated.UseRequestRouter.final H2ServerBootstrapsetRequestRouter(HttpRequestMapper<Supplier<AsyncServerExchangeHandler>> requestRouter) SetsHttpRequestMapperinstance.final H2ServerBootstrapsetStreamListener(Http1StreamListener http1StreamListener) SetsHttp1StreamListenerinstance.final H2ServerBootstrapsetStreamListener(H2StreamListener h2StreamListener) SetsH2StreamListenerinstance.final H2ServerBootstrapsetTlsStrategy(TlsStrategy tlsStrategy) SetsTlsStrategyinstance.final H2ServerBootstrapsetVersionPolicy(HttpVersionPolicy versionPolicy) Sets HTTP protocol version policy
-
Field Details
-
routeEntries
-
filters
-
canonicalHostName
-
lookupRegistry
-
requestRouter
-
ioReactorConfig
-
httpProcessor
-
charCodingConfig
-
versionPolicy
-
h2Config
-
http1Config
-
tlsStrategy
-
handshakeTimeout
-
ioSessionDecorator
-
exceptionCallback
-
sessionListener
-
h2StreamListener
-
http1StreamListener
-
threadPoolListener
-
frameFactory
-
-
Constructor Details
-
H2ServerBootstrap
private H2ServerBootstrap()
-
-
Method Details
-
bootstrap
-
setCanonicalHostName
Sets canonical name (fully qualified domain name) of the server.- Returns:
- this instance.
- Since:
- 5.0
-
setIOReactorConfig
Sets I/O reactor configuration.- Returns:
- this instance.
-
setHttpProcessor
SetsHttpProcessorinstance.- Returns:
- this instance.
-
setVersionPolicy
Sets HTTP protocol version policy- Returns:
- this instance.
-
setH2Config
Sets HTTP/2 protocol parameters- Returns:
- this instance.
-
setHttp1Config
Sets HTTP/1.1 protocol parameters- Returns:
- this instance.
-
setCharset
Sets message char coding.- Returns:
- this instance.
-
setTlsStrategy
SetsTlsStrategyinstance.- Returns:
- this instance.
-
setHandshakeTimeout
-
setIOSessionDecorator
- Returns:
- this instance.
-
setIOReactorMetricsListener
public final H2ServerBootstrap setIOReactorMetricsListener(IOReactorMetricsListener threadPoolListener) SetsIOReactorMetricsListenerinstance.- Returns:
- this instance.
- Since:
- 5.4
-
setExceptionCallback
- Returns:
- this instance.
-
setIOSessionListener
SetsIOSessionListenerinstance.- Returns:
- this instance.
-
setStreamListener
SetsH2StreamListenerinstance.- Returns:
- this instance.
-
setFrameFactory
SetsFrameFactoryinstance.- Returns:
- this instance.
- Since:
- 5.4
-
setStreamListener
SetsHttp1StreamListenerinstance.- Returns:
- this instance.
-
setLookupRegistry
@Deprecated public final H2ServerBootstrap setLookupRegistry(LookupRegistry<Supplier<AsyncServerExchangeHandler>> lookupRegistry) Deprecated.UseRequestRouter.- Returns:
- this instance.
-
setRequestRouter
public final H2ServerBootstrap setRequestRouter(HttpRequestMapper<Supplier<AsyncServerExchangeHandler>> requestRouter) SetsHttpRequestMapperinstance.- Returns:
- this instance.
- Since:
- 5.3
- See Also:
-
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.- Returns:
- this instance.
-
register
public final H2ServerBootstrap register(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.- Returns:
- this instance.
- Since:
- 5.3
-
registerVirtual
@Deprecated public final H2ServerBootstrap registerVirtual(String hostname, String uriPattern, Supplier<AsyncServerExchangeHandler> supplier) Deprecated.- Returns:
- this instance.
-
register
public final <T> H2ServerBootstrap register(String uriPattern, AsyncServerRequestHandler<T> requestHandler) Registers the givenAsyncServerRequestHandleras a default handler for URIs matching the given pattern.- Type Parameters:
T- request handler representation.- Parameters:
uriPattern- the pattern to register the handler for.requestHandler- the handler.- Returns:
- this instance.
-
register
public final <T> H2ServerBootstrap register(String hostname, String uriPattern, AsyncServerRequestHandler<T> requestHandler) Registers the givenAsyncServerRequestHandleras a handler for URIs matching the given host and the pattern.- Type Parameters:
T- request handler representation.- Parameters:
hostname- the host nameuriPattern- the pattern to register the handler for.requestHandler- the handler.- Returns:
- this instance.
- Since:
- 5.3
-
registerVirtual
@Deprecated public final <T> H2ServerBootstrap registerVirtual(String hostname, String uriPattern, AsyncServerRequestHandler<T> requestHandler) Deprecated.- Type Parameters:
T- request handler representation.- Returns:
- this instance.
-
addFilterBefore
public final H2ServerBootstrap addFilterBefore(String existing, String name, AsyncFilterHandler filterHandler) Adds the filter before the filter with the given name.- Returns:
- this instance.
-
addFilterAfter
public final H2ServerBootstrap addFilterAfter(String existing, String name, AsyncFilterHandler filterHandler) Adds the filter after the filter with the given name.- Returns:
- this instance.
-
replaceFilter
Replace an existing filter with the given name with new filter.- Returns:
- this instance.
-
addFilterFirst
Add an filter to the head of the processing list.- Returns:
- this instance.
-
addFilterLast
Add an filter to the tail of the processing list.- Returns:
- this instance.
-
create
-
register(String, String, Supplier).