Class AsyncServerBootstrap
java.lang.Object
org.apache.hc.core5.http.impl.bootstrap.AsyncServerBootstrap
HttpAsyncServer bootstrap.- Since:
- 5.0
-
Method Summary
Modifier and TypeMethodDescriptionfinal AsyncServerBootstrapaddFilterAfter(String existing, String name, AsyncFilterHandler filterHandler) Adds the filter after the filter with the given name.final AsyncServerBootstrapaddFilterBefore(String existing, String name, AsyncFilterHandler filterHandler) Adds the filter before the filter with the given name.final AsyncServerBootstrapaddFilterFirst(String name, AsyncFilterHandler filterHandler) Adds an filter to the head of the processing list.final AsyncServerBootstrapaddFilterLast(String name, AsyncFilterHandler filterHandler) Adds an filter to the tail of the processing list.static AsyncServerBootstrapCreates a new AsyncServerBootstrap instance.create()final AsyncServerBootstrapregister(String hostname, String uriPattern, Supplier<AsyncServerExchangeHandler> supplier) Registers the givenAsyncServerExchangeHandlerSupplieras a handler for URIs matching the given host and pattern.final <T> AsyncServerBootstrapregister(String hostname, String uriPattern, AsyncServerRequestHandler<T> requestHandler) Registers the givenAsyncServerRequestHandleras a handler for URIs matching the given host and pattern.final AsyncServerBootstrapregister(String uriPattern, Supplier<AsyncServerExchangeHandler> supplier) Registers the givenAsyncServerExchangeHandlerSupplieras a default handler for URIs matching the given pattern.final <T> AsyncServerBootstrapregister(String uriPattern, AsyncServerRequestHandler<T> requestHandler) Registers the givenAsyncServerRequestHandleras a default handler for URIs matching the given pattern.final AsyncServerBootstrapregisterVirtual(String hostname, String uriPattern, Supplier<AsyncServerExchangeHandler> supplier) Deprecated.final <T> AsyncServerBootstrapregisterVirtual(String hostname, String uriPattern, AsyncServerRequestHandler<T> requestHandler) Deprecated.final AsyncServerBootstrapreplaceFilter(String existing, AsyncFilterHandler filterHandler) Replaces an existing filter with the given name with new filter.final AsyncServerBootstrapsetAuthorityResolver(BiFunction<String, URIAuthority, URIAuthority> authorityResolver) Sets authority resolver to be used when creating theRequestRouter.final AsyncServerBootstrapsetCanonicalHostName(String canonicalHostName) Sets canonical name (fully qualified domain name) of the server.final AsyncServerBootstrapsetCharCodingConfig(CharCodingConfig charCodingConfig) Sets char coding configuration.final AsyncServerBootstrapsetConnectionReuseStrategy(ConnectionReuseStrategy connStrategy) SetsConnectionReuseStrategyinstance.final AsyncServerBootstrapsetExceptionCallback(Callback<Exception> exceptionCallback) final AsyncServerBootstrapsetHttp1Config(Http1Config http1Config) Sets HTTP/1.1 protocol parameters.final AsyncServerBootstrapsetHttpProcessor(HttpProcessor httpProcessor) SetsHttpProcessorinstance.final AsyncServerBootstrapsetIOReactorConfig(IOReactorConfig ioReactorConfig) Sets I/O reactor configuration.final AsyncServerBootstrapsetIOReactorMetricsListener(IOReactorMetricsListener threadPoolListener) SetsIOReactorMetricsListenerinstance.final AsyncServerBootstrapsetIOSessionDecorator(Decorator<IOSession> ioSessionDecorator) final AsyncServerBootstrapsetIOSessionListener(IOSessionListener sessionListener) SetsIOSessionListenerinstance.final AsyncServerBootstrapsetLookupRegistry(LookupRegistry<Supplier<AsyncServerExchangeHandler>> lookupRegistry) Deprecated.UseRequestRouter.final AsyncServerBootstrapsetRequestRouter(HttpRequestMapper<Supplier<AsyncServerExchangeHandler>> requestRouter) SetsHttpRequestMapperinstance.final AsyncServerBootstrapsetStreamListener(Http1StreamListener streamListener) SetsHttp1StreamListenerinstance.final AsyncServerBootstrapsetTlsHandshakeTimeout(Timeout handshakeTimeout) Sets TLS handshakeTimeout.final AsyncServerBootstrapsetTlsStrategy(TlsStrategy tlsStrategy) SetsTlsStrategyinstance.
-
Method Details
-
bootstrap
Creates a new AsyncServerBootstrap instance.- Returns:
- a new AsyncServerBootstrap instance.
-
setCanonicalHostName
Sets canonical name (fully qualified domain name) of the server.- Parameters:
canonicalHostName- canonical name (fully qualified domain name) of the server.- Returns:
- this instance.
-
setIOReactorConfig
Sets I/O reactor configuration.- Parameters:
ioReactorConfig- I/O reactor configuration.- Returns:
- this instance.
-
setHttp1Config
Sets HTTP/1.1 protocol parameters.- Parameters:
http1Config- HTTP/1.1 protocol parameters.- Returns:
- this instance.
-
setCharCodingConfig
Sets char coding configuration.- Parameters:
charCodingConfig- char coding configuration.- Returns:
- this instance.
-
setHttpProcessor
SetsHttpProcessorinstance.- Parameters:
httpProcessor-HttpProcessorinstance.- Returns:
- this instance.
-
setConnectionReuseStrategy
SetsConnectionReuseStrategyinstance.- Parameters:
connStrategy-ConnectionReuseStrategyinstance.- Returns:
- this instance.
-
setTlsStrategy
SetsTlsStrategyinstance.- Parameters:
tlsStrategy-TlsStrategyinstance.- Returns:
- this instance.
-
setTlsHandshakeTimeout
Sets TLS handshakeTimeout.- Parameters:
handshakeTimeout- TLS handshakeTimeout.- Returns:
- this instance.
-
setIOSessionDecorator
-
setIOReactorMetricsListener
public final AsyncServerBootstrap setIOReactorMetricsListener(IOReactorMetricsListener threadPoolListener) SetsIOReactorMetricsListenerinstance.- Returns:
- this instance.
- Since:
- 5.4
-
setExceptionCallback
-
setIOSessionListener
SetsIOSessionListenerinstance.- Parameters:
sessionListener-IOSessionListenerinstance.- Returns:
- this instance.
-
setLookupRegistry
@Deprecated public final AsyncServerBootstrap setLookupRegistry(LookupRegistry<Supplier<AsyncServerExchangeHandler>> lookupRegistry) Deprecated.UseRequestRouter.Sets a LookupRegistry for Suppliers of AsyncServerExchangeHandler.- Parameters:
lookupRegistry- LookupRegistry for Suppliers of AsyncServerExchangeHandler.- Returns:
- this instance.
-
setRequestRouter
public final AsyncServerBootstrap setRequestRouter(HttpRequestMapper<Supplier<AsyncServerExchangeHandler>> requestRouter) SetsHttpRequestMapperinstance.- Parameters:
requestRouter-HttpRequestMapperinstance.- Returns:
- this instance.
- Since:
- 5.3
- See Also:
-
setStreamListener
SetsHttp1StreamListenerinstance.- Parameters:
streamListener-Http1StreamListenerinstance.- Returns:
- this instance.
- Since:
- 5.0
-
setAuthorityResolver
public final AsyncServerBootstrap setAuthorityResolver(BiFunction<String, URIAuthority, URIAuthority> authorityResolver) Sets authority resolver to be used when creating theRequestRouter.- Returns:
- this instance.
- Since:
- 5.4
-
register
public final AsyncServerBootstrap register(String uriPattern, Supplier<AsyncServerExchangeHandler> supplier) Registers the givenAsyncServerExchangeHandlerSupplieras a default handler for URIs matching the given pattern.- Parameters:
uriPattern- the non-null pattern to register the handler for.supplier- the non-null handler supplier.- Returns:
- this instance.
-
register
public final AsyncServerBootstrap register(String hostname, String uriPattern, Supplier<AsyncServerExchangeHandler> supplier) Registers the givenAsyncServerExchangeHandlerSupplieras a handler for URIs matching the given host and pattern.- Parameters:
hostname- the non-null host name.uriPattern- the non-null pattern to register the handler for.supplier- the non-null handler supplier.- Returns:
- this instance.
- Since:
- 5.3
-
registerVirtual
@Deprecated public final AsyncServerBootstrap registerVirtual(String hostname, String uriPattern, Supplier<AsyncServerExchangeHandler> supplier) Deprecated.Registers the givenAsyncServerExchangeHandlerSupplieras a handler for URIs matching the given host and pattern.- Parameters:
hostname- the host name.uriPattern- the pattern to register the handler for.supplier- the handler supplier.- Returns:
- this instance.
-
register
public final <T> AsyncServerBootstrap register(String uriPattern, AsyncServerRequestHandler<T> requestHandler) Registers the givenAsyncServerRequestHandleras a default handler for URIs matching the given pattern.- Type Parameters:
T- the AsyncServerRequestHandler request representation type.- Parameters:
uriPattern- the pattern to register the handler for.requestHandler- the handler.- Returns:
- this instance.
-
register
public final <T> AsyncServerBootstrap register(String hostname, String uriPattern, AsyncServerRequestHandler<T> requestHandler) Registers the givenAsyncServerRequestHandleras a handler for URIs matching the given host and pattern.- Type Parameters:
T- the request type.- 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> AsyncServerBootstrap registerVirtual(String hostname, String uriPattern, AsyncServerRequestHandler<T> requestHandler) Deprecated.- Type Parameters:
T- the request type.- Returns:
- this instance.
-
addFilterBefore
public final AsyncServerBootstrap addFilterBefore(String existing, String name, AsyncFilterHandler filterHandler) Adds the filter before the filter with the given name.- Returns:
- this instance.
-
addFilterAfter
public final AsyncServerBootstrap addFilterAfter(String existing, String name, AsyncFilterHandler filterHandler) Adds the filter after the filter with the given name.- Returns:
- this instance.
-
replaceFilter
Replaces an existing filter with the given name with new filter.- Returns:
- this instance.
-
addFilterFirst
Adds an filter to the head of the processing list.- Returns:
- this instance.
-
addFilterLast
Adds an filter to the tail of the processing list.- Returns:
- this instance.
-
create
-
register(String, String, Supplier).