Class AsyncServerBootstrap
- java.lang.Object
-
- org.apache.hc.core5.http.impl.bootstrap.AsyncServerBootstrap
-
public class AsyncServerBootstrap extends java.lang.ObjectHttpAsyncServerbootstrap.- Since:
- 5.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringcanonicalHostNameprivate CharCodingConfigcharCodingConfigprivate ConnectionReuseStrategyconnStrategyprivate Callback<java.lang.Exception>exceptionCallbackprivate java.util.List<FilterEntry<AsyncFilterHandler>>filtersprivate java.util.List<HandlerEntry<Supplier<AsyncServerExchangeHandler>>>handlerListprivate TimeouthandshakeTimeoutprivate Http1Confighttp1Configprivate HttpProcessorhttpProcessorprivate IOReactorConfigioReactorConfigprivate Decorator<IOSession>ioSessionDecoratorprivate LookupRegistry<Supplier<AsyncServerExchangeHandler>>lookupRegistryprivate IOSessionListenersessionListenerprivate Http1StreamListenerstreamListenerprivate TlsStrategytlsStrategy
-
Constructor Summary
Constructors Modifier Constructor Description privateAsyncServerBootstrap()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AsyncServerBootstrapaddFilterAfter(java.lang.String existing, java.lang.String name, AsyncFilterHandler filterHandler)Adds the filter after the filter with the given name.AsyncServerBootstrapaddFilterBefore(java.lang.String existing, java.lang.String name, AsyncFilterHandler filterHandler)Adds the filter before the filter with the given name.AsyncServerBootstrapaddFilterFirst(java.lang.String name, AsyncFilterHandler filterHandler)Add an filter to the head of the processing list.AsyncServerBootstrapaddFilterLast(java.lang.String name, AsyncFilterHandler filterHandler)Add an filter to the tail of the processing list.static AsyncServerBootstrapbootstrap()HttpAsyncServercreate()AsyncServerBootstrapregister(java.lang.String uriPattern, Supplier<AsyncServerExchangeHandler> supplier)Registers the givenAsyncServerExchangeHandlerSupplieras a default handler for URIs matching the given pattern.<T> AsyncServerBootstrapregister(java.lang.String uriPattern, AsyncServerRequestHandler<T> requestHandler)Registers the givenAsyncServerRequestHandleras a default handler for URIs matching the given pattern.AsyncServerBootstrapregisterVirtual(java.lang.String hostname, java.lang.String uriPattern, Supplier<AsyncServerExchangeHandler> supplier)Registers the givenAsyncServerExchangeHandlerSupplieras a handler for URIs matching the given host and the pattern.<T> AsyncServerBootstrapregisterVirtual(java.lang.String hostname, java.lang.String uriPattern, AsyncServerRequestHandler<T> requestHandler)Registers the givenAsyncServerRequestHandleras a handler for URIs matching the given host and the pattern.AsyncServerBootstrapreplaceFilter(java.lang.String existing, AsyncFilterHandler filterHandler)Replace an existing filter with the given name with new filter.AsyncServerBootstrapsetCanonicalHostName(java.lang.String canonicalHostName)Sets canonical name (fully qualified domain name) of the server.AsyncServerBootstrapsetCharCodingConfig(CharCodingConfig charCodingConfig)Sets connection configuration.AsyncServerBootstrapsetConnectionReuseStrategy(ConnectionReuseStrategy connStrategy)AssignsConnectionReuseStrategyinstance.AsyncServerBootstrapsetExceptionCallback(Callback<java.lang.Exception> exceptionCallback)AssignsExceptionCallbackinstance.AsyncServerBootstrapsetHttp1Config(Http1Config http1Config)Sets HTTP/1.1 protocol parameters.AsyncServerBootstrapsetHttpProcessor(HttpProcessor httpProcessor)AssignsHttpProcessorinstance.AsyncServerBootstrapsetIOReactorConfig(IOReactorConfig ioReactorConfig)Sets I/O reactor configuration.AsyncServerBootstrapsetIOSessionDecorator(Decorator<IOSession> ioSessionDecorator)AsyncServerBootstrapsetIOSessionListener(IOSessionListener sessionListener)AssignsIOSessionListenerinstance.AsyncServerBootstrapsetLookupRegistry(LookupRegistry<Supplier<AsyncServerExchangeHandler>> lookupRegistry)AssignsLookupRegistryinstance.AsyncServerBootstrapsetStreamListener(Http1StreamListener streamListener)AssignsHttp1StreamListenerinstance.AsyncServerBootstrapsetTlsHandshakeTimeout(Timeout handshakeTimeout)Assigns TLS handshakeTimeout.AsyncServerBootstrapsetTlsStrategy(TlsStrategy tlsStrategy)AssignsTlsStrategyinstance.
-
-
-
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
-
http1Config
private Http1Config http1Config
-
charCodingConfig
private CharCodingConfig charCodingConfig
-
httpProcessor
private HttpProcessor httpProcessor
-
connStrategy
private ConnectionReuseStrategy connStrategy
-
tlsStrategy
private TlsStrategy tlsStrategy
-
handshakeTimeout
private Timeout handshakeTimeout
-
exceptionCallback
private Callback<java.lang.Exception> exceptionCallback
-
sessionListener
private IOSessionListener sessionListener
-
streamListener
private Http1StreamListener streamListener
-
-
Method Detail
-
bootstrap
public static AsyncServerBootstrap bootstrap()
-
setCanonicalHostName
public final AsyncServerBootstrap setCanonicalHostName(java.lang.String canonicalHostName)
Sets canonical name (fully qualified domain name) of the server.
-
setIOReactorConfig
public final AsyncServerBootstrap setIOReactorConfig(IOReactorConfig ioReactorConfig)
Sets I/O reactor configuration.
-
setHttp1Config
public final AsyncServerBootstrap setHttp1Config(Http1Config http1Config)
Sets HTTP/1.1 protocol parameters.
-
setCharCodingConfig
public final AsyncServerBootstrap setCharCodingConfig(CharCodingConfig charCodingConfig)
Sets connection configuration.
-
setHttpProcessor
public final AsyncServerBootstrap setHttpProcessor(HttpProcessor httpProcessor)
AssignsHttpProcessorinstance.
-
setConnectionReuseStrategy
public final AsyncServerBootstrap setConnectionReuseStrategy(ConnectionReuseStrategy connStrategy)
AssignsConnectionReuseStrategyinstance.
-
setTlsStrategy
public final AsyncServerBootstrap setTlsStrategy(TlsStrategy tlsStrategy)
AssignsTlsStrategyinstance.
-
setTlsHandshakeTimeout
public final AsyncServerBootstrap setTlsHandshakeTimeout(Timeout handshakeTimeout)
Assigns TLS handshakeTimeout.
-
setIOSessionDecorator
public final AsyncServerBootstrap setIOSessionDecorator(Decorator<IOSession> ioSessionDecorator)
-
setExceptionCallback
public final AsyncServerBootstrap setExceptionCallback(Callback<java.lang.Exception> exceptionCallback)
AssignsExceptionCallbackinstance.
-
setIOSessionListener
public final AsyncServerBootstrap setIOSessionListener(IOSessionListener sessionListener)
AssignsIOSessionListenerinstance.
-
setLookupRegistry
public final AsyncServerBootstrap setLookupRegistry(LookupRegistry<Supplier<AsyncServerExchangeHandler>> lookupRegistry)
AssignsLookupRegistryinstance.
-
setStreamListener
public final AsyncServerBootstrap setStreamListener(Http1StreamListener streamListener)
AssignsHttp1StreamListenerinstance.- Since:
- 5.0
-
register
public final AsyncServerBootstrap register(java.lang.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 AsyncServerBootstrap registerVirtual(java.lang.String hostname, java.lang.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> AsyncServerBootstrap register(java.lang.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> AsyncServerBootstrap registerVirtual(java.lang.String hostname, java.lang.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 AsyncServerBootstrap addFilterBefore(java.lang.String existing, java.lang.String name, AsyncFilterHandler filterHandler)
Adds the filter before the filter with the given name.
-
addFilterAfter
public final AsyncServerBootstrap addFilterAfter(java.lang.String existing, java.lang.String name, AsyncFilterHandler filterHandler)
Adds the filter after the filter with the given name.
-
replaceFilter
public final AsyncServerBootstrap replaceFilter(java.lang.String existing, AsyncFilterHandler filterHandler)
Replace an existing filter with the given name with new filter.
-
addFilterFirst
public final AsyncServerBootstrap addFilterFirst(java.lang.String name, AsyncFilterHandler filterHandler)
Add an filter to the head of the processing list.
-
addFilterLast
public final AsyncServerBootstrap addFilterLast(java.lang.String name, AsyncFilterHandler filterHandler)
Add an filter to the tail of the processing list.
-
create
public HttpAsyncServer create()
-
-