public class ServerBootstrap extends Object
HttpServer
bootstrap.Modifier and Type | Method and Description |
---|---|
ServerBootstrap |
addFilterAfter(String existing,
String name,
HttpFilterHandler filterHandler)
Adds the filter after the filter with the given name.
|
ServerBootstrap |
addFilterBefore(String existing,
String name,
HttpFilterHandler filterHandler)
Adds the filter before the filter with the given name.
|
ServerBootstrap |
addFilterFirst(String name,
HttpFilterHandler filterHandler)
Add an filter to the head of the processing list.
|
ServerBootstrap |
addFilterLast(String name,
HttpFilterHandler filterHandler)
Add an filter to the tail of the processing list.
|
static ServerBootstrap |
bootstrap() |
HttpServer |
create() |
ServerBootstrap |
register(String uriPattern,
HttpRequestHandler requestHandler)
Registers the given
HttpRequestHandler as a default handler for URIs
matching the given pattern. |
ServerBootstrap |
registerVirtual(String hostname,
String uriPattern,
HttpRequestHandler requestHandler)
Registers the given
HttpRequestHandler as a handler for URIs
matching the given host and the pattern. |
ServerBootstrap |
replaceFilter(String existing,
HttpFilterHandler filterHandler)
Replace an existing filter with the given name with new filter.
|
ServerBootstrap |
setCanonicalHostName(String canonicalHostName)
Sets canonical name (fully qualified domain name) of the server.
|
ServerBootstrap |
setCharCodingConfig(CharCodingConfig charCodingConfig)
Sets connection configuration.
|
ServerBootstrap |
setConnectionFactory(HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory)
Assigns
HttpConnectionFactory instance. |
ServerBootstrap |
setConnectionReuseStrategy(ConnectionReuseStrategy connStrategy)
Assigns
ConnectionReuseStrategy instance. |
ServerBootstrap |
setExceptionListener(ExceptionListener exceptionListener)
Assigns
ExceptionListener instance. |
ServerBootstrap |
setHttp1Config(Http1Config http1Config)
Sets connection configuration.
|
ServerBootstrap |
setHttpProcessor(HttpProcessor httpProcessor)
Assigns
HttpProcessor instance. |
ServerBootstrap |
setListenerPort(int listenerPort)
Sets listener port number.
|
ServerBootstrap |
setLocalAddress(InetAddress localAddress)
Assigns local interface for the listener.
|
ServerBootstrap |
setLookupRegistry(LookupRegistry<HttpRequestHandler> lookupRegistry)
Assigns
LookupRegistry instance. |
ServerBootstrap |
setResponseFactory(HttpResponseFactory<ClassicHttpResponse> responseFactory)
Assigns
HttpResponseFactory instance. |
ServerBootstrap |
setServerSocketFactory(ServerSocketFactory serverSocketFactory)
Assigns
ServerSocketFactory instance. |
ServerBootstrap |
setSocketConfig(SocketConfig socketConfig)
Sets socket configuration.
|
ServerBootstrap |
setSslContext(SSLContext sslContext)
Assigns
SSLContext instance. |
ServerBootstrap |
setSslSetupHandler(Callback<SSLParameters> sslSetupHandler)
Assigns
Callback for SSLParameters . |
ServerBootstrap |
setStreamListener(Http1StreamListener streamListener)
Assigns
ExceptionListener instance. |
public static ServerBootstrap bootstrap()
public final ServerBootstrap setCanonicalHostName(String canonicalHostName)
public final ServerBootstrap setListenerPort(int listenerPort)
public final ServerBootstrap setLocalAddress(InetAddress localAddress)
public final ServerBootstrap setSocketConfig(SocketConfig socketConfig)
public final ServerBootstrap setHttp1Config(Http1Config http1Config)
public final ServerBootstrap setCharCodingConfig(CharCodingConfig charCodingConfig)
public final ServerBootstrap setHttpProcessor(HttpProcessor httpProcessor)
HttpProcessor
instance.public final ServerBootstrap setConnectionReuseStrategy(ConnectionReuseStrategy connStrategy)
ConnectionReuseStrategy
instance.public final ServerBootstrap setResponseFactory(HttpResponseFactory<ClassicHttpResponse> responseFactory)
HttpResponseFactory
instance.public final ServerBootstrap setLookupRegistry(LookupRegistry<HttpRequestHandler> lookupRegistry)
LookupRegistry
instance.public final ServerBootstrap register(String uriPattern, HttpRequestHandler requestHandler)
HttpRequestHandler
as a default handler for URIs
matching the given pattern.uriPattern
- the pattern to register the handler for.requestHandler
- the handler.public final ServerBootstrap registerVirtual(String hostname, String uriPattern, HttpRequestHandler requestHandler)
HttpRequestHandler
as a handler for URIs
matching the given host and the pattern.hostname
- uriPattern
- the pattern to register the handler for.requestHandler
- the handler.public final ServerBootstrap setConnectionFactory(HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory)
HttpConnectionFactory
instance.public final ServerBootstrap setServerSocketFactory(ServerSocketFactory serverSocketFactory)
ServerSocketFactory
instance.public final ServerBootstrap setSslContext(SSLContext sslContext)
SSLContext
instance.
Please note this value can be overridden by the setServerSocketFactory(
javax.net.ServerSocketFactory)
method.
public final ServerBootstrap setSslSetupHandler(Callback<SSLParameters> sslSetupHandler)
Callback
for SSLParameters
.public final ServerBootstrap setExceptionListener(ExceptionListener exceptionListener)
ExceptionListener
instance.public final ServerBootstrap setStreamListener(Http1StreamListener streamListener)
ExceptionListener
instance.public final ServerBootstrap addFilterBefore(String existing, String name, HttpFilterHandler filterHandler)
public final ServerBootstrap addFilterAfter(String existing, String name, HttpFilterHandler filterHandler)
public final ServerBootstrap replaceFilter(String existing, HttpFilterHandler filterHandler)
public final ServerBootstrap addFilterFirst(String name, HttpFilterHandler filterHandler)
public final ServerBootstrap addFilterLast(String name, HttpFilterHandler filterHandler)
public HttpServer create()
Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.