public class ServerBootstrap
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
ServerBootstrap |
addInterceptorFirst(HttpRequestInterceptor itcp)
Adds this protocol interceptor to the head of the protocol processing list.
|
ServerBootstrap |
addInterceptorFirst(HttpResponseInterceptor itcp)
Adds this protocol interceptor to the head of the protocol processing list.
|
ServerBootstrap |
addInterceptorLast(HttpRequestInterceptor itcp)
Adds this protocol interceptor to the tail of the protocol processing list.
|
ServerBootstrap |
addInterceptorLast(HttpResponseInterceptor itcp)
Adds this protocol interceptor to the tail of the protocol processing list.
|
static ServerBootstrap |
bootstrap() |
HttpServer |
create() |
ServerBootstrap |
registerHandler(java.lang.String pattern,
HttpRequestHandler handler)
Registers the given
HttpRequestHandler as a handler for URIs
matching the given pattern. |
ServerBootstrap |
setConnectionConfig(ConnectionConfig connectionConfig)
Sets connection configuration.
|
ServerBootstrap |
setConnectionFactory(HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory)
Assigns
HttpConnectionFactory instance. |
ServerBootstrap |
setConnectionReuseStrategy(ConnectionReuseStrategy connStrategy)
Assigns
ConnectionReuseStrategy instance. |
ServerBootstrap |
setExceptionLogger(ExceptionLogger exceptionLogger)
Assigns
ExceptionLogger instance. |
ServerBootstrap |
setExpectationVerifier(HttpExpectationVerifier expectationVerifier)
Assigns
HttpExpectationVerifier instance. |
ServerBootstrap |
setHandlerMapper(HttpRequestHandlerMapper handlerMapper)
Assigns
HttpRequestHandlerMapper instance. |
ServerBootstrap |
setHttpProcessor(HttpProcessor httpProcessor)
Assigns
HttpProcessor instance. |
ServerBootstrap |
setListenerPort(int listenerPort)
Sets listener port number.
|
ServerBootstrap |
setLocalAddress(java.net.InetAddress localAddress)
Assigns local interface for the listener.
|
ServerBootstrap |
setResponseFactory(HttpResponseFactory responseFactory)
Assigns
HttpResponseFactory instance. |
ServerBootstrap |
setServerInfo(java.lang.String serverInfo)
Assigns
Server response header value. |
ServerBootstrap |
setServerSocketFactory(javax.net.ServerSocketFactory serverSocketFactory)
Assigns
ServerSocketFactory instance. |
ServerBootstrap |
setSocketConfig(SocketConfig socketConfig)
Sets socket configuration.
|
ServerBootstrap |
setSslContext(javax.net.ssl.SSLContext sslContext)
Assigns
SSLContext instance. |
ServerBootstrap |
setSslSetupHandler(SSLServerSetupHandler sslSetupHandler)
Assigns
SSLServerSetupHandler instance. |
public static ServerBootstrap bootstrap()
public final ServerBootstrap setListenerPort(int listenerPort)
public final ServerBootstrap setLocalAddress(java.net.InetAddress localAddress)
public final ServerBootstrap setSocketConfig(SocketConfig socketConfig)
public final ServerBootstrap setConnectionConfig(ConnectionConfig connectionConfig)
Please note this value can be overridden by the setConnectionFactory(
org.apache.http.HttpConnectionFactory)
method.
public final ServerBootstrap setHttpProcessor(HttpProcessor httpProcessor)
HttpProcessor
instance.public final ServerBootstrap addInterceptorFirst(HttpResponseInterceptor itcp)
Please note this value can be overridden by the setHttpProcessor(
org.apache.http.protocol.HttpProcessor)
method.
public final ServerBootstrap addInterceptorLast(HttpResponseInterceptor itcp)
Please note this value can be overridden by the setHttpProcessor(
org.apache.http.protocol.HttpProcessor)
method.
public final ServerBootstrap addInterceptorFirst(HttpRequestInterceptor itcp)
Please note this value can be overridden by the setHttpProcessor(
org.apache.http.protocol.HttpProcessor)
method.
public final ServerBootstrap addInterceptorLast(HttpRequestInterceptor itcp)
Please note this value can be overridden by the setHttpProcessor(
org.apache.http.protocol.HttpProcessor)
method.
public final ServerBootstrap setServerInfo(java.lang.String serverInfo)
Server
response header value.
Please note this value can be overridden by the setHttpProcessor(
org.apache.http.protocol.HttpProcessor)
method.
public final ServerBootstrap setConnectionReuseStrategy(ConnectionReuseStrategy connStrategy)
ConnectionReuseStrategy
instance.public final ServerBootstrap setResponseFactory(HttpResponseFactory responseFactory)
HttpResponseFactory
instance.public final ServerBootstrap setHandlerMapper(HttpRequestHandlerMapper handlerMapper)
HttpRequestHandlerMapper
instance.public final ServerBootstrap registerHandler(java.lang.String pattern, HttpRequestHandler handler)
HttpRequestHandler
as a handler for URIs
matching the given pattern.
Please note this value can be overridden by the setHandlerMapper(
org.apache.http.protocol.HttpRequestHandlerMapper)
method.
pattern
- the pattern to register the handler for.handler
- the handler.public final ServerBootstrap setExpectationVerifier(HttpExpectationVerifier expectationVerifier)
HttpExpectationVerifier
instance.public final ServerBootstrap setConnectionFactory(HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory)
HttpConnectionFactory
instance.public final ServerBootstrap setSslSetupHandler(SSLServerSetupHandler sslSetupHandler)
SSLServerSetupHandler
instance.public final ServerBootstrap setServerSocketFactory(javax.net.ServerSocketFactory serverSocketFactory)
ServerSocketFactory
instance.public final ServerBootstrap setSslContext(javax.net.ssl.SSLContext sslContext)
SSLContext
instance.
Please note this value can be overridden by the setServerSocketFactory(
javax.net.ServerSocketFactory)
method.
public final ServerBootstrap setExceptionLogger(ExceptionLogger exceptionLogger)
ExceptionLogger
instance.public HttpServer create()