Top Description Fields Constructors Methods
org.apache.hc.core5.http.impl.bootstrap

public Class ServerBootstrap

extends Object
Class Inheritance
Imports
java.net.InetAddress, java.util.ArrayList, .List, javax.net.ServerSocketFactory, javax.net.ssl.SSLContext, .SSLParameters, .SSLServerSocketFactory, org.apache.hc.core5.function.Callback, org.apache.hc.core5.http.ClassicHttpResponse, .ConnectionReuseStrategy, .ExceptionListener, .HttpResponseFactory, .URIScheme, org.apache.hc.core5.http.config.CharCodingConfig, .Http1Config, .NamedElementChain, org.apache.hc.core5.http.impl.DefaultConnectionReuseStrategy, .Http1StreamListener, .HttpProcessors, org.apache.hc.core5.http.impl.io.DefaultBHttpServerConnection, .DefaultBHttpServerConnectionFactory, .DefaultClassicHttpResponseFactory, .HttpService, org.apache.hc.core5.http.io.HttpConnectionFactory, .HttpFilterHandler, .HttpRequestHandler, .HttpServerRequestHandler, .SocketConfig, org.apache.hc.core5.http.io.ssl.DefaultTlsSetupHandler, org.apache.hc.core5.http.io.support.BasicHttpServerExpectationDecorator, .BasicHttpServerRequestHandler, .HttpServerExpectationFilter, .HttpServerFilterChainElement, .HttpServerFilterChainRequestHandler, .TerminalServerFilter, org.apache.hc.core5.http.protocol.HttpProcessor, .LookupRegistry, .RequestHandlerRegistry, .UriPatternType, org.apache.hc.core5.net.InetAddressUtils, org.apache.hc.core5.util.Args

HttpServer bootstrap.
Since
4.4

Field Summary

Modifier and TypeField and Description
private String
private CharCodingConfig
private HttpConnectionFactory<? extends DefaultBHttpServerConnection>
private ConnectionReuseStrategy
private ExceptionListener
private final List<FilterEntry<HttpFilterHandler>>
private final List<HandlerEntry<HttpRequestHandler>>
private Http1Config
private HttpProcessor
private int
private InetAddress
private LookupRegistry<HttpRequestHandler>
private HttpResponseFactory<ClassicHttpResponse>
private ServerSocketFactory
private SocketConfig
private SSLContext
private Callback<SSLParameters>
private Http1StreamListener

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public final ServerBootstrap
addFilterAfter(final String existing, final String name, final HttpFilterHandler filterHandler)

Adds the filter after the filter with the given name.

public final ServerBootstrap
addFilterBefore(final String existing, final String name, final HttpFilterHandler filterHandler)

Adds the filter before the filter with the given name.

public final ServerBootstrap
addFilterFirst(final String name, final HttpFilterHandler filterHandler)

Add an filter to the head of the processing list.

public final ServerBootstrap
addFilterLast(final String name, final HttpFilterHandler filterHandler)

Add an filter to the tail of the processing list.

public static ServerBootstrap
public HttpServer
public final ServerBootstrap
register(final String
the pattern to register the handler for.
uriPattern
,
final HttpRequestHandler
the handler.
requestHandler
)

Registers the given HttpRequestHandler as a default handler for URIs matching the given pattern.

public final ServerBootstrap
registerVirtual(final String hostname, final String
the pattern to register the handler for.
uriPattern
,
final HttpRequestHandler
the handler.
requestHandler
)

Registers the given HttpRequestHandler as a handler for URIs matching the given host and the pattern.

public final ServerBootstrap
replaceFilter(final String existing, final HttpFilterHandler filterHandler)

Replace an existing filter with the given name with new filter.

public final ServerBootstrap
setCanonicalHostName(final String canonicalHostName)

Sets canonical name (fully qualified domain name) of the server.

public final ServerBootstrap
setCharCodingConfig(final CharCodingConfig charCodingConfig)

Sets connection configuration.

public final ServerBootstrap
public final ServerBootstrap
public final ServerBootstrap
setExceptionListener(final ExceptionListener exceptionListener)

Assigns ExceptionListener instance.

public final ServerBootstrap
setHttp1Config(final Http1Config http1Config)

Sets connection configuration.

public final ServerBootstrap
setHttpProcessor(final HttpProcessor httpProcessor)

Assigns HttpProcessor instance.

public final ServerBootstrap
setListenerPort(final int listenerPort)

Sets listener port number.

public final ServerBootstrap
setLocalAddress(final InetAddress localAddress)

Assigns local interface for the listener.

public final ServerBootstrap
setLookupRegistry(final LookupRegistry<HttpRequestHandler> lookupRegistry)

Assigns LookupRegistry instance.

public final ServerBootstrap
public final ServerBootstrap
setServerSocketFactory(final ServerSocketFactory serverSocketFactory)

Assigns javax.net.ServerSocketFactory instance.

public final ServerBootstrap
setSocketConfig(final SocketConfig socketConfig)

Sets socket configuration.

public final ServerBootstrap
setSslContext(final SSLContext sslContext)

Assigns javax.net.ssl.SSLContext instance.

public final ServerBootstrap
setSslSetupHandler(final Callback<SSLParameters> sslSetupHandler)

Assigns Callback for SSLParameters.

public final ServerBootstrap
setStreamListener(final Http1StreamListener streamListener)

Assigns ExceptionListener instance.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

canonicalHostNameback to summary
private String canonicalHostName
charCodingConfigback to summary
private CharCodingConfig charCodingConfig
connectionFactoryback to summary
private HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory
connStrategyback to summary
private ConnectionReuseStrategy connStrategy
exceptionListenerback to summary
private ExceptionListener exceptionListener
filtersback to summary
private final List<FilterEntry<HttpFilterHandler>> filters
handlerListback to summary
private final List<HandlerEntry<HttpRequestHandler>> handlerList
http1Configback to summary
private Http1Config http1Config
httpProcessorback to summary
private HttpProcessor httpProcessor
listenerPortback to summary
private int listenerPort
localAddressback to summary
private InetAddress localAddress
lookupRegistryback to summary
private LookupRegistry<HttpRequestHandler> lookupRegistry
responseFactoryback to summary
private HttpResponseFactory<ClassicHttpResponse> responseFactory
serverSocketFactoryback to summary
private ServerSocketFactory serverSocketFactory
socketConfigback to summary
private SocketConfig socketConfig
sslContextback to summary
private SSLContext sslContext
sslSetupHandlerback to summary
private Callback<SSLParameters> sslSetupHandler
streamListenerback to summary
private Http1StreamListener streamListener

Constructor Detail

ServerBootstrapback to summary
private ServerBootstrap()

Method Detail

addFilterAfterback to summary
public final ServerBootstrap addFilterAfter(final String existing, final String name, final HttpFilterHandler filterHandler)

Adds the filter after the filter with the given name.

addFilterBeforeback to summary
public final ServerBootstrap addFilterBefore(final String existing, final String name, final HttpFilterHandler filterHandler)

Adds the filter before the filter with the given name.

addFilterFirstback to summary
public final ServerBootstrap addFilterFirst(final String name, final HttpFilterHandler filterHandler)

Add an filter to the head of the processing list.

addFilterLastback to summary
public final ServerBootstrap addFilterLast(final String name, final HttpFilterHandler filterHandler)

Add an filter to the tail of the processing list.

bootstrapback to summary
public static ServerBootstrap bootstrap()
createback to summary
public HttpServer create()
registerback to summary
public final ServerBootstrap register(final String uriPattern, final HttpRequestHandler requestHandler)

Registers the given HttpRequestHandler as a default handler for URIs matching the given pattern.

Parameters
uriPattern:String

the pattern to register the handler for.

requestHandler:HttpRequestHandler

the handler.

registerVirtualback to summary
public final ServerBootstrap registerVirtual(final String hostname, final String uriPattern, final HttpRequestHandler requestHandler)

Registers the given HttpRequestHandler as a handler for URIs matching the given host and the pattern.

Parameters
uriPattern:String

the pattern to register the handler for.

requestHandler:HttpRequestHandler

the handler.

replaceFilterback to summary
public final ServerBootstrap replaceFilter(final String existing, final HttpFilterHandler filterHandler)

Replace an existing filter with the given name with new filter.

setCanonicalHostNameback to summary
public final ServerBootstrap setCanonicalHostName(final String canonicalHostName)

Sets canonical name (fully qualified domain name) of the server.

Since
5.0
setCharCodingConfigback to summary
public final ServerBootstrap setCharCodingConfig(final CharCodingConfig charCodingConfig)

Sets connection configuration.

setConnectionFactoryback to summary
public final ServerBootstrap setConnectionFactory(final HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory)

Assigns HttpConnectionFactory instance.

setConnectionReuseStrategyback to summary
public final ServerBootstrap setConnectionReuseStrategy(final ConnectionReuseStrategy connStrategy)

Assigns ConnectionReuseStrategy instance.

setExceptionListenerback to summary
public final ServerBootstrap setExceptionListener(final ExceptionListener exceptionListener)

Assigns ExceptionListener instance.

setHttp1Configback to summary
public final ServerBootstrap setHttp1Config(final Http1Config http1Config)

Sets connection configuration.

setHttpProcessorback to summary
public final ServerBootstrap setHttpProcessor(final HttpProcessor httpProcessor)

Assigns HttpProcessor instance.

setListenerPortback to summary
public final ServerBootstrap setListenerPort(final int listenerPort)

Sets listener port number.

setLocalAddressback to summary
public final ServerBootstrap setLocalAddress(final InetAddress localAddress)

Assigns local interface for the listener.

setLookupRegistryback to summary
public final ServerBootstrap setLookupRegistry(final LookupRegistry<HttpRequestHandler> lookupRegistry)

Assigns LookupRegistry instance.

setResponseFactoryback to summary
public final ServerBootstrap setResponseFactory(final HttpResponseFactory<ClassicHttpResponse> responseFactory)

Assigns HttpResponseFactory instance.

setServerSocketFactoryback to summary
public final ServerBootstrap setServerSocketFactory(final ServerSocketFactory serverSocketFactory)

Assigns javax.net.ServerSocketFactory instance.

setSocketConfigback to summary
public final ServerBootstrap setSocketConfig(final SocketConfig socketConfig)

Sets socket configuration.

setSslContextback to summary
public final ServerBootstrap setSslContext(final SSLContext sslContext)

Assigns javax.net.ssl.SSLContext instance.

Please note this value can be overridden by the setServerSocketFactory( javax.net.ServerSocketFactory) method.

setSslSetupHandlerback to summary
public final ServerBootstrap setSslSetupHandler(final Callback<SSLParameters> sslSetupHandler)

Assigns Callback for SSLParameters.

setStreamListenerback to summary
public final ServerBootstrap setStreamListener(final Http1StreamListener streamListener)

Assigns ExceptionListener instance.