Package org.elasticsearch.http
Class AbstractHttpServerTransport
- java.lang.Object
-
- org.elasticsearch.common.component.AbstractLifecycleComponent
-
- org.elasticsearch.http.AbstractHttpServerTransport
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,LifecycleComponent,Releasable,HttpServerTransport
public abstract class AbstractHttpServerTransport extends AbstractLifecycleComponent implements HttpServerTransport
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.http.HttpServerTransport
HttpServerTransport.Dispatcher
-
-
Field Summary
Fields Modifier and Type Field Description protected BigArraysbigArraysprotected CorsHandler.ConfigcorsConfigprotected HttpServerTransport.DispatcherdispatcherHttpHandlingSettingshandlingSettingsprotected ByteSizeValuemaxContentLengthprotected NetworkServicenetworkServiceprotected PortsRangeportprotected Settingssettingsprotected ThreadPoolthreadPool-
Fields inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
lifecycle
-
Fields inherited from interface org.elasticsearch.http.HttpServerTransport
HTTP_SERVER_WORKER_THREAD_NAME_PREFIX
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractHttpServerTransport(Settings settings, NetworkService networkService, BigArrays bigArrays, ThreadPool threadPool, NamedXContentRegistry xContentRegistry, HttpServerTransport.Dispatcher dispatcher)
-
Method Summary
Modifier and Type Method Description protected abstract HttpServerChannelbind(java.net.InetSocketAddress hostAddress)protected voidbindServer()BoundTransportAddressboundAddress()protected voiddoClose()protected voiddoStop()voidincomingRequest(HttpRequest httpRequest, HttpChannel httpChannel)This method handles an incoming http request.voidincomingRequestError(HttpRequest httpRequest, HttpChannel httpChannel, java.lang.Exception exception)This method handles an incoming http request that has encountered an error.HttpInfoinfo()voidonException(HttpChannel channel, java.lang.Exception e)protected voidonServerException(HttpServerChannel channel, java.lang.Exception e)protected voidserverAcceptedChannel(HttpChannel httpChannel)HttpStatsstats()protected abstract voidstopInternal()Called to tear down internal resources-
Methods inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
addLifecycleListener, close, doStart, lifecycleState, removeLifecycleListener, start, stop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.component.LifecycleComponent
addLifecycleListener, lifecycleState, removeLifecycleListener, start, stop
-
Methods inherited from interface org.elasticsearch.common.lease.Releasable
close
-
-
-
-
Field Detail
-
settings
protected final Settings settings
-
handlingSettings
public final HttpHandlingSettings handlingSettings
-
networkService
protected final NetworkService networkService
-
bigArrays
protected final BigArrays bigArrays
-
threadPool
protected final ThreadPool threadPool
-
dispatcher
protected final HttpServerTransport.Dispatcher dispatcher
-
corsConfig
protected final CorsHandler.Config corsConfig
-
port
protected final PortsRange port
-
maxContentLength
protected final ByteSizeValue maxContentLength
-
-
Constructor Detail
-
AbstractHttpServerTransport
protected AbstractHttpServerTransport(Settings settings, NetworkService networkService, BigArrays bigArrays, ThreadPool threadPool, NamedXContentRegistry xContentRegistry, HttpServerTransport.Dispatcher dispatcher)
-
-
Method Detail
-
boundAddress
public BoundTransportAddress boundAddress()
- Specified by:
boundAddressin interfaceHttpServerTransport
-
info
public HttpInfo info()
- Specified by:
infoin interfaceHttpServerTransport
-
stats
public HttpStats stats()
- Specified by:
statsin interfaceHttpServerTransport
-
bindServer
protected void bindServer()
-
bind
protected abstract HttpServerChannel bind(java.net.InetSocketAddress hostAddress) throws java.lang.Exception
- Throws:
java.lang.Exception
-
doStop
protected void doStop()
- Specified by:
doStopin classAbstractLifecycleComponent
-
doClose
protected void doClose()
- Specified by:
doClosein classAbstractLifecycleComponent
-
stopInternal
protected abstract void stopInternal()
Called to tear down internal resources
-
onException
public void onException(HttpChannel channel, java.lang.Exception e)
-
onServerException
protected void onServerException(HttpServerChannel channel, java.lang.Exception e)
-
serverAcceptedChannel
protected void serverAcceptedChannel(HttpChannel httpChannel)
-
incomingRequest
public void incomingRequest(HttpRequest httpRequest, HttpChannel httpChannel)
This method handles an incoming http request.- Parameters:
httpRequest- that is incominghttpChannel- that received the http request
-
incomingRequestError
public void incomingRequestError(HttpRequest httpRequest, HttpChannel httpChannel, java.lang.Exception exception)
This method handles an incoming http request that has encountered an error.- Parameters:
httpRequest- that is incominghttpChannel- that received the http requestexception- that was encountered
-
-