Top Description Fields Constructors Methods
org.apache.hc.client5.http.impl.classic

public Class MinimalHttpClient

extends CloseableHttpClient
Class Inheritance
Annotations
@Contract
threading:SAFE_CONDITIONAL
Imports
java.io.IOException, .InterruptedIOException, org.apache.hc.client5.http.ClientProtocolException, .HttpRoute, .SchemePortResolver, org.apache.hc.client5.http.classic.ExecRuntime, org.apache.hc.client5.http.config.Configurable, .RequestConfig, org.apache.hc.client5.http.impl.ConnectionShutdownException, .DefaultClientConnectionReuseStrategy, .DefaultSchemePortResolver, .ExecSupport, org.apache.hc.client5.http.io.HttpClientConnectionManager, org.apache.hc.client5.http.protocol.HttpClientContext, .RequestClientConnControl, org.apache.hc.client5.http.routing.RoutingSupport, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.concurrent.CancellableDependency, org.apache.hc.core5.http.ClassicHttpRequest, .ClassicHttpResponse, .ConnectionReuseStrategy, .HttpEntity, .HttpException, .HttpHost, org.apache.hc.core5.http.impl.io.HttpRequestExecutor, org.apache.hc.core5.http.protocol.BasicHttpContext, .DefaultHttpProcessor, .HttpContext, .HttpCoreContext, .HttpProcessor, .RequestContent, .RequestTargetHost, .RequestUserAgent, org.apache.hc.core5.io.CloseMode, org.apache.hc.core5.net.URIAuthority, org.apache.hc.core5.util.Args, .TimeValue, .VersionInfo, org.slf4j.Logger, .LoggerFactory

Minimal implementation of CloseableHttpClient. 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

Modifier and TypeField and Description
private final HttpClientConnectionManager
private final HttpProcessor
private static final Logger
private final HttpRequestExecutor
private final ConnectionReuseStrategy
private final SchemePortResolver

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.
public void
close(final CloseMode
How to close the receiver.
closeMode
)

Implements org.apache.hc.core5.io.ModalCloseable.close.

Closes this process or endpoint and releases any system resources associated with it.
protected CloseableHttpResponse
Inherited from org.apache.hc.client5.http.impl.classic.CloseableHttpClient:
executeexecuteexecuteexecuteexecuteexecuteexecuteexecute

Field Detail

connManagerback to summary
private final HttpClientConnectionManager connManager
httpProcessorback to summary
private final HttpProcessor httpProcessor
LOGback to summary
private static final Logger LOG

Hides org.apache.hc.client5.http.impl.classic.CloseableHttpClient.LOG.

requestExecutorback to summary
private final HttpRequestExecutor requestExecutor
reuseStrategyback to summary
private final ConnectionReuseStrategy reuseStrategy
schemePortResolverback to summary
private final SchemePortResolver schemePortResolver

Constructor Detail

MinimalHttpClientback to summary
pack-priv MinimalHttpClient(final HttpClientConnectionManager connManager)

Method Detail

closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
closeback to summary
public void close(final CloseMode closeMode)

Implements org.apache.hc.core5.io.ModalCloseable.close.

Doc from org.apache.hc.core5.io.ModalCloseable.close.

Closes this process or endpoint and releases any system resources associated with it. If the endpoint or the process is already closed then invoking this method has no effect.

Parameters
closeMode:CloseMode

How to close the receiver.

Annotations
@Override
doExecuteback to summary
protected CloseableHttpResponse doExecute(final HttpHost target, final ClassicHttpRequest request, final HttpContext context) throws IOException

Implements abstract org.apache.hc.client5.http.impl.classic.CloseableHttpClient.doExecute.

Annotations
@Override