Class MinimalHttpClient
- java.lang.Object
-
- org.apache.hc.client5.http.impl.classic.CloseableHttpClient
-
- org.apache.hc.client5.http.impl.classic.MinimalHttpClient
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,HttpClient
,org.apache.hc.core5.io.ModalCloseable
@Contract(threading=SAFE_CONDITIONAL) public class MinimalHttpClient extends CloseableHttpClient
Minimal implementation ofCloseableHttpClient
. This client is optimized for HTTP/1.1 message transport and does not support advanced HTTP protocol functionality such as request execution via a proxy, state management, authentication and request redirects.Concurrent message exchanges executed by this client will get assigned to separate connections leased from the connection pool.
- Since:
- 4.3
-
-
Field Summary
Fields Modifier and Type Field Description private HttpClientConnectionManager
connManager
private org.apache.hc.core5.http.protocol.HttpProcessor
httpProcessor
private static org.slf4j.Logger
LOG
private org.apache.hc.core5.http.impl.io.HttpRequestExecutor
requestExecutor
private org.apache.hc.core5.http.ConnectionReuseStrategy
reuseStrategy
private SchemePortResolver
schemePortResolver
-
Constructor Summary
Constructors Constructor Description MinimalHttpClient(HttpClientConnectionManager connManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
close(org.apache.hc.core5.io.CloseMode closeMode)
protected CloseableHttpResponse
doExecute(org.apache.hc.core5.http.HttpHost target, org.apache.hc.core5.http.ClassicHttpRequest request, org.apache.hc.core5.http.protocol.HttpContext context)
-
Methods inherited from class org.apache.hc.client5.http.impl.classic.CloseableHttpClient
execute, execute, execute, execute, execute, execute, execute, execute
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.hc.client5.http.classic.HttpClient
executeOpen
-
-
-
-
Field Detail
-
LOG
private static final org.slf4j.Logger LOG
-
connManager
private final HttpClientConnectionManager connManager
-
reuseStrategy
private final org.apache.hc.core5.http.ConnectionReuseStrategy reuseStrategy
-
schemePortResolver
private final SchemePortResolver schemePortResolver
-
requestExecutor
private final org.apache.hc.core5.http.impl.io.HttpRequestExecutor requestExecutor
-
httpProcessor
private final org.apache.hc.core5.http.protocol.HttpProcessor httpProcessor
-
-
Constructor Detail
-
MinimalHttpClient
MinimalHttpClient(HttpClientConnectionManager connManager)
-
-
Method Detail
-
doExecute
protected CloseableHttpResponse doExecute(org.apache.hc.core5.http.HttpHost target, org.apache.hc.core5.http.ClassicHttpRequest request, org.apache.hc.core5.http.protocol.HttpContext context) throws java.io.IOException
- Specified by:
doExecute
in classCloseableHttpClient
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Throws:
java.io.IOException
-
close
public void close(org.apache.hc.core5.io.CloseMode closeMode)
-
-