Class H2ServerBootstrap
- java.lang.Object
-
- org.apache.hc.core5.http2.impl.nio.bootstrap.H2ServerBootstrap
-
public class H2ServerBootstrap extends java.lang.ObjectHTTP/2 capableHttpAsyncServerbootstrap.- Since:
- 5.0
-
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description privateH2ServerBootstrap()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description H2ServerBootstrapaddFilterAfter(java.lang.String existing, java.lang.String name, AsyncFilterHandler filterHandler)Adds the filter after the filter with the given name.H2ServerBootstrapaddFilterBefore(java.lang.String existing, java.lang.String name, AsyncFilterHandler filterHandler)Adds the filter before the filter with the given name.H2ServerBootstrapaddFilterFirst(java.lang.String name, AsyncFilterHandler filterHandler)Add an filter to the head of the processing list.H2ServerBootstrapaddFilterLast(java.lang.String name, AsyncFilterHandler filterHandler)Add an filter to the tail of the processing list.static H2ServerBootstrapbootstrap()HttpAsyncServercreate()H2ServerBootstrapregister(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> H2ServerBootstrapregister(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.H2ServerBootstrapregister(java.lang.String uriPattern, Supplier<AsyncServerExchangeHandler> supplier)Registers the givenAsyncServerExchangeHandlerSupplieras a default handler for URIs matching the given pattern.<T> H2ServerBootstrapregister(java.lang.String uriPattern, AsyncServerRequestHandler<T> requestHandler)Registers the givenAsyncServerRequestHandleras a default handler for URIs matching the given pattern.H2ServerBootstrapregisterVirtual(java.lang.String hostname, java.lang.String uriPattern, Supplier<AsyncServerExchangeHandler> supplier)Deprecated.<T> H2ServerBootstrapregisterVirtual(java.lang.String hostname, java.lang.String uriPattern, AsyncServerRequestHandler<T> requestHandler)Deprecated.H2ServerBootstrapreplaceFilter(java.lang.String existing, AsyncFilterHandler filterHandler)Replace an existing filter with the given name with new filter.H2ServerBootstrapsetCanonicalHostName(java.lang.String canonicalHostName)Sets canonical name (fully qualified domain name) of the server.H2ServerBootstrapsetCharset(CharCodingConfig charCodingConfig)Sets message char coding.H2ServerBootstrapsetExceptionCallback(Callback<java.lang.Exception> exceptionCallback)SetsExceptionCallbackinstance.H2ServerBootstrapsetFrameFactory(FrameFactory frameFactory)SetsFrameFactoryinstance.H2ServerBootstrapsetH2Config(H2Config h2Config)Sets HTTP/2 protocol parametersH2ServerBootstrapsetHandshakeTimeout(Timeout handshakeTimeout)H2ServerBootstrapsetHttp1Config(Http1Config http1Config)Sets HTTP/1.1 protocol parametersH2ServerBootstrapsetHttpProcessor(HttpProcessor httpProcessor)SetsHttpProcessorinstance.H2ServerBootstrapsetIOReactorConfig(IOReactorConfig ioReactorConfig)Sets I/O reactor configuration.H2ServerBootstrapsetIOReactorMetricsListener(IOReactorMetricsListener threadPoolListener)SetsIOReactorMetricsListenerinstance.H2ServerBootstrapsetIOSessionDecorator(Decorator<IOSession> ioSessionDecorator)H2ServerBootstrapsetIOSessionListener(IOSessionListener sessionListener)SetsIOSessionListenerinstance.H2ServerBootstrapsetLookupRegistry(LookupRegistry<Supplier<AsyncServerExchangeHandler>> lookupRegistry)Deprecated.UseRequestRouter.H2ServerBootstrapsetRequestRouter(HttpRequestMapper<Supplier<AsyncServerExchangeHandler>> requestRouter)SetsHttpRequestMapperinstance.H2ServerBootstrapsetStreamListener(Http1StreamListener http1StreamListener)SetsHttp1StreamListenerinstance.H2ServerBootstrapsetStreamListener(H2StreamListener h2StreamListener)SetsH2StreamListenerinstance.H2ServerBootstrapsetTlsStrategy(TlsStrategy tlsStrategy)SetsTlsStrategyinstance.H2ServerBootstrapsetVersionPolicy(HttpVersionPolicy versionPolicy)Sets HTTP protocol version policy
-
-
-
Field Detail
-
routeEntries
private final java.util.List<RequestRouter.Entry<Supplier<AsyncServerExchangeHandler>>> routeEntries
-
filters
private final java.util.List<FilterEntry<AsyncFilterHandler>> filters
-
canonicalHostName
private java.lang.String canonicalHostName
-
lookupRegistry
private LookupRegistry<Supplier<AsyncServerExchangeHandler>> lookupRegistry
-
requestRouter
private HttpRequestMapper<Supplier<AsyncServerExchangeHandler>> requestRouter
-
ioReactorConfig
private IOReactorConfig ioReactorConfig
-
httpProcessor
private HttpProcessor httpProcessor
-
charCodingConfig
private CharCodingConfig charCodingConfig
-
versionPolicy
private HttpVersionPolicy versionPolicy
-
h2Config
private H2Config h2Config
-
http1Config
private Http1Config http1Config
-
tlsStrategy
private TlsStrategy tlsStrategy
-
handshakeTimeout
private Timeout handshakeTimeout
-
exceptionCallback
private Callback<java.lang.Exception> exceptionCallback
-
sessionListener
private IOSessionListener sessionListener
-
h2StreamListener
private H2StreamListener h2StreamListener
-
http1StreamListener
private Http1StreamListener http1StreamListener
-
threadPoolListener
private IOReactorMetricsListener threadPoolListener
-
frameFactory
private FrameFactory frameFactory
-
-
Method Detail
-
bootstrap
public static H2ServerBootstrap bootstrap()
-
setCanonicalHostName
public final H2ServerBootstrap setCanonicalHostName(java.lang.String canonicalHostName)
Sets canonical name (fully qualified domain name) of the server.- Returns:
- this instance.
- Since:
- 5.0
-
setIOReactorConfig
public final H2ServerBootstrap setIOReactorConfig(IOReactorConfig ioReactorConfig)
Sets I/O reactor configuration.- Returns:
- this instance.
-
setHttpProcessor
public final H2ServerBootstrap setHttpProcessor(HttpProcessor httpProcessor)
SetsHttpProcessorinstance.- Returns:
- this instance.
-
setVersionPolicy
public final H2ServerBootstrap setVersionPolicy(HttpVersionPolicy versionPolicy)
Sets HTTP protocol version policy- Returns:
- this instance.
-
setH2Config
public final H2ServerBootstrap setH2Config(H2Config h2Config)
Sets HTTP/2 protocol parameters- Returns:
- this instance.
-
setHttp1Config
public final H2ServerBootstrap setHttp1Config(Http1Config http1Config)
Sets HTTP/1.1 protocol parameters- Returns:
- this instance.
-
setCharset
public final H2ServerBootstrap setCharset(CharCodingConfig charCodingConfig)
Sets message char coding.- Returns:
- this instance.
-
setTlsStrategy
public final H2ServerBootstrap setTlsStrategy(TlsStrategy tlsStrategy)
SetsTlsStrategyinstance.- Returns:
- this instance.
-
setHandshakeTimeout
public final H2ServerBootstrap setHandshakeTimeout(Timeout handshakeTimeout)
-
setIOSessionDecorator
public final H2ServerBootstrap setIOSessionDecorator(Decorator<IOSession> ioSessionDecorator)
- Returns:
- this instance.
-
setIOReactorMetricsListener
public final H2ServerBootstrap setIOReactorMetricsListener(IOReactorMetricsListener threadPoolListener)
SetsIOReactorMetricsListenerinstance.- Returns:
- this instance.
- Since:
- 5.4
-
setExceptionCallback
public final H2ServerBootstrap setExceptionCallback(Callback<java.lang.Exception> exceptionCallback)
SetsExceptionCallbackinstance.- Returns:
- this instance.
-
setIOSessionListener
public final H2ServerBootstrap setIOSessionListener(IOSessionListener sessionListener)
SetsIOSessionListenerinstance.- Returns:
- this instance.
-
setStreamListener
public final H2ServerBootstrap setStreamListener(H2StreamListener h2StreamListener)
SetsH2StreamListenerinstance.- Returns:
- this instance.
-
setFrameFactory
public final H2ServerBootstrap setFrameFactory(FrameFactory frameFactory)
SetsFrameFactoryinstance.- Returns:
- this instance.
- Since:
- 5.4
-
setStreamListener
public final H2ServerBootstrap setStreamListener(Http1StreamListener http1StreamListener)
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:
RequestRouter
-
register
public final H2ServerBootstrap 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.- Returns:
- this instance.
-
register
public final H2ServerBootstrap register(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.- Returns:
- this instance.
- Since:
- 5.3
-
registerVirtual
@Deprecated public final H2ServerBootstrap registerVirtual(java.lang.String hostname, java.lang.String uriPattern, Supplier<AsyncServerExchangeHandler> supplier)
Deprecated.- Returns:
- this instance.
-
register
public final <T> H2ServerBootstrap register(java.lang.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(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.- 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(java.lang.String hostname, java.lang.String uriPattern, AsyncServerRequestHandler<T> requestHandler)
Deprecated.- Type Parameters:
T- request handler representation.- Returns:
- this instance.
-
addFilterBefore
public final H2ServerBootstrap addFilterBefore(java.lang.String existing, java.lang.String name, AsyncFilterHandler filterHandler)
Adds the filter before the filter with the given name.- Returns:
- this instance.
-
addFilterAfter
public final H2ServerBootstrap addFilterAfter(java.lang.String existing, java.lang.String name, AsyncFilterHandler filterHandler)
Adds the filter after the filter with the given name.- Returns:
- this instance.
-
replaceFilter
public final H2ServerBootstrap replaceFilter(java.lang.String existing, AsyncFilterHandler filterHandler)
Replace an existing filter with the given name with new filter.- Returns:
- this instance.
-
addFilterFirst
public final H2ServerBootstrap addFilterFirst(java.lang.String name, AsyncFilterHandler filterHandler)
Add an filter to the head of the processing list.- Returns:
- this instance.
-
addFilterLast
public final H2ServerBootstrap addFilterLast(java.lang.String name, AsyncFilterHandler filterHandler)
Add an filter to the tail of the processing list.- Returns:
- this instance.
-
create
public HttpAsyncServer create()
-
-