Class AsyncServerBootstrap
- java.lang.Object
-
- org.apache.hc.core5.http.impl.bootstrap.AsyncServerBootstrap
-
public class AsyncServerBootstrap extends java.lang.Object
HttpAsyncServer
bootstrap.- Since:
- 5.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
canonicalHostName
private CharCodingConfig
charCodingConfig
private ConnectionReuseStrategy
connStrategy
private Callback<java.lang.Exception>
exceptionCallback
private java.util.List<FilterEntry<AsyncFilterHandler>>
filters
private java.util.List<HandlerEntry<Supplier<AsyncServerExchangeHandler>>>
handlerList
private Timeout
handshakeTimeout
private Http1Config
http1Config
private HttpProcessor
httpProcessor
private IOReactorConfig
ioReactorConfig
private Decorator<IOSession>
ioSessionDecorator
private LookupRegistry<Supplier<AsyncServerExchangeHandler>>
lookupRegistry
private IOSessionListener
sessionListener
private Http1StreamListener
streamListener
private TlsStrategy
tlsStrategy
-
Constructor Summary
Constructors Modifier Constructor Description private
AsyncServerBootstrap()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AsyncServerBootstrap
addFilterAfter(java.lang.String existing, java.lang.String name, AsyncFilterHandler filterHandler)
Adds the filter after the filter with the given name.AsyncServerBootstrap
addFilterBefore(java.lang.String existing, java.lang.String name, AsyncFilterHandler filterHandler)
Adds the filter before the filter with the given name.AsyncServerBootstrap
addFilterFirst(java.lang.String name, AsyncFilterHandler filterHandler)
Add an filter to the head of the processing list.AsyncServerBootstrap
addFilterLast(java.lang.String name, AsyncFilterHandler filterHandler)
Add an filter to the tail of the processing list.static AsyncServerBootstrap
bootstrap()
HttpAsyncServer
create()
AsyncServerBootstrap
register(java.lang.String uriPattern, Supplier<AsyncServerExchangeHandler> supplier)
Registers the givenAsyncServerExchangeHandler
Supplier
as a default handler for URIs matching the given pattern.<T> AsyncServerBootstrap
register(java.lang.String uriPattern, AsyncServerRequestHandler<T> requestHandler)
Registers the givenAsyncServerRequestHandler
as a default handler for URIs matching the given pattern.AsyncServerBootstrap
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> AsyncServerBootstrap
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.AsyncServerBootstrap
replaceFilter(java.lang.String existing, AsyncFilterHandler filterHandler)
Replace an existing filter with the given name with new filter.AsyncServerBootstrap
setCanonicalHostName(java.lang.String canonicalHostName)
Sets canonical name (fully qualified domain name) of the server.AsyncServerBootstrap
setCharCodingConfig(CharCodingConfig charCodingConfig)
Sets connection configuration.AsyncServerBootstrap
setConnectionReuseStrategy(ConnectionReuseStrategy connStrategy)
AssignsConnectionReuseStrategy
instance.AsyncServerBootstrap
setExceptionCallback(Callback<java.lang.Exception> exceptionCallback)
AssignsException
Callback
instance.AsyncServerBootstrap
setHttp1Config(Http1Config http1Config)
Sets HTTP/1.1 protocol parameters.AsyncServerBootstrap
setHttpProcessor(HttpProcessor httpProcessor)
AssignsHttpProcessor
instance.AsyncServerBootstrap
setIOReactorConfig(IOReactorConfig ioReactorConfig)
Sets I/O reactor configuration.AsyncServerBootstrap
setIOSessionDecorator(Decorator<IOSession> ioSessionDecorator)
AsyncServerBootstrap
setIOSessionListener(IOSessionListener sessionListener)
AssignsIOSessionListener
instance.AsyncServerBootstrap
setLookupRegistry(LookupRegistry<Supplier<AsyncServerExchangeHandler>> lookupRegistry)
AssignsLookupRegistry
instance.AsyncServerBootstrap
setStreamListener(Http1StreamListener streamListener)
AssignsHttp1StreamListener
instance.AsyncServerBootstrap
setTlsHandshakeTimeout(Timeout handshakeTimeout)
Assigns TLS handshakeTimeout
.AsyncServerBootstrap
setTlsStrategy(TlsStrategy tlsStrategy)
AssignsTlsStrategy
instance.
-
-
-
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)
AssignsHttpProcessor
instance.
-
setConnectionReuseStrategy
public final AsyncServerBootstrap setConnectionReuseStrategy(ConnectionReuseStrategy connStrategy)
AssignsConnectionReuseStrategy
instance.
-
setTlsStrategy
public final AsyncServerBootstrap setTlsStrategy(TlsStrategy tlsStrategy)
AssignsTlsStrategy
instance.
-
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)
AssignsException
Callback
instance.
-
setIOSessionListener
public final AsyncServerBootstrap setIOSessionListener(IOSessionListener sessionListener)
AssignsIOSessionListener
instance.
-
setLookupRegistry
public final AsyncServerBootstrap setLookupRegistry(LookupRegistry<Supplier<AsyncServerExchangeHandler>> lookupRegistry)
AssignsLookupRegistry
instance.
-
setStreamListener
public final AsyncServerBootstrap setStreamListener(Http1StreamListener streamListener)
AssignsHttp1StreamListener
instance.- Since:
- 5.0
-
register
public final AsyncServerBootstrap 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 AsyncServerBootstrap 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> AsyncServerBootstrap 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> AsyncServerBootstrap 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 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()
-
-