public class HttpRequester extends Object implements ConnPoolControl<HttpHost>, ModalCloseable
Constructor and Description |
---|
HttpRequester(HttpRequestExecutor requestExecutor,
HttpProcessor httpProcessor,
ManagedConnPool<HttpHost,HttpClientConnection> connPool,
SocketConfig socketConfig,
HttpConnectionFactory<? extends HttpClientConnection> connectFactory,
SSLSocketFactory sslSocketFactory,
Callback<SSLParameters> sslSetupHandler,
SSLSessionVerifier sslSessionVerifier,
Resolver<HttpHost,InetSocketAddress> addressResolver)
Use
RequesterBootstrap to create instances of this class. |
@Internal public HttpRequester(HttpRequestExecutor requestExecutor, HttpProcessor httpProcessor, ManagedConnPool<HttpHost,HttpClientConnection> connPool, SocketConfig socketConfig, HttpConnectionFactory<? extends HttpClientConnection> connectFactory, SSLSocketFactory sslSocketFactory, Callback<SSLParameters> sslSetupHandler, SSLSessionVerifier sslSessionVerifier, Resolver<HttpHost,InetSocketAddress> addressResolver)
RequesterBootstrap
to create instances of this class.public PoolStats getTotalStats()
getTotalStats
in interface ConnPoolStats<HttpHost>
public PoolStats getStats(HttpHost route)
getStats
in interface ConnPoolStats<HttpHost>
public void setMaxTotal(int max)
setMaxTotal
in interface ConnPoolControl<HttpHost>
public int getMaxTotal()
getMaxTotal
in interface ConnPoolControl<HttpHost>
public void setDefaultMaxPerRoute(int max)
setDefaultMaxPerRoute
in interface ConnPoolControl<HttpHost>
public int getDefaultMaxPerRoute()
getDefaultMaxPerRoute
in interface ConnPoolControl<HttpHost>
public void setMaxPerRoute(HttpHost route, int max)
setMaxPerRoute
in interface ConnPoolControl<HttpHost>
public int getMaxPerRoute(HttpHost route)
getMaxPerRoute
in interface ConnPoolControl<HttpHost>
public void closeIdle(TimeValue idleTime)
closeIdle
in interface ConnPoolControl<HttpHost>
public void closeExpired()
closeExpired
in interface ConnPoolControl<HttpHost>
public Set<HttpHost> getRoutes()
getRoutes
in interface ConnPoolControl<HttpHost>
public ClassicHttpResponse execute(HttpClientConnection connection, ClassicHttpRequest request, HttpResponseInformationCallback informationCallback, HttpContext context) throws HttpException, IOException
HttpException
IOException
public ClassicHttpResponse execute(HttpClientConnection connection, ClassicHttpRequest request, HttpContext context) throws HttpException, IOException
HttpException
IOException
public boolean keepAlive(HttpClientConnection connection, ClassicHttpRequest request, ClassicHttpResponse response, HttpContext context) throws IOException
IOException
public <T> T execute(HttpClientConnection connection, ClassicHttpRequest request, HttpContext context, HttpClientResponseHandler<T> responseHandler) throws HttpException, IOException
HttpException
IOException
public ClassicHttpResponse execute(HttpHost targetHost, ClassicHttpRequest request, HttpResponseInformationCallback informationCallback, Timeout connectTimeout, HttpContext context) throws HttpException, IOException
HttpException
IOException
public ClassicHttpResponse execute(HttpHost targetHost, ClassicHttpRequest request, Timeout connectTimeout, HttpContext context) throws HttpException, IOException
HttpException
IOException
public <T> T execute(HttpHost targetHost, ClassicHttpRequest request, Timeout connectTimeout, HttpContext context, HttpClientResponseHandler<T> responseHandler) throws HttpException, IOException
HttpException
IOException
public ConnPoolControl<HttpHost> getConnPoolControl()
public void close(CloseMode closeMode)
ModalCloseable
close
in interface ModalCloseable
closeMode
- How to close the receiver.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.