org.apache.http.impl.bootstrap
Class ServerBootstrap

java.lang.Object
  extended by org.apache.http.impl.bootstrap.ServerBootstrap

public class ServerBootstrap
extends Object

Since:
4.4

Method Summary
 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(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(InetAddress localAddress)
          Assigns local interface for the listener.
 ServerBootstrap setResponseFactory(HttpResponseFactory responseFactory)
          Assigns HttpResponseFactory instance.
 ServerBootstrap setServerInfo(String serverInfo)
          Assigns Server response header value.
 ServerBootstrap setServerSocketFactory(ServerSocketFactory serverSocketFactory)
          Assigns ServerSocketFactory instance.
 ServerBootstrap setSocketConfig(SocketConfig socketConfig)
          Sets socket configuration.
 ServerBootstrap setSslContext(SSLContext sslContext)
          Assigns SSLContext instance.
 ServerBootstrap setSslSetupHandler(SSLServerSetupHandler sslSetupHandler)
          Assigns SSLServerSetupHandler instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

bootstrap

public static ServerBootstrap bootstrap()

setListenerPort

public final ServerBootstrap setListenerPort(int listenerPort)
Sets listener port number.

Returns:
this

setLocalAddress

public final ServerBootstrap setLocalAddress(InetAddress localAddress)
Assigns local interface for the listener.

Returns:
this

setSocketConfig

public final ServerBootstrap setSocketConfig(SocketConfig socketConfig)
Sets socket configuration.

Returns:
this

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.

Returns:
this

setHttpProcessor

public final ServerBootstrap setHttpProcessor(HttpProcessor httpProcessor)
Assigns HttpProcessor instance.

Returns:
this

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.

Returns:
this

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.

Returns:
this

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.

Returns:
this

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.

Returns:
this

setServerInfo

public final ServerBootstrap setServerInfo(String serverInfo)
Assigns Server response header value.

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

Returns:
this

setConnectionReuseStrategy

public final ServerBootstrap setConnectionReuseStrategy(ConnectionReuseStrategy connStrategy)
Assigns ConnectionReuseStrategy instance.

Returns:
this

setResponseFactory

public final ServerBootstrap setResponseFactory(HttpResponseFactory responseFactory)
Assigns HttpResponseFactory instance.

Returns:
this

setHandlerMapper

public final ServerBootstrap setHandlerMapper(HttpRequestHandlerMapper handlerMapper)
Assigns HttpRequestHandlerMapper instance.

Returns:
this

registerHandler

public final ServerBootstrap registerHandler(String pattern,
                                             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 - the pattern to register the handler for.
handler - the handler.
Returns:
this

setExpectationVerifier

public final ServerBootstrap setExpectationVerifier(HttpExpectationVerifier expectationVerifier)
Assigns HttpExpectationVerifier instance.

Returns:
this

setConnectionFactory

public final ServerBootstrap setConnectionFactory(HttpConnectionFactory<? extends DefaultBHttpServerConnection> connectionFactory)
Assigns HttpConnectionFactory instance.

Returns:
this

setSslSetupHandler

public final ServerBootstrap setSslSetupHandler(SSLServerSetupHandler sslSetupHandler)
Assigns SSLServerSetupHandler instance.

Returns:
this

setServerSocketFactory

public final ServerBootstrap setServerSocketFactory(ServerSocketFactory serverSocketFactory)
Assigns ServerSocketFactory instance.

Returns:
this

setSslContext

public final ServerBootstrap setSslContext(SSLContext sslContext)
Assigns SSLContext instance.

Please note this value can be overridden by the setServerSocketFactory( javax.net.ServerSocketFactory) method.

Returns:
this

setExceptionLogger

public final ServerBootstrap setExceptionLogger(ExceptionLogger exceptionLogger)
Assigns ExceptionLogger instance.

Returns:
this

create

public HttpServer create()


Copyright © 2005–2019 The Apache Software Foundation. All rights reserved.