Class ServerBootstrap
- java.lang.Object
-
- org.apache.http.impl.nio.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(org.apache.http.HttpRequestInterceptor itcp)Adds this protocol interceptor to the head of the protocol processing list.ServerBootstrapaddInterceptorFirst(org.apache.http.HttpResponseInterceptor itcp)Adds this protocol interceptor to the head of the protocol processing list.ServerBootstrapaddInterceptorLast(org.apache.http.HttpRequestInterceptor itcp)Adds this protocol interceptor to the tail of the protocol processing list.ServerBootstrapaddInterceptorLast(org.apache.http.HttpResponseInterceptor itcp)Adds this protocol interceptor to the tail of the protocol processing list.static ServerBootstrapbootstrap()HttpServercreate()ServerBootstrapregisterHandler(java.lang.String pattern, HttpAsyncRequestHandler<?> handler)Registers the givenHttpAsyncRequestHandleras a handler for URIs matching the given pattern.ServerBootstrapsetConnectionConfig(org.apache.http.config.ConnectionConfig connectionConfig)Sets connection configuration.ServerBootstrapsetConnectionFactory(NHttpConnectionFactory<? extends DefaultNHttpServerConnection> connectionFactory)AssignsNHttpConnectionFactoryinstance.ServerBootstrapsetConnectionReuseStrategy(org.apache.http.ConnectionReuseStrategy connStrategy)AssignsConnectionReuseStrategyinstance.ServerBootstrapsetExceptionLogger(org.apache.http.ExceptionLogger exceptionLogger)AssignsExceptionLoggerinstance.ServerBootstrapsetExpectationVerifier(HttpAsyncExpectationVerifier expectationVerifier)AssignsHttpAsyncExpectationVerifierinstance.ServerBootstrapsetHandlerMapper(HttpAsyncRequestHandlerMapper handlerMapper)AssignsHttpAsyncRequestHandlerMapperinstance.ServerBootstrapsetHttpProcessor(org.apache.http.protocol.HttpProcessor httpProcessor)AssignsHttpProcessorinstance.ServerBootstrapsetIOReactorConfig(IOReactorConfig ioReactorConfig)Sets I/O reactor configuration.ServerBootstrapsetListenerPort(int listenerPort)Sets listener port number.ServerBootstrapsetLocalAddress(java.net.InetAddress localAddress)Assigns local interface for the listener.ServerBootstrapsetResponseFactory(org.apache.http.HttpResponseFactory responseFactory)AssignsHttpResponseFactoryinstance.ServerBootstrapsetServerInfo(java.lang.String serverInfo)AssignsServerresponse header value.ServerBootstrapsetSslContext(javax.net.ssl.SSLContext sslContext)AssignsSSLContextinstance.ServerBootstrapsetSslSetupHandler(SSLSetupHandler sslSetupHandler)AssignsSSLSetupHandlerinstance.
-
-
-
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.
-
setIOReactorConfig
public final ServerBootstrap setIOReactorConfig(IOReactorConfig ioReactorConfig)
Sets I/O reactor configuration.
-
setConnectionConfig
public final ServerBootstrap setConnectionConfig(org.apache.http.config.ConnectionConfig connectionConfig)
Sets connection configuration.Please note this value can be overridden by the
setConnectionFactory( org.apache.http.nio.NHttpConnectionFactory)method.
-
setHttpProcessor
public final ServerBootstrap setHttpProcessor(org.apache.http.protocol.HttpProcessor httpProcessor)
AssignsHttpProcessorinstance.
-
addInterceptorFirst
public final ServerBootstrap addInterceptorFirst(org.apache.http.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(org.apache.http.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(org.apache.http.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(org.apache.http.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(org.apache.http.ConnectionReuseStrategy connStrategy)
AssignsConnectionReuseStrategyinstance.
-
setResponseFactory
public final ServerBootstrap setResponseFactory(org.apache.http.HttpResponseFactory responseFactory)
AssignsHttpResponseFactoryinstance.
-
setHandlerMapper
public final ServerBootstrap setHandlerMapper(HttpAsyncRequestHandlerMapper handlerMapper)
AssignsHttpAsyncRequestHandlerMapperinstance.
-
registerHandler
public final ServerBootstrap registerHandler(java.lang.String pattern, HttpAsyncRequestHandler<?> handler)
Registers the givenHttpAsyncRequestHandleras a handler for URIs matching the given pattern.Please note this value can be overridden by the
setHandlerMapper( org.apache.http.nio.protocol.HttpAsyncRequestHandlerMapper))} method.- Parameters:
pattern- the pattern to register the handler for.handler- the handler.
-
setExpectationVerifier
public final ServerBootstrap setExpectationVerifier(HttpAsyncExpectationVerifier expectationVerifier)
AssignsHttpAsyncExpectationVerifierinstance.
-
setConnectionFactory
public final ServerBootstrap setConnectionFactory(NHttpConnectionFactory<? extends DefaultNHttpServerConnection> connectionFactory)
AssignsNHttpConnectionFactoryinstance.
-
setSslContext
public final ServerBootstrap setSslContext(javax.net.ssl.SSLContext sslContext)
AssignsSSLContextinstance.Please note this value can be overridden by the
setConnectionFactory( org.apache.http.nio.NHttpConnectionFactory)method.
-
setSslSetupHandler
public ServerBootstrap setSslSetupHandler(SSLSetupHandler sslSetupHandler)
AssignsSSLSetupHandlerinstance.Please note this value can be overridden by the
setConnectionFactory( org.apache.http.nio.NHttpConnectionFactory)method.
-
setExceptionLogger
public final ServerBootstrap setExceptionLogger(org.apache.http.ExceptionLogger exceptionLogger)
AssignsExceptionLoggerinstance.
-
create
public HttpServer create()
-
-