mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-12 21:15:57 +00:00
[HTTPCLIENT-1714] Add HttpClientBuilder.setDnsResolver(DnsResolver).
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1726732 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3c58addf11
commit
1ecdb608e5
@ -1,3 +1,14 @@
|
|||||||
|
Release 5.0-ALPHA2
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Changelog:
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
* [HTTPCLIENT-1714] Add HttpClientBuilder.setDnsResolver(DnsResolver).
|
||||||
|
Contributed by Alexis Thaveau <alexis.thaveau at gmail.com>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Release 5.0-ALPHA1
|
Release 5.0-ALPHA1
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
import javax.net.ssl.SSLSocketFactory;
|
import javax.net.ssl.SSLSocketFactory;
|
||||||
|
|
||||||
import org.apache.hc.client5.http.ConnectionKeepAliveStrategy;
|
import org.apache.hc.client5.http.ConnectionKeepAliveStrategy;
|
||||||
|
import org.apache.hc.client5.http.DnsResolver;
|
||||||
import org.apache.hc.client5.http.SchemePortResolver;
|
import org.apache.hc.client5.http.SchemePortResolver;
|
||||||
import org.apache.hc.client5.http.SystemDefaultDnsResolver;
|
import org.apache.hc.client5.http.SystemDefaultDnsResolver;
|
||||||
import org.apache.hc.client5.http.auth.AuthSchemeProvider;
|
import org.apache.hc.client5.http.auth.AuthSchemeProvider;
|
||||||
@ -170,6 +171,7 @@ public class HttpClientBuilder {
|
|||||||
private AuthenticationStrategy proxyAuthStrategy;
|
private AuthenticationStrategy proxyAuthStrategy;
|
||||||
private UserTokenHandler userTokenHandler;
|
private UserTokenHandler userTokenHandler;
|
||||||
private HttpProcessor httpprocessor;
|
private HttpProcessor httpprocessor;
|
||||||
|
private DnsResolver dnsResolver;
|
||||||
|
|
||||||
private LinkedList<HttpRequestInterceptor> requestFirst;
|
private LinkedList<HttpRequestInterceptor> requestFirst;
|
||||||
private LinkedList<HttpRequestInterceptor> requestLast;
|
private LinkedList<HttpRequestInterceptor> requestLast;
|
||||||
@ -685,6 +687,18 @@ public final HttpClientBuilder setDefaultCredentialsProvider(
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Assigns {@link DnsResolver} instance.
|
||||||
|
* <p>
|
||||||
|
* Please note this value can be overridden by the {@link #setConnectionManager(HttpClientConnectionManager)}
|
||||||
|
* method.
|
||||||
|
* </p>
|
||||||
|
*/
|
||||||
|
public final HttpClientBuilder setDnsResolver(final DnsResolver dnsResolver) {
|
||||||
|
this.dnsResolver = dnsResolver;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assigns default {@link org.apache.hc.client5.http.auth.AuthScheme} registry which will
|
* Assigns default {@link org.apache.hc.client5.http.auth.AuthScheme} registry which will
|
||||||
* be used for request execution if not explicitly set in the client execution
|
* be used for request execution if not explicitly set in the client execution
|
||||||
@ -906,7 +920,7 @@ public CloseableHttpClient build() {
|
|||||||
.build(),
|
.build(),
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
dnsResolver,
|
||||||
connTimeToLive,
|
connTimeToLive,
|
||||||
connTimeToLiveTimeUnit != null ? connTimeToLiveTimeUnit : TimeUnit.MILLISECONDS);
|
connTimeToLiveTimeUnit != null ? connTimeToLiveTimeUnit : TimeUnit.MILLISECONDS);
|
||||||
if (defaultSocketConfig != null) {
|
if (defaultSocketConfig != null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user