Top Fields Constructors Methods
org.apache.http.impl.bootstrap

public Class ServerBootstrap

extends Object
Class Inheritance
Imports
java.net.InetAddress, java.util.HashMap, .LinkedList, .Map, javax.net.ServerSocketFactory, javax.net.ssl.SSLContext, org.apache.http.ConnectionReuseStrategy, .ExceptionLogger, .HttpConnectionFactory, .HttpRequestInterceptor, .HttpResponseFactory, .HttpResponseInterceptor, org.apache.http.config.ConnectionConfig, .SocketConfig, org.apache.http.impl.DefaultBHttpServerConnection, .DefaultBHttpServerConnectionFactory, .DefaultConnectionReuseStrategy, .DefaultHttpResponseFactory, org.apache.http.protocol.HttpExpectationVerifier, .HttpProcessor, .HttpProcessorBuilder, .HttpRequestHandler, .HttpRequestHandlerMapper, .HttpService, .ResponseConnControl, .ResponseContent, .ResponseDate, .ResponseServer, .UriHttpRequestHandlerMapper

Since
4.4

Field Summary

Modifier and TypeField and Description
private ConnectionConfig
private HttpConnectionFactory<? extends DefaultBHttpServerConnection>
private ConnectionReuseStrategy
private ExceptionLogger
private HttpExpectationVerifier
private Map<String, HttpRequestHandler>
private HttpRequestHandlerMapper
private HttpProcessor
private int
private InetAddress
private LinkedList<HttpRequestInterceptor>
private LinkedList<HttpRequestInterceptor>
private HttpResponseFactory
private LinkedList<HttpResponseInterceptor>
private LinkedList<HttpResponseInterceptor>
private String
private ServerSocketFactory
private SocketConfig
private SSLContext
private SSLServerSetupHandler

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public final ServerBootstrap

Returns:

this
addInterceptorFirst
(final HttpResponseInterceptor itcp)

Adds this protocol interceptor to the head of the protocol processing list.

public final ServerBootstrap

Returns:

this
addInterceptorFirst
(final HttpRequestInterceptor itcp)

Adds this protocol interceptor to the head of the protocol processing list.

public final ServerBootstrap

Returns:

this
addInterceptorLast
(final HttpResponseInterceptor itcp)

Adds this protocol interceptor to the tail of the protocol processing list.

public final ServerBootstrap

Returns:

this
addInterceptorLast
(final HttpRequestInterceptor itcp)

Adds this protocol interceptor to the tail of the protocol processing list.

public static ServerBootstrap
public HttpServer
public final ServerBootstrap

Returns:

this
registerHandler
(final String
the pattern to register the handler for.
pattern
,
final HttpRequestHandler
the handler.
handler
)

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

public final ServerBootstrap

Returns:

this
setConnectionConfig
(final ConnectionConfig connectionConfig)

Sets connection configuration.

public final ServerBootstrap

Returns:

this
setConnectionFactory
(final HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory)

Assigns HttpConnectionFactory instance.

public final ServerBootstrap

Returns:

this
setConnectionReuseStrategy
(final ConnectionReuseStrategy connStrategy)

Assigns ConnectionReuseStrategy instance.

public final ServerBootstrap

Returns:

this
setExceptionLogger
(final ExceptionLogger exceptionLogger)

Assigns org.apache.http.ExceptionLogger instance.

public final ServerBootstrap

Returns:

this
setExpectationVerifier
(final HttpExpectationVerifier expectationVerifier)

Assigns HttpExpectationVerifier instance.

public final ServerBootstrap

Returns:

this
setHandlerMapper
(final HttpRequestHandlerMapper handlerMapper)

Assigns HttpRequestHandlerMapper instance.

public final ServerBootstrap

Returns:

this
setHttpProcessor
(final HttpProcessor httpProcessor)

Assigns HttpProcessor instance.

public final ServerBootstrap

Returns:

this
setListenerPort
(final int listenerPort)

Sets listener port number.

public final ServerBootstrap

Returns:

this
setLocalAddress
(final InetAddress localAddress)

Assigns local interface for the listener.

public final ServerBootstrap

Returns:

this
setResponseFactory
(final HttpResponseFactory responseFactory)

Assigns HttpResponseFactory instance.

public final ServerBootstrap

Returns:

this
setServerInfo
(final String serverInfo)

Assigns Server response header value.

public final ServerBootstrap

Returns:

this
setServerSocketFactory
(final ServerSocketFactory serverSocketFactory)

Assigns javax.net.ServerSocketFactory instance.

public final ServerBootstrap

Returns:

this
setSocketConfig
(final SocketConfig socketConfig)

Sets socket configuration.

public final ServerBootstrap

Returns:

this
setSslContext
(final SSLContext sslContext)

Assigns javax.net.ssl.SSLContext instance.

public final ServerBootstrap
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

connectionConfigback to summary
private ConnectionConfig connectionConfig
connectionFactoryback to summary
private HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory
connStrategyback to summary
private ConnectionReuseStrategy connStrategy
exceptionLoggerback to summary
private ExceptionLogger exceptionLogger
expectationVerifierback to summary
private HttpExpectationVerifier expectationVerifier
handlerMapback to summary
private Map<String, HttpRequestHandler> handlerMap
handlerMapperback to summary
private HttpRequestHandlerMapper handlerMapper
httpProcessorback to summary
private HttpProcessor httpProcessor
listenerPortback to summary
private int listenerPort
localAddressback to summary
private InetAddress localAddress
requestFirstback to summary
private LinkedList<HttpRequestInterceptor> requestFirst
requestLastback to summary
private LinkedList<HttpRequestInterceptor> requestLast
responseFactoryback to summary
private HttpResponseFactory responseFactory
responseFirstback to summary
private LinkedList<HttpResponseInterceptor> responseFirst
responseLastback to summary
private LinkedList<HttpResponseInterceptor> responseLast
serverInfoback to summary
private String serverInfo
serverSocketFactoryback to summary
private ServerSocketFactory serverSocketFactory
socketConfigback to summary
private SocketConfig socketConfig
sslContextback to summary
private SSLContext sslContext
sslSetupHandlerback to summary
private SSLServerSetupHandler sslSetupHandler

Constructor Detail

ServerBootstrapback to summary
private ServerBootstrap()

Method Detail

addInterceptorFirstback to summary
public final ServerBootstrap addInterceptorFirst(final 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.

Returns:ServerBootstrap

this

addInterceptorFirstback to summary
public final ServerBootstrap addInterceptorFirst(final 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.

Returns:ServerBootstrap

this

addInterceptorLastback to summary
public final ServerBootstrap addInterceptorLast(final 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.

Returns:ServerBootstrap

this

addInterceptorLastback to summary
public final ServerBootstrap addInterceptorLast(final 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.

Returns:ServerBootstrap

this

bootstrapback to summary
public static ServerBootstrap bootstrap()
createback to summary
public HttpServer create()
registerHandlerback to summary
public final ServerBootstrap registerHandler(final String pattern, final HttpRequestHandler handler)

Registers the given 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.

Parameters
pattern:String

the pattern to register the handler for.

handler:HttpRequestHandler

the handler.

Returns:ServerBootstrap

this

setConnectionConfigback to summary
public final ServerBootstrap setConnectionConfig(final ConnectionConfig connectionConfig)

Sets connection configuration.

Please note this value can be overridden by the setConnectionFactory( org.apache.http.HttpConnectionFactory) method.

Returns:ServerBootstrap

this

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

Assigns HttpConnectionFactory instance.

Returns:ServerBootstrap

this

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

Assigns ConnectionReuseStrategy instance.

Returns:ServerBootstrap

this

setExceptionLoggerback to summary
public final ServerBootstrap setExceptionLogger(final ExceptionLogger exceptionLogger)

Assigns org.apache.http.ExceptionLogger instance.

Returns:ServerBootstrap

this

setExpectationVerifierback to summary
public final ServerBootstrap setExpectationVerifier(final HttpExpectationVerifier expectationVerifier)

Assigns HttpExpectationVerifier instance.

Returns:ServerBootstrap

this

setHandlerMapperback to summary
public final ServerBootstrap setHandlerMapper(final HttpRequestHandlerMapper handlerMapper)

Assigns HttpRequestHandlerMapper instance.

Returns:ServerBootstrap

this

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

Assigns HttpProcessor instance.

Returns:ServerBootstrap

this

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

Sets listener port number.

Returns:ServerBootstrap

this

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

Assigns local interface for the listener.

Returns:ServerBootstrap

this

setResponseFactoryback to summary
public final ServerBootstrap setResponseFactory(final HttpResponseFactory responseFactory)

Assigns HttpResponseFactory instance.

Returns:ServerBootstrap

this

setServerInfoback to summary
public final ServerBootstrap setServerInfo(final String serverInfo)

Assigns Server response header value.

Please note this value can be overridden by the setHttpProcessor( org.apache.http.protocol.HttpProcessor) method.

Returns:ServerBootstrap

this

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

Assigns javax.net.ServerSocketFactory instance.

Returns:ServerBootstrap

this

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

Sets socket configuration.

Returns:ServerBootstrap

this

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.

Returns:ServerBootstrap

this

setSslSetupHandlerback to summary
public final ServerBootstrap setSslSetupHandler(final SSLServerSetupHandler sslSetupHandler)

Assigns org.apache.http.impl.bootstrap.SSLServerSetupHandler instance.

Returns:ServerBootstrap

this