Class ServerBootstrap
- java.lang.Object
-
- org.apache.http.impl.bootstrap.ServerBootstrap
-
public class ServerBootstrap extends java.lang.Object- Since:
- 4.4
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerBootstrapaddInterceptorFirst(HttpRequestInterceptor itcp)Adds this protocol interceptor to the head of the protocol processing list.ServerBootstrapaddInterceptorFirst(HttpResponseInterceptor itcp)Adds this protocol interceptor to the head of the protocol processing list.ServerBootstrapaddInterceptorLast(HttpRequestInterceptor itcp)Adds this protocol interceptor to the tail of the protocol processing list.ServerBootstrapaddInterceptorLast(HttpResponseInterceptor itcp)Adds this protocol interceptor to the tail of the protocol processing list.static ServerBootstrapbootstrap()HttpServercreate()ServerBootstrapregisterHandler(java.lang.String pattern, HttpRequestHandler handler)Registers the givenHttpRequestHandleras a handler for URIs matching the given pattern.ServerBootstrapsetConnectionConfig(ConnectionConfig connectionConfig)Sets connection configuration.ServerBootstrapsetConnectionFactory(HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory)AssignsHttpConnectionFactoryinstance.ServerBootstrapsetConnectionReuseStrategy(ConnectionReuseStrategy connStrategy)AssignsConnectionReuseStrategyinstance.ServerBootstrapsetExceptionLogger(ExceptionLogger exceptionLogger)AssignsExceptionLoggerinstance.ServerBootstrapsetExpectationVerifier(HttpExpectationVerifier expectationVerifier)AssignsHttpExpectationVerifierinstance.ServerBootstrapsetHandlerMapper(HttpRequestHandlerMapper handlerMapper)AssignsHttpRequestHandlerMapperinstance.ServerBootstrapsetHttpProcessor(HttpProcessor httpProcessor)AssignsHttpProcessorinstance.ServerBootstrapsetListenerPort(int listenerPort)Sets listener port number.ServerBootstrapsetLocalAddress(java.net.InetAddress localAddress)Assigns local interface for the listener.ServerBootstrapsetResponseFactory(HttpResponseFactory responseFactory)AssignsHttpResponseFactoryinstance.ServerBootstrapsetServerInfo(java.lang.String serverInfo)AssignsServerresponse header value.ServerBootstrapsetServerSocketFactory(javax.net.ServerSocketFactory serverSocketFactory)AssignsServerSocketFactoryinstance.ServerBootstrapsetSocketConfig(SocketConfig socketConfig)Sets socket configuration.ServerBootstrapsetSslContext(javax.net.ssl.SSLContext sslContext)AssignsSSLContextinstance.ServerBootstrapsetSslSetupHandler(SSLServerSetupHandler sslSetupHandler)AssignsSSLServerSetupHandlerinstance.
-
-
-
Method Detail
-
bootstrap
public static ServerBootstrap bootstrap()
-
setListenerPort
public final ServerBootstrap setListenerPort(int listenerPort)
Sets listener port number.
-
setLocalAddress
public final ServerBootstrap setLocalAddress(java.net.InetAddress localAddress)
Assigns local interface for the listener.
-
setSocketConfig
public final ServerBootstrap setSocketConfig(SocketConfig socketConfig)
Sets socket configuration.
-
setConnectionConfig
public final ServerBootstrap setConnectionConfig(ConnectionConfig connectionConfig)
Sets connection configuration.Please note this value can be overridden by the
setConnectionFactory( org.apache.http.HttpConnectionFactory)method.
-
setHttpProcessor
public final ServerBootstrap setHttpProcessor(HttpProcessor httpProcessor)
AssignsHttpProcessorinstance.
-
addInterceptorFirst
public final ServerBootstrap addInterceptorFirst(HttpResponseInterceptor itcp)
Adds this protocol interceptor to the head of the protocol processing list.Please note this value can be overridden by the
setHttpProcessor( org.apache.http.protocol.HttpProcessor)method.
-
addInterceptorLast
public final ServerBootstrap addInterceptorLast(HttpResponseInterceptor itcp)
Adds this protocol interceptor to the tail of the protocol processing list.Please note this value can be overridden by the
setHttpProcessor( org.apache.http.protocol.HttpProcessor)method.
-
addInterceptorFirst
public final ServerBootstrap addInterceptorFirst(HttpRequestInterceptor itcp)
Adds this protocol interceptor to the head of the protocol processing list.Please note this value can be overridden by the
setHttpProcessor( org.apache.http.protocol.HttpProcessor)method.
-
addInterceptorLast
public final ServerBootstrap addInterceptorLast(HttpRequestInterceptor itcp)
Adds this protocol interceptor to the tail of the protocol processing list.Please note this value can be overridden by the
setHttpProcessor( org.apache.http.protocol.HttpProcessor)method.
-
setServerInfo
public final ServerBootstrap setServerInfo(java.lang.String serverInfo)
AssignsServerresponse header value.Please note this value can be overridden by the
setHttpProcessor( org.apache.http.protocol.HttpProcessor)method.
-
setConnectionReuseStrategy
public final ServerBootstrap setConnectionReuseStrategy(ConnectionReuseStrategy connStrategy)
AssignsConnectionReuseStrategyinstance.
-
setResponseFactory
public final ServerBootstrap setResponseFactory(HttpResponseFactory responseFactory)
AssignsHttpResponseFactoryinstance.
-
setHandlerMapper
public final ServerBootstrap setHandlerMapper(HttpRequestHandlerMapper handlerMapper)
AssignsHttpRequestHandlerMapperinstance.
-
registerHandler
public final ServerBootstrap registerHandler(java.lang.String pattern, HttpRequestHandler handler)
Registers the givenHttpRequestHandleras a handler for URIs matching the given pattern.Please note this value can be overridden by the
setHandlerMapper( org.apache.http.protocol.HttpRequestHandlerMapper)method.- Parameters:
pattern- the pattern to register the handler for.handler- the handler.
-
setExpectationVerifier
public final ServerBootstrap setExpectationVerifier(HttpExpectationVerifier expectationVerifier)
AssignsHttpExpectationVerifierinstance.
-
setConnectionFactory
public final ServerBootstrap setConnectionFactory(HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory)
AssignsHttpConnectionFactoryinstance.
-
setSslSetupHandler
public final ServerBootstrap setSslSetupHandler(SSLServerSetupHandler sslSetupHandler)
AssignsSSLServerSetupHandlerinstance.
-
setServerSocketFactory
public final ServerBootstrap setServerSocketFactory(javax.net.ServerSocketFactory serverSocketFactory)
AssignsServerSocketFactoryinstance.
-
setSslContext
public final ServerBootstrap setSslContext(javax.net.ssl.SSLContext sslContext)
AssignsSSLContextinstance.Please note this value can be overridden by the
setServerSocketFactory( javax.net.ServerSocketFactory)method.
-
setExceptionLogger
public final ServerBootstrap setExceptionLogger(ExceptionLogger exceptionLogger)
AssignsExceptionLoggerinstance.
-
create
public HttpServer create()
-
-