Browse Source

DEC-12143 & REPORT-27040 & REPORT-27055 & REPORT-26964 升级httpclient的版本

research/10.0
zhouping 5 years ago
parent
commit
1b22799388
  1. 4
      fine-hsqldb/README.md
  2. 10
      fine-httpcomponents/http-client/README.md
  3. 4
      fine-httpcomponents/http-client/fluent-hc/src/main/java/com/fr/third/org/apache/http/client/fluent/Content.java
  4. 59
      fine-httpcomponents/http-client/fluent-hc/src/main/java/com/fr/third/org/apache/http/client/fluent/Executor.java
  5. 2
      fine-httpcomponents/http-client/fluent-hc/src/main/java/com/fr/third/org/apache/http/client/fluent/InternalEntityEnclosingHttpRequest.java
  6. 2
      fine-httpcomponents/http-client/fluent-hc/src/main/java/com/fr/third/org/apache/http/client/fluent/InternalHttpRequest.java
  7. 59
      fine-httpcomponents/http-client/fluent-hc/src/main/java/com/fr/third/org/apache/http/client/fluent/Request.java
  8. 5
      fine-httpcomponents/http-client/httpclient-win/src/main/java/com/fr/third/org/apache/http/impl/auth/win/CurrentWindowsCredentials.java
  9. 5
      fine-httpcomponents/http-client/httpclient-win/src/main/java/com/fr/third/org/apache/http/impl/auth/win/WindowsCredentialsProvider.java
  10. 7
      fine-httpcomponents/http-client/httpclient-win/src/main/java/com/fr/third/org/apache/http/impl/auth/win/WindowsNTLMSchemeFactory.java
  11. 6
      fine-httpcomponents/http-client/httpclient-win/src/main/java/com/fr/third/org/apache/http/impl/auth/win/WindowsNegotiateScheme.java
  12. 7
      fine-httpcomponents/http-client/httpclient-win/src/main/java/com/fr/third/org/apache/http/impl/auth/win/WindowsNegotiateSchemeFactory.java
  13. 2
      fine-httpcomponents/http-client/httpclient-win/src/main/java/com/fr/third/org/apache/http/impl/client/WinHttpClients.java
  14. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/auth/params/AuthParams.java
  15. 2
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/params/AuthPolicy.java
  16. 2
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/params/ClientParamBean.java
  17. 2
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/params/CookiePolicy.java
  18. 2
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/params/HttpClientParams.java
  19. 2
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/protocol/ClientContextConfigurer.java
  20. 6
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/protocol/RequestProxyAuthentication.java
  21. 6
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/protocol/RequestTargetAuthentication.java
  22. 6
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/protocol/ResponseAuthCache.java
  23. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/utils/JdkIdn.java
  24. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/utils/Punycode.java
  25. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/utils/Rfc3492Idn.java
  26. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/BasicEofSensorWatcher.java
  27. 7
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/BasicManagedEntity.java
  28. 10
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/MultihomePlainSocketFactory.java
  29. 2
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/OperatedClientConnection.java
  30. 2
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/params/ConnManagerParamBean.java
  31. 6
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/params/ConnManagerParams.java
  32. 6
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/params/ConnPerRouteBean.java
  33. 2
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/params/ConnRouteParamBean.java
  34. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/params/ConnRouteParams.java
  35. 10
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/scheme/PlainSocketFactory.java
  36. 7
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/ssl/SSLContextBuilder.java
  37. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/ssl/SSLContexts.java
  38. 21
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/ssl/SSLSocketFactory.java
  39. 2
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/cookie/params/CookieSpecParamBean.java
  40. 4
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/auth/NegotiateScheme.java
  41. 1
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/auth/NegotiateSchemeFactory.java
  42. 3
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/auth/SpnegoTokenGenerator.java
  43. 6
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/AbstractAuthenticationHandler.java
  44. 72
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/AbstractHttpClient.java
  45. 10
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/AuthenticationStrategyAdaptor.java
  46. 15
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/AutoRetryHttpClient.java
  47. 10
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/ClientParamsStack.java
  48. 10
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/CloseableHttpResponseProxy.java
  49. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/ContentEncodingHttpClient.java
  50. 10
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/DecompressingHttpClient.java
  51. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/DefaultHttpClient.java
  52. 7
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/DefaultProxyAuthenticationHandler.java
  53. 7
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/DefaultRedirectHandler.java
  54. 7
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/DefaultRedirectStrategyAdaptor.java
  55. 3
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/DefaultRequestDirector.java
  56. 7
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/DefaultTargetAuthenticationHandler.java
  57. 4
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/RoutedRequest.java
  58. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/SystemDefaultHttpClient.java
  59. 2
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/TunnelRefusedException.java
  60. 30
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/AbstractClientConnAdapter.java
  61. 12
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/AbstractPooledConnAdapter.java
  62. 17
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/BasicClientConnectionManager.java
  63. 15
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/DefaultClientConnection.java
  64. 10
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/DefaultClientConnectionOperator.java
  65. 8
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/DefaultHttpRoutePlanner.java
  66. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/DefaultResponseParser.java
  67. 1
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/HttpConnPool.java
  68. 13
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/LoggingSessionInputBuffer.java
  69. 12
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/LoggingSessionOutputBuffer.java
  70. 37
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/ManagedClientConnectionImpl.java
  71. 21
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/PoolingClientConnectionManager.java
  72. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/ProxySelectorRoutePlanner.java
  73. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/SchemeRegistryFactory.java
  74. 18
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/SingleClientConnManager.java
  75. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/tsccm/AbstractConnPool.java
  76. 2
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/tsccm/BasicPoolEntryRef.java
  77. 2
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java
  78. 1
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/tsccm/RouteSpecificPool.java
  79. 19
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
  80. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/BestMatchSpec.java
  81. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/BestMatchSpecFactory.java
  82. 6
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/BrowserCompatSpec.java
  83. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/BrowserCompatSpecFactory.java
  84. 6
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/BrowserCompatVersionAttributeHandler.java
  85. 3
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/DateParseException.java
  86. 3
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/DateUtils.java
  87. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/IgnoreSpecFactory.java
  88. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/NetscapeDraftSpecFactory.java
  89. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/PublicSuffixListParser.java
  90. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/RFC2109SpecFactory.java
  91. 5
      fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/RFC2965SpecFactory.java
  92. 3
      fine-httpcomponents/http-client/httpclient/src/main/java/com/fr/third/org/apache/http/auth/AUTH.java
  93. 5
      fine-httpcomponents/http-client/httpclient/src/main/java/com/fr/third/org/apache/http/auth/AuthOption.java
  94. 5
      fine-httpcomponents/http-client/httpclient/src/main/java/com/fr/third/org/apache/http/auth/AuthSchemeRegistry.java
  95. 5
      fine-httpcomponents/http-client/httpclient/src/main/java/com/fr/third/org/apache/http/auth/AuthScope.java
  96. 2
      fine-httpcomponents/http-client/httpclient/src/main/java/com/fr/third/org/apache/http/auth/AuthState.java
  97. 2
      fine-httpcomponents/http-client/httpclient/src/main/java/com/fr/third/org/apache/http/auth/AuthenticationException.java
  98. 5
      fine-httpcomponents/http-client/httpclient/src/main/java/com/fr/third/org/apache/http/auth/BasicUserPrincipal.java
  99. 3
      fine-httpcomponents/http-client/httpclient/src/main/java/com/fr/third/org/apache/http/auth/InvalidCredentialsException.java
  100. 7
      fine-httpcomponents/http-client/httpclient/src/main/java/com/fr/third/org/apache/http/auth/KerberosCredentials.java
  101. Some files were not shown because too many files have changed in this diff Show More

4
fine-hsqldb/README.md

@ -1,2 +1,2 @@
源码地址:https://sourceforge.net/projects/hsqldb/files/hsqldb <br>
版本:2.3.4
源码地址:https://sourceforge.net/projects/hsqldb/files/hsqldb <br>
版本:2.3.4

10
fine-httpcomponents/http-client/README.md

@ -1,2 +1,10 @@
源码地址:https://github.com/apache/httpcomponents-client<br>
版本:tag rel/v4.4.1
版本:tag rel/v4.5.3<br>
备注:
以下类的常量未改包名(老third包中也没有改)
com.fr.third.org.apache.http.impl.client.DefaultHttpClient
com.fr.third.org.apache.http.impl.conn.DefaultClientConnection
com.fr.third.org.apache.http.impl.conn.ManagedHttpClientConnectionFactory
com.fr.third.org.apache.http.impl.execchain.MinimalClientExec
com.fr.third.org.apache.http.impl.client.HttpClientBuilder

4
fine-httpcomponents/http-client/fluent-hc/src/main/java/com/fr/third/org/apache/http/client/fluent/Content.java

@ -34,7 +34,7 @@ import com.fr.third.org.apache.http.Consts;
import com.fr.third.org.apache.http.entity.ContentType;
/**
* This class represents arbitrary content of a specfic type that can be consumed
* This class represents arbitrary content of a specific type that can be consumed
* multiple times and requires no explicit deallocation.
*/
public class Content {
@ -44,7 +44,7 @@ public class Content {
private final byte[] raw;
private final ContentType type;
Content(final byte[] raw, final ContentType type) {
public Content(final byte[] raw, final ContentType type) {
super();
this.raw = raw;
this.type = type;

59
fine-httpcomponents/http-client/fluent-hc/src/main/java/com/fr/third/org/apache/http/client/fluent/Executor.java

@ -44,8 +44,8 @@ import com.fr.third.org.apache.http.client.AuthCache;
import com.fr.third.org.apache.http.client.ClientProtocolException;
import com.fr.third.org.apache.http.client.CookieStore;
import com.fr.third.org.apache.http.client.CredentialsProvider;
import com.fr.third.org.apache.http.client.ResponseHandler;
import com.fr.third.org.apache.http.client.HttpClient;
import com.fr.third.org.apache.http.client.ResponseHandler;
import com.fr.third.org.apache.http.client.protocol.HttpClientContext;
import com.fr.third.org.apache.http.config.Registry;
import com.fr.third.org.apache.http.config.RegistryBuilder;
@ -98,7 +98,10 @@ public class Executor {
CONNMGR = new PoolingHttpClientConnectionManager(sfr);
CONNMGR.setDefaultMaxPerRoute(100);
CONNMGR.setMaxTotal(200);
CLIENT = HttpClientBuilder.create().setConnectionManager(CONNMGR).build();
CONNMGR.setValidateAfterInactivity(1000);
CLIENT = HttpClientBuilder.create()
.setConnectionManager(CONNMGR)
.build();
}
public static Executor newInstance() {
@ -110,19 +113,28 @@ public class Executor {
}
private final HttpClient httpclient;
private final AuthCache authCache;
private final CredentialsProvider credentialsProvider;
private volatile AuthCache authCache;
private volatile CredentialsProvider credentialsProvider;
private volatile CookieStore cookieStore;
Executor(final HttpClient httpclient) {
super();
this.httpclient = httpclient;
this.credentialsProvider = new BasicCredentialsProvider();
this.authCache = new BasicAuthCache();
}
/**
* @since 4.5
*/
public Executor use(final CredentialsProvider credentialsProvider) {
this.credentialsProvider = credentialsProvider;
return this;
}
public Executor auth(final AuthScope authScope, final Credentials creds) {
if (this.credentialsProvider == null) {
this.credentialsProvider = new BasicCredentialsProvider();
}
this.credentialsProvider.setCredentials(authScope, creds);
return this;
}
@ -199,17 +211,33 @@ public class Executor {
}
public Executor clearAuth() {
this.credentialsProvider.clear();
if (this.credentialsProvider != null) {
this.credentialsProvider.clear();
}
return this;
}
/**
* @deprecated (4.5) Use {@link #use(CookieStore)}.
*/
@Deprecated
public Executor cookieStore(final CookieStore cookieStore) {
this.cookieStore = cookieStore;
return this;
}
/**
* @since 4.5
*/
public Executor use(final CookieStore cookieStore) {
this.cookieStore = cookieStore;
return this;
}
public Executor clearCookies() {
this.cookieStore.clear();
if (this.cookieStore != null) {
this.cookieStore.clear();
}
return this;
}
@ -224,11 +252,16 @@ public class Executor {
public Response execute(
final Request request) throws ClientProtocolException, IOException {
final HttpClientContext localContext = HttpClientContext.create();
localContext.setAttribute(HttpClientContext.CREDS_PROVIDER, this.credentialsProvider);
localContext.setAttribute(HttpClientContext.AUTH_CACHE, this.authCache);
localContext.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
final InternalHttpRequest httprequest = request.prepareRequest();
return new Response(this.httpclient.execute(httprequest, localContext));
if (this.credentialsProvider != null) {
localContext.setAttribute(HttpClientContext.CREDS_PROVIDER, this.credentialsProvider);
}
if (this.authCache != null) {
localContext.setAttribute(HttpClientContext.AUTH_CACHE, this.authCache);
}
if (this.cookieStore != null) {
localContext.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
}
return new Response(request.internalExecute(this.httpclient, localContext));
}
/**

2
fine-httpcomponents/http-client/fluent-hc/src/main/java/com/fr/third/org/apache/http/client/fluent/InternalEntityEnclosingHttpRequest.java

@ -32,10 +32,8 @@ import java.net.URI;
import com.fr.third.org.apache.http.Header;
import com.fr.third.org.apache.http.HttpEntity;
import com.fr.third.org.apache.http.HttpEntityEnclosingRequest;
import com.fr.third.org.apache.http.annotation.NotThreadSafe;
import com.fr.third.org.apache.http.protocol.HTTP;
@NotThreadSafe
class InternalEntityEnclosingHttpRequest extends InternalHttpRequest implements HttpEntityEnclosingRequest {
private HttpEntity entity;

2
fine-httpcomponents/http-client/fluent-hc/src/main/java/com/fr/third/org/apache/http/client/fluent/InternalHttpRequest.java

@ -34,7 +34,6 @@ import java.util.concurrent.atomic.AtomicReference;
import com.fr.third.org.apache.http.HttpVersion;
import com.fr.third.org.apache.http.ProtocolVersion;
import com.fr.third.org.apache.http.RequestLine;
import com.fr.third.org.apache.http.annotation.NotThreadSafe;
import com.fr.third.org.apache.http.client.config.RequestConfig;
import com.fr.third.org.apache.http.client.methods.Configurable;
import com.fr.third.org.apache.http.client.methods.HttpExecutionAware;
@ -44,7 +43,6 @@ import com.fr.third.org.apache.http.message.AbstractHttpMessage;
import com.fr.third.org.apache.http.message.BasicRequestLine;
import com.fr.third.org.apache.http.util.Args;
@NotThreadSafe
class InternalHttpRequest extends AbstractHttpMessage
implements HttpUriRequest, HttpExecutionAware, Configurable {

59
fine-httpcomponents/http-client/fluent-hc/src/main/java/com/fr/third/org/apache/http/client/fluent/Request.java

@ -44,10 +44,13 @@ import com.fr.third.org.apache.http.Header;
import com.fr.third.org.apache.http.HttpEntity;
import com.fr.third.org.apache.http.HttpEntityEnclosingRequest;
import com.fr.third.org.apache.http.HttpHost;
import com.fr.third.org.apache.http.HttpResponse;
import com.fr.third.org.apache.http.HttpVersion;
import com.fr.third.org.apache.http.NameValuePair;
import com.fr.third.org.apache.http.client.ClientProtocolException;
import com.fr.third.org.apache.http.client.HttpClient;
import com.fr.third.org.apache.http.client.config.RequestConfig;
import com.fr.third.org.apache.http.client.methods.Configurable;
import com.fr.third.org.apache.http.client.methods.HttpDelete;
import com.fr.third.org.apache.http.client.methods.HttpGet;
import com.fr.third.org.apache.http.client.methods.HttpHead;
@ -58,8 +61,8 @@ import com.fr.third.org.apache.http.client.methods.HttpPut;
import com.fr.third.org.apache.http.client.methods.HttpTrace;
import com.fr.third.org.apache.http.client.utils.URLEncodedUtils;
import com.fr.third.org.apache.http.entity.ContentType;
import com.fr.third.org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import com.fr.third.org.apache.http.protocol.HTTP;
import com.fr.third.org.apache.http.protocol.HttpContext;
public class Request {
@ -68,7 +71,10 @@ public class Request {
public static final TimeZone TIME_ZONE = TimeZone.getTimeZone("GMT");
private final InternalHttpRequest request;
private final RequestConfig.Builder configBuilder;
private Boolean useExpectContinue;
private Integer socketTmeout;
private Integer connectTimeout;
private HttpHost proxy;
private SimpleDateFormat dateFormatter;
@ -139,17 +145,36 @@ public class Request {
Request(final InternalHttpRequest request) {
super();
this.request = request;
this.configBuilder = RequestConfig.custom();
}
InternalHttpRequest prepareRequest() {
this.request.setConfig(this.configBuilder.build());
return this.request;
HttpResponse internalExecute(
final HttpClient client,
final HttpContext localContext) throws ClientProtocolException, IOException {
final RequestConfig.Builder builder;
if (client instanceof Configurable) {
builder = RequestConfig.copy(((Configurable) client).getConfig());
} else {
builder = RequestConfig.custom();
}
if (this.useExpectContinue != null) {
builder.setExpectContinueEnabled(this.useExpectContinue);
}
if (this.socketTmeout != null) {
builder.setSocketTimeout(this.socketTmeout);
}
if (this.connectTimeout != null) {
builder.setConnectTimeout(this.connectTimeout);
}
if (this.proxy != null) {
builder.setProxy(this.proxy);
}
final RequestConfig config = builder.build();
this.request.setConfig(config);
return client.execute(this.request, localContext);
}
public Response execute() throws ClientProtocolException, IOException {
this.request.setConfig(this.configBuilder.build());
return new Response(Executor.CLIENT.execute(this.request));
return new Response(internalExecute(Executor.CLIENT, null));
}
public void abort() throws UnsupportedOperationException {
@ -268,7 +293,7 @@ public class Request {
}
public Request useExpectContinue() {
this.configBuilder.setExpectContinueEnabled(true);
this.useExpectContinue = Boolean.TRUE;
return this;
}
@ -280,29 +305,29 @@ public class Request {
//// HTTP connection parameter operations
public Request socketTimeout(final int timeout) {
this.configBuilder.setSocketTimeout(timeout);
this.socketTmeout = timeout;
return this;
}
public Request connectTimeout(final int timeout) {
this.configBuilder.setConnectTimeout(timeout);
this.connectTimeout = timeout;
return this;
}
/**
* @deprecated (4.4) Use {@link
* PoolingHttpClientConnectionManager#setValidateAfterInactivity(int)}
* This method has no effect. Do not use.
*
* @deprecated (4.4)
*/
@Deprecated
public Request staleConnectionCheck(final boolean b) {
this.configBuilder.setStaleConnectionCheckEnabled(b);
return this;
}
//// HTTP connection route operations
public Request viaProxy(final HttpHost proxy) {
this.configBuilder.setProxy(proxy);
this.proxy = proxy;
return this;
}
@ -310,7 +335,7 @@ public class Request {
* @since 4.4
*/
public Request viaProxy(final String proxy) {
this.configBuilder.setProxy(HttpHost.create(proxy));
this.proxy = HttpHost.create(proxy);
return this;
}
@ -332,7 +357,7 @@ public class Request {
paramList.add(param);
}
final ContentType contentType = ContentType.create(URLEncodedUtils.CONTENT_TYPE, charset);
final String s = URLEncodedUtils.format(paramList, charset != null ? charset.name() : null);
final String s = URLEncodedUtils.format(paramList, charset);
return bodyString(s, contentType);
}

5
fine-httpcomponents/http-client/httpclient-win/src/main/java/com/fr/third/org/apache/http/impl/auth/win/CurrentWindowsCredentials.java

@ -30,7 +30,8 @@ package com.fr.third.org.apache.http.impl.auth.win;
import java.io.Serializable;
import java.security.Principal;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.auth.Credentials;
import com.sun.jna.platform.win32.Secur32.EXTENDED_NAME_FORMAT;
@ -44,7 +45,7 @@ import com.sun.jna.platform.win32.Secur32Util;
*
* @since 4.4
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
public final class CurrentWindowsCredentials implements Credentials, Serializable, Principal {
private static final long serialVersionUID = 4361166468529298169L;

5
fine-httpcomponents/http-client/httpclient-win/src/main/java/com/fr/third/org/apache/http/impl/auth/win/WindowsCredentialsProvider.java

@ -26,7 +26,8 @@
*/
package com.fr.third.org.apache.http.impl.auth.win;
import com.fr.third.org.apache.http.annotation.ThreadSafe;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.auth.AuthScope;
import com.fr.third.org.apache.http.auth.Credentials;
import com.fr.third.org.apache.http.client.CredentialsProvider;
@ -43,7 +44,7 @@ import com.fr.third.org.apache.http.util.Args;
*
* @since 4.4
*/
@ThreadSafe
@Contract(threading = ThreadingBehavior.SAFE)
public class WindowsCredentialsProvider implements CredentialsProvider {
private final CredentialsProvider provider;

7
fine-httpcomponents/http-client/httpclient-win/src/main/java/com/fr/third/org/apache/http/impl/auth/win/WindowsNTLMSchemeFactory.java

@ -27,7 +27,8 @@
package com.fr.third.org.apache.http.impl.auth.win;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.auth.AuthScheme;
import com.fr.third.org.apache.http.auth.AuthSchemeProvider;
import com.fr.third.org.apache.http.client.config.AuthSchemes;
@ -42,10 +43,10 @@ import com.fr.third.org.apache.http.protocol.HttpContext;
*
* @since 4.4
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
public class WindowsNTLMSchemeFactory implements AuthSchemeProvider {
private String servicePrincipalName;
private final String servicePrincipalName;
public WindowsNTLMSchemeFactory(final String servicePrincipalName) {
super();

6
fine-httpcomponents/http-client/httpclient-win/src/main/java/com/fr/third/org/apache/http/impl/auth/win/WindowsNegotiateScheme.java

@ -32,7 +32,6 @@ import org.apache.commons.logging.LogFactory;
import com.fr.third.org.apache.http.Header;
import com.fr.third.org.apache.http.HttpHost;
import com.fr.third.org.apache.http.HttpRequest;
import com.fr.third.org.apache.http.annotation.NotThreadSafe;
import com.fr.third.org.apache.http.auth.AUTH;
import com.fr.third.org.apache.http.auth.AuthenticationException;
import com.fr.third.org.apache.http.auth.Credentials;
@ -67,7 +66,6 @@ import com.sun.jna.ptr.IntByReference;
*
* @since 4.4
*/
@NotThreadSafe
public class WindowsNegotiateScheme extends AuthSchemeBase {
private final Log log = LogFactory.getLog(getClass());
@ -188,7 +186,7 @@ public class WindowsNegotiateScheme extends AuthSchemeBase {
final String targetName = getServicePrincipalName(context);
response = getToken(null, null, targetName);
} catch (RuntimeException ex) {
} catch (final RuntimeException ex) {
failAuthCleanup();
if (ex instanceof Win32Exception) {
throw new AuthenticationException("Authentication Failed", ex);
@ -206,7 +204,7 @@ public class WindowsNegotiateScheme extends AuthSchemeBase {
Sspi.SECBUFFER_TOKEN, continueTokenBytes);
final String targetName = getServicePrincipalName(context);
response = getToken(this.sspiContext, continueTokenBuffer, targetName);
} catch (RuntimeException ex) {
} catch (final RuntimeException ex) {
failAuthCleanup();
if (ex instanceof Win32Exception) {
throw new AuthenticationException("Authentication Failed", ex);

7
fine-httpcomponents/http-client/httpclient-win/src/main/java/com/fr/third/org/apache/http/impl/auth/win/WindowsNegotiateSchemeFactory.java

@ -27,7 +27,8 @@
package com.fr.third.org.apache.http.impl.auth.win;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.auth.AuthScheme;
import com.fr.third.org.apache.http.auth.AuthSchemeProvider;
import com.fr.third.org.apache.http.client.config.AuthSchemes;
@ -42,10 +43,10 @@ import com.fr.third.org.apache.http.protocol.HttpContext;
*
* @since 4.4
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
public class WindowsNegotiateSchemeFactory implements AuthSchemeProvider {
private String servicePrincipalName;
private final String servicePrincipalName;
public WindowsNegotiateSchemeFactory(final String servicePrincipalName) {
super();

2
fine-httpcomponents/http-client/httpclient-win/src/main/java/com/fr/third/org/apache/http/impl/client/WinHttpClients.java

@ -62,7 +62,7 @@ public class WinHttpClients {
if (os != null && os.contains("windows")) {
try {
return Sspi.MAX_TOKEN_SIZE > 0;
} catch (Exception ignore) { // Likely ClassNotFound
} catch (final Exception ignore) { // Likely ClassNotFound
return false;
}
}

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/auth/params/AuthParams.java

@ -27,7 +27,8 @@
package com.fr.third.org.apache.http.auth.params;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.auth.AuthSchemeProvider;
import com.fr.third.org.apache.http.auth.Credentials;
import com.fr.third.org.apache.http.auth.params.AuthPNames;
@ -46,7 +47,7 @@ import com.fr.third.org.apache.http.util.Args;
* and constructor parameters of
* {@link AuthSchemeProvider}s.
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
@Deprecated
public final class AuthParams {

2
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/params/AuthPolicy.java

@ -27,7 +27,6 @@
package com.fr.third.org.apache.http.client.params;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.client.config.AuthSchemes;
/**
@ -38,7 +37,6 @@ import com.fr.third.org.apache.http.client.config.AuthSchemes;
* @deprecated (4.3) use {@link AuthSchemes}.
*/
@Deprecated
@Immutable
public final class AuthPolicy {
private AuthPolicy() {

2
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/params/ClientParamBean.java

@ -31,7 +31,6 @@ import java.util.Collection;
import com.fr.third.org.apache.http.Header;
import com.fr.third.org.apache.http.HttpHost;
import com.fr.third.org.apache.http.annotation.NotThreadSafe;
import com.fr.third.org.apache.http.client.config.RequestConfig;
import com.fr.third.org.apache.http.client.params.ClientPNames;
import com.fr.third.org.apache.http.params.HttpAbstractParamBean;
@ -47,7 +46,6 @@ import com.fr.third.org.apache.http.params.HttpParams;
* @deprecated (4.3) use {@link RequestConfig}.
*/
@Deprecated
@NotThreadSafe
public class ClientParamBean extends HttpAbstractParamBean {
public ClientParamBean (final HttpParams params) {

2
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/params/CookiePolicy.java

@ -27,7 +27,6 @@
package com.fr.third.org.apache.http.client.params;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.client.config.CookieSpecs;
/**
@ -38,7 +37,6 @@ import com.fr.third.org.apache.http.client.config.CookieSpecs;
* @deprecated (4.3) use {@link CookieSpecs}.
*/
@Deprecated
@Immutable
public final class CookiePolicy {
/**

2
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/params/HttpClientParams.java

@ -26,7 +26,6 @@
*/
package com.fr.third.org.apache.http.client.params;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.client.config.RequestConfig;
import com.fr.third.org.apache.http.params.HttpConnectionParams;
import com.fr.third.org.apache.http.params.HttpParams;
@ -40,7 +39,6 @@ import com.fr.third.org.apache.http.util.Args;
* @deprecated (4.3) use {@link RequestConfig}
*/
@Deprecated
@Immutable
public class HttpClientParams {
private HttpClientParams() {

2
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/protocol/ClientContextConfigurer.java

@ -27,7 +27,6 @@
package com.fr.third.org.apache.http.client.protocol;
import com.fr.third.org.apache.http.annotation.NotThreadSafe;
import com.fr.third.org.apache.http.auth.AuthSchemeRegistry;
import com.fr.third.org.apache.http.client.CookieStore;
import com.fr.third.org.apache.http.client.CredentialsProvider;
@ -42,7 +41,6 @@ import com.fr.third.org.apache.http.util.Args;
*
* @deprecated (4.3) use {@link HttpClientContext}
*/
@NotThreadSafe
@Deprecated
public class ClientContextConfigurer implements ClientContext {

6
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/protocol/RequestProxyAuthentication.java

@ -31,7 +31,8 @@ import java.io.IOException;
import com.fr.third.org.apache.http.HttpException;
import com.fr.third.org.apache.http.HttpRequest;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.auth.AUTH;
import com.fr.third.org.apache.http.auth.AuthState;
import com.fr.third.org.apache.http.conn.HttpRoutedConnection;
@ -50,13 +51,14 @@ import com.fr.third.org.apache.http.util.Args;
* @deprecated (4.3) use {@link HttpAuthenticator}.
*/
@Deprecated
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
public class RequestProxyAuthentication extends RequestAuthenticationBase {
public RequestProxyAuthentication() {
super();
}
@Override
public void process(final HttpRequest request, final HttpContext context)
throws HttpException, IOException {
Args.notNull(request, "HTTP request");

6
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/protocol/RequestTargetAuthentication.java

@ -31,7 +31,8 @@ import java.io.IOException;
import com.fr.third.org.apache.http.HttpException;
import com.fr.third.org.apache.http.HttpRequest;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.auth.AUTH;
import com.fr.third.org.apache.http.auth.AuthState;
import com.fr.third.org.apache.http.impl.auth.HttpAuthenticator;
@ -47,13 +48,14 @@ import com.fr.third.org.apache.http.util.Args;
* @deprecated (4.3) use {@link HttpAuthenticator}.
*/
@Deprecated
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
public class RequestTargetAuthentication extends RequestAuthenticationBase {
public RequestTargetAuthentication() {
super();
}
@Override
public void process(final HttpRequest request, final HttpContext context)
throws HttpException, IOException {
Args.notNull(request, "HTTP request");

6
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/protocol/ResponseAuthCache.java

@ -36,7 +36,8 @@ import com.fr.third.org.apache.http.HttpException;
import com.fr.third.org.apache.http.HttpHost;
import com.fr.third.org.apache.http.HttpResponse;
import com.fr.third.org.apache.http.HttpResponseInterceptor;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.auth.AuthScheme;
import com.fr.third.org.apache.http.auth.AuthState;
import com.fr.third.org.apache.http.client.AuthCache;
@ -58,7 +59,7 @@ import com.fr.third.org.apache.http.util.Args;
*
* @deprecated (4.2) use {@link AuthenticationStrategy}
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
@Deprecated
public class ResponseAuthCache implements HttpResponseInterceptor {
@ -68,6 +69,7 @@ public class ResponseAuthCache implements HttpResponseInterceptor {
super();
}
@Override
public void process(final HttpResponse response, final HttpContext context)
throws HttpException, IOException {
Args.notNull(response, "HTTP request");

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/utils/JdkIdn.java

@ -29,7 +29,8 @@ package com.fr.third.org.apache.http.client.utils;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
/**
* Uses the java.net.IDN class through reflection.
@ -38,7 +39,7 @@ import com.fr.third.org.apache.http.annotation.Immutable;
*
* @since 4.0
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
@Deprecated
public class JdkIdn implements Idn {
private final Method toUnicode;

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/utils/Punycode.java

@ -26,7 +26,8 @@
*/
package com.fr.third.org.apache.http.client.utils;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
/**
* Facade that provides conversion between Unicode and Punycode domain names.
@ -36,7 +37,7 @@ import com.fr.third.org.apache.http.annotation.Immutable;
*
* @since 4.0
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
@Deprecated
public class Punycode {
private static final Idn impl;

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/client/utils/Rfc3492Idn.java

@ -28,7 +28,8 @@ package com.fr.third.org.apache.http.client.utils;
import java.util.StringTokenizer;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
/**
* Implementation from pseudo code in RFC 3492.
@ -37,7 +38,7 @@ import com.fr.third.org.apache.http.annotation.Immutable;
*
* @since 4.0
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
@Deprecated
public class Rfc3492Idn implements Idn {
private static final int base = 36;

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/BasicEofSensorWatcher.java

@ -29,7 +29,6 @@ package com.fr.third.org.apache.http.conn;
import java.io.IOException;
import java.io.InputStream;
import com.fr.third.org.apache.http.annotation.NotThreadSafe;
import com.fr.third.org.apache.http.conn.EofSensorWatcher;
import com.fr.third.org.apache.http.conn.ManagedClientConnection;
import com.fr.third.org.apache.http.util.Args;
@ -43,7 +42,6 @@ import com.fr.third.org.apache.http.util.Args;
* @deprecated (4.3) do not use.
*/
@Deprecated
@NotThreadSafe
public class BasicEofSensorWatcher implements EofSensorWatcher {
/** The connection to auto-release. */
@ -65,6 +63,7 @@ public class BasicEofSensorWatcher implements EofSensorWatcher {
attemptReuse = reuse;
}
@Override
public boolean eofDetected(final InputStream wrapped)
throws IOException {
@ -81,6 +80,7 @@ public class BasicEofSensorWatcher implements EofSensorWatcher {
return false;
}
@Override
public boolean streamClosed(final InputStream wrapped)
throws IOException {
@ -97,6 +97,7 @@ public class BasicEofSensorWatcher implements EofSensorWatcher {
return false;
}
@Override
public boolean streamAbort(final InputStream wrapped)
throws IOException {

7
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/BasicManagedEntity.java

@ -32,7 +32,6 @@ import java.io.OutputStream;
import java.net.SocketException;
import com.fr.third.org.apache.http.HttpEntity;
import com.fr.third.org.apache.http.annotation.NotThreadSafe;
import com.fr.third.org.apache.http.conn.ConnectionReleaseTrigger;
import com.fr.third.org.apache.http.conn.EofSensorInputStream;
import com.fr.third.org.apache.http.conn.EofSensorWatcher;
@ -52,7 +51,6 @@ import com.fr.third.org.apache.http.util.EntityUtils;
* @deprecated (4.3) do not use.
*/
@Deprecated
@NotThreadSafe
public class BasicManagedEntity extends HttpEntityWrapper
implements ConnectionReleaseTrigger, EofSensorWatcher {
@ -124,10 +122,12 @@ public class BasicManagedEntity extends HttpEntityWrapper
ensureConsumed();
}
@Override
public void releaseConnection() throws IOException {
ensureConsumed();
}
@Override
public void abortConnection() throws IOException {
if (managedConn != null) {
@ -139,6 +139,7 @@ public class BasicManagedEntity extends HttpEntityWrapper
}
}
@Override
public boolean eofDetected(final InputStream wrapped) throws IOException {
try {
if (managedConn != null) {
@ -157,6 +158,7 @@ public class BasicManagedEntity extends HttpEntityWrapper
return false;
}
@Override
public boolean streamClosed(final InputStream wrapped) throws IOException {
try {
if (managedConn != null) {
@ -182,6 +184,7 @@ public class BasicManagedEntity extends HttpEntityWrapper
return false;
}
@Override
public boolean streamAbort(final InputStream wrapped) throws IOException {
if (managedConn != null) {
managedConn.abortConnection();

10
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/MultihomePlainSocketFactory.java

@ -37,7 +37,8 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.conn.scheme.SchemeSocketFactory;
import com.fr.third.org.apache.http.conn.scheme.SocketFactory;
import com.fr.third.org.apache.http.params.HttpConnectionParams;
@ -58,7 +59,7 @@ import com.fr.third.org.apache.http.util.Asserts;
* {@link SchemeSocketFactory} interface.
*/
@Deprecated
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
public final class MultihomePlainSocketFactory implements SocketFactory {
/**
@ -83,7 +84,8 @@ public final class MultihomePlainSocketFactory implements SocketFactory {
}
// non-javadoc, see interface org.apache.http.conn.SocketFactory
// non-javadoc, see interface com.fr.third.org.apache.http.conn.SocketFactory
@Override
public Socket createSocket() {
return new Socket();
}
@ -103,6 +105,7 @@ public final class MultihomePlainSocketFactory implements SocketFactory {
* @throws IOException if an error occurs during the connection
* @throws SocketTimeoutException if timeout expires before connecting
*/
@Override
public Socket connectSocket(final Socket socket, final String host, final int port,
final InetAddress localAddress, final int localPort,
final HttpParams params)
@ -160,6 +163,7 @@ public final class MultihomePlainSocketFactory implements SocketFactory {
*
* @throws IllegalArgumentException if the argument is invalid
*/
@Override
public final boolean isSecure(final Socket sock)
throws IllegalArgumentException {

2
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/OperatedClientConnection.java

@ -30,8 +30,8 @@ package com.fr.third.org.apache.http.conn;
import java.io.IOException;
import java.net.Socket;
import com.fr.third.org.apache.http.HttpConnection;
import com.fr.third.org.apache.http.HttpClientConnection;
import com.fr.third.org.apache.http.HttpConnection;
import com.fr.third.org.apache.http.HttpHost;
import com.fr.third.org.apache.http.HttpInetConnection;
import com.fr.third.org.apache.http.params.HttpParams;

2
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/params/ConnManagerParamBean.java

@ -27,7 +27,6 @@
package com.fr.third.org.apache.http.conn.params;
import com.fr.third.org.apache.http.annotation.NotThreadSafe;
import com.fr.third.org.apache.http.params.HttpAbstractParamBean;
import com.fr.third.org.apache.http.params.HttpParams;
@ -40,7 +39,6 @@ import com.fr.third.org.apache.http.params.HttpParams;
*
* @deprecated (4.1) use configuration methods of the specific connection manager implementation.
*/
@NotThreadSafe
@Deprecated
public class ConnManagerParamBean extends HttpAbstractParamBean {

6
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/params/ConnManagerParams.java

@ -26,7 +26,8 @@
*/
package com.fr.third.org.apache.http.conn.params;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.conn.ClientConnectionManager;
import com.fr.third.org.apache.http.conn.ManagedClientConnection;
import com.fr.third.org.apache.http.params.HttpConnectionParams;
@ -45,7 +46,7 @@ import com.fr.third.org.apache.http.util.Args;
* @deprecated (4.1) use configuration methods of the specific connection manager implementation.
*/
@Deprecated
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
public final class ConnManagerParams implements ConnManagerPNames {
/** The default maximum number of connections allowed overall */
@ -86,6 +87,7 @@ public final class ConnManagerParams implements ConnManagerPNames {
/** The default maximum number of connections allowed per host */
private static final ConnPerRoute DEFAULT_CONN_PER_ROUTE = new ConnPerRoute() {
@Override
public int getMaxForRoute(final HttpRoute route) {
return ConnPerRouteBean.DEFAULT_MAX_CONNECTIONS_PER_ROUTE;
}

6
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/params/ConnPerRouteBean.java

@ -29,7 +29,8 @@ package com.fr.third.org.apache.http.conn.params;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.fr.third.org.apache.http.annotation.ThreadSafe;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.conn.ClientConnectionManager;
import com.fr.third.org.apache.http.pool.ConnPoolControl;
import com.fr.third.org.apache.http.conn.routing.HttpRoute;
@ -46,7 +47,7 @@ import com.fr.third.org.apache.http.util.Args;
* @deprecated (4.2) use {@link ConnPoolControl}
*/
@Deprecated
@ThreadSafe
@Contract(threading = ThreadingBehavior.SAFE)
public final class ConnPerRouteBean implements ConnPerRoute {
/** The default maximum number of connections allowed per host */
@ -88,6 +89,7 @@ public final class ConnPerRouteBean implements ConnPerRoute {
this.maxPerHostMap.put(route, Integer.valueOf(max));
}
@Override
public int getMaxForRoute(final HttpRoute route) {
Args.notNull(route, "HTTP route");
final Integer max = this.maxPerHostMap.get(route);

2
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/params/ConnRouteParamBean.java

@ -30,7 +30,6 @@ package com.fr.third.org.apache.http.conn.params;
import java.net.InetAddress;
import com.fr.third.org.apache.http.HttpHost;
import com.fr.third.org.apache.http.annotation.NotThreadSafe;
import com.fr.third.org.apache.http.client.config.RequestConfig;
import com.fr.third.org.apache.http.conn.params.ConnRoutePNames;
import com.fr.third.org.apache.http.conn.routing.HttpRoute;
@ -47,7 +46,6 @@ import com.fr.third.org.apache.http.params.HttpParams;
* @deprecated (4.3) use {@link RequestConfig}.
*/
@Deprecated
@NotThreadSafe
public class ConnRouteParamBean extends HttpAbstractParamBean {
public ConnRouteParamBean (final HttpParams params) {

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/params/ConnRouteParams.java

@ -29,7 +29,8 @@ package com.fr.third.org.apache.http.conn.params;
import java.net.InetAddress;
import com.fr.third.org.apache.http.HttpHost;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.client.config.RequestConfig;
import com.fr.third.org.apache.http.conn.params.ConnRoutePNames;
import com.fr.third.org.apache.http.conn.routing.HttpRoute;
@ -45,7 +46,7 @@ import com.fr.third.org.apache.http.util.Args;
* @deprecated (4.3) use {@link RequestConfig}.
*/
@Deprecated
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
public class ConnRouteParams implements ConnRoutePNames {
/**

10
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/scheme/PlainSocketFactory.java

@ -34,7 +34,8 @@ import java.net.Socket;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.conn.DnsResolver;
import com.fr.third.org.apache.http.conn.socket.PlainConnectionSocketFactory;
import com.fr.third.org.apache.http.conn.ConnectTimeoutException;
@ -49,7 +50,7 @@ import com.fr.third.org.apache.http.util.Args;
*
* @deprecated (4.3) use {@link PlainConnectionSocketFactory}
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
@Deprecated
public class PlainSocketFactory implements SocketFactory, SchemeSocketFactory {
@ -85,10 +86,12 @@ public class PlainSocketFactory implements SocketFactory, SchemeSocketFactory {
*
* @since 4.1
*/
@Override
public Socket createSocket(final HttpParams params) {
return new Socket();
}
@Override
public Socket createSocket() {
return new Socket();
}
@ -96,6 +99,7 @@ public class PlainSocketFactory implements SocketFactory, SchemeSocketFactory {
/**
* @since 4.1
*/
@Override
public Socket connectSocket(
final Socket socket,
final InetSocketAddress remoteAddress,
@ -132,6 +136,7 @@ public class PlainSocketFactory implements SocketFactory, SchemeSocketFactory {
*
* @return {@code false}
*/
@Override
public final boolean isSecure(final Socket sock) {
return false;
}
@ -139,6 +144,7 @@ public class PlainSocketFactory implements SocketFactory, SchemeSocketFactory {
/**
* @deprecated (4.1) Use {@link #connectSocket(Socket, InetSocketAddress, InetSocketAddress, HttpParams)}
*/
@Override
@Deprecated
public Socket connectSocket(
final Socket socket,

7
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/ssl/SSLContextBuilder.java

@ -51,8 +51,6 @@ import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509KeyManager;
import javax.net.ssl.X509TrustManager;
import com.fr.third.org.apache.http.annotation.NotThreadSafe;
/**
* Builder for {@link SSLContext} instances.
*
@ -60,7 +58,6 @@ import com.fr.third.org.apache.http.annotation.NotThreadSafe;
*
* @deprecated (4.4) use {@link com.fr.third.org.apache.http.ssl.SSLContextBuilder}.
*/
@NotThreadSafe
@Deprecated
public class SSLContextBuilder {
@ -68,8 +65,8 @@ public class SSLContextBuilder {
static final String SSL = "SSL";
private String protocol;
private Set<KeyManager> keymanagers;
private Set<TrustManager> trustmanagers;
private final Set<KeyManager> keymanagers;
private final Set<TrustManager> trustmanagers;
private SecureRandom secureRandom;
public SSLContextBuilder() {

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/ssl/SSLContexts.java

@ -32,7 +32,8 @@ import java.security.NoSuchAlgorithmException;
import javax.net.ssl.SSLContext;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
/**
* {@link SSLContext} factory methods.
@ -41,7 +42,7 @@ import com.fr.third.org.apache.http.annotation.Immutable;
*
* @deprecated (4.4) use {@link com.fr.third.org.apache.http.ssl.SSLContexts}.
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
@Deprecated
public class SSLContexts {

21
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/conn/ssl/SSLSocketFactory.java

@ -39,11 +39,13 @@ import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.UnrecoverableKeyException;
import javax.net.SocketFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import com.fr.third.org.apache.http.HttpHost;
import com.fr.third.org.apache.http.annotation.ThreadSafe;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.conn.ConnectTimeoutException;
import com.fr.third.org.apache.http.conn.HttpInetSocketAddress;
import com.fr.third.org.apache.http.conn.scheme.HostNameResolver;
@ -139,7 +141,7 @@ import com.fr.third.org.apache.http.util.TextUtils;
*
* @deprecated (4.3) use {@link SSLConnectionSocketFactory}.
*/
@ThreadSafe
@Contract(threading = ThreadingBehavior.SAFE_CONDITIONAL)
@Deprecated
public class SSLSocketFactory implements LayeredConnectionSocketFactory, SchemeLayeredSocketFactory,
LayeredSchemeSocketFactory, LayeredSocketFactory {
@ -379,10 +381,12 @@ public class SSLSocketFactory implements LayeredConnectionSocketFactory, SchemeL
* This method will create a unconnected instance of {@link Socket} class.
* @since 4.1
*/
@Override
public Socket createSocket(final HttpParams params) throws IOException {
return createSocket((HttpContext) null);
}
@Override
public Socket createSocket() throws IOException {
return createSocket((HttpContext) null);
}
@ -390,6 +394,7 @@ public class SSLSocketFactory implements LayeredConnectionSocketFactory, SchemeL
/**
* @since 4.1
*/
@Override
public Socket connectSocket(
final Socket socket,
final InetSocketAddress remoteAddress,
@ -424,6 +429,7 @@ public class SSLSocketFactory implements LayeredConnectionSocketFactory, SchemeL
*
* @throws IllegalArgumentException if the argument is invalid
*/
@Override
public boolean isSecure(final Socket sock) throws IllegalArgumentException {
Args.notNull(sock, "Socket");
Asserts.check(sock instanceof SSLSocket, "Socket not created by this factory");
@ -434,6 +440,7 @@ public class SSLSocketFactory implements LayeredConnectionSocketFactory, SchemeL
/**
* @since 4.2
*/
@Override
public Socket createLayeredSocket(
final Socket socket,
final String host,
@ -442,6 +449,7 @@ public class SSLSocketFactory implements LayeredConnectionSocketFactory, SchemeL
return createLayeredSocket(socket, host, port, (HttpContext) null);
}
@Override
public Socket createLayeredSocket(
final Socket socket,
final String host,
@ -459,6 +467,7 @@ public class SSLSocketFactory implements LayeredConnectionSocketFactory, SchemeL
return this.hostnameVerifier;
}
@Override
public Socket connectSocket(
final Socket socket,
final String host, final int port,
@ -479,6 +488,7 @@ public class SSLSocketFactory implements LayeredConnectionSocketFactory, SchemeL
return connectSocket(socket, remoteAddress, localAddress, params);
}
@Override
public Socket createSocket(
final Socket socket,
final String host, final int port,
@ -509,12 +519,12 @@ public class SSLSocketFactory implements LayeredConnectionSocketFactory, SchemeL
prepareSocket(socket);
}
@Override
public Socket createSocket(final HttpContext context) throws IOException {
final SSLSocket sock = (SSLSocket) this.socketfactory.createSocket();
internalPrepareSocket(sock);
return sock;
return SocketFactory.getDefault().createSocket();
}
@Override
public Socket connectSocket(
final int connectTimeout,
final Socket socket,
@ -548,6 +558,7 @@ public class SSLSocketFactory implements LayeredConnectionSocketFactory, SchemeL
}
}
@Override
public Socket createLayeredSocket(
final Socket socket,
final String target,

2
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/cookie/params/CookieSpecParamBean.java

@ -29,7 +29,6 @@ package com.fr.third.org.apache.http.cookie.params;
import java.util.Collection;
import com.fr.third.org.apache.http.annotation.NotThreadSafe;
import com.fr.third.org.apache.http.cookie.CookieSpecProvider;
import com.fr.third.org.apache.http.cookie.params.CookieSpecPNames;
import com.fr.third.org.apache.http.params.HttpAbstractParamBean;
@ -46,7 +45,6 @@ import com.fr.third.org.apache.http.params.HttpParams;
* CookieSpecProvider}s.
*/
@Deprecated
@NotThreadSafe
public class CookieSpecParamBean extends HttpAbstractParamBean {
public CookieSpecParamBean (final HttpParams params) {

4
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/auth/NegotiateScheme.java

@ -79,6 +79,7 @@ public class NegotiateScheme extends GGSSchemeBase {
*
* @return {@code Negotiate}
*/
@Override
public String getSchemeName() {
return "Negotiate";
}
@ -181,6 +182,7 @@ public class NegotiateScheme extends GGSSchemeBase {
*
* @return the parameter with the given name
*/
@Override
public String getParameter(final String name) {
Args.notNull(name, "Parameter name");
return null;
@ -192,6 +194,7 @@ public class NegotiateScheme extends GGSSchemeBase {
*
* @return {@code null}
*/
@Override
public String getRealm() {
return null;
}
@ -202,6 +205,7 @@ public class NegotiateScheme extends GGSSchemeBase {
*
* @return {@code true}.
*/
@Override
public boolean isConnectionBased() {
return true;
}

1
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/auth/NegotiateSchemeFactory.java

@ -58,6 +58,7 @@ public class NegotiateSchemeFactory implements AuthSchemeFactory {
this(null, false);
}
@Override
public AuthScheme newInstance(final HttpParams params) {
return new NegotiateScheme(this.spengoGenerator, this.stripPort);
}

3
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/auth/SpnegoTokenGenerator.java

@ -26,6 +26,7 @@
*/
package com.fr.third.org.apache.http.impl.auth;
import com.fr.third.org.apache.http.auth.Credentials;
import com.fr.third.org.apache.http.impl.auth.KerberosScheme;
import java.io.IOException;
@ -39,7 +40,7 @@ import java.io.IOException;
* @since 4.1
*
* @deprecated (4.2) subclass {@link KerberosScheme} and override
* {@link KerberosScheme#generateGSSToken(byte[], org.ietf.jgss.Oid, String)}
* {@link KerberosScheme#generateGSSToken(byte[], org.ietf.jgss.Oid, String, Credentials)}
*/
@Deprecated
public interface SpnegoTokenGenerator {

6
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/AbstractAuthenticationHandler.java

@ -41,7 +41,8 @@ import org.apache.commons.logging.LogFactory;
import com.fr.third.org.apache.http.FormattedHeader;
import com.fr.third.org.apache.http.Header;
import com.fr.third.org.apache.http.HttpResponse;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.auth.AuthScheme;
import com.fr.third.org.apache.http.auth.AuthSchemeRegistry;
import com.fr.third.org.apache.http.auth.AuthenticationException;
@ -62,7 +63,7 @@ import com.fr.third.org.apache.http.util.CharArrayBuffer;
* @deprecated (4.2) use {@link AuthenticationStrategy}
*/
@Deprecated
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
public abstract class AbstractAuthenticationHandler implements AuthenticationHandler {
private final Log log = LogFactory.getLog(getClass());
@ -136,6 +137,7 @@ public abstract class AbstractAuthenticationHandler implements AuthenticationHan
return getAuthPreferences();
}
@Override
public AuthScheme selectScheme(
final Map<String, Header> challenges,
final HttpResponse response,

72
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/AbstractHttpClient.java

@ -39,8 +39,8 @@ import com.fr.third.org.apache.http.HttpHost;
import com.fr.third.org.apache.http.HttpRequest;
import com.fr.third.org.apache.http.HttpRequestInterceptor;
import com.fr.third.org.apache.http.HttpResponseInterceptor;
import com.fr.third.org.apache.http.annotation.GuardedBy;
import com.fr.third.org.apache.http.annotation.ThreadSafe;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.auth.AuthSchemeRegistry;
import com.fr.third.org.apache.http.client.AuthenticationHandler;
import com.fr.third.org.apache.http.client.AuthenticationStrategy;
@ -195,85 +195,30 @@ import com.fr.third.org.apache.http.util.Args;
*
* @deprecated (4.3) use {@link HttpClientBuilder}.
*/
@ThreadSafe
@Contract(threading = ThreadingBehavior.SAFE_CONDITIONAL)
@Deprecated
public abstract class AbstractHttpClient extends CloseableHttpClient {
private final Log log = LogFactory.getLog(getClass());
/** The parameters. */
@GuardedBy("this")
private HttpParams defaultParams;
/** The request executor. */
@GuardedBy("this")
private HttpRequestExecutor requestExec;
/** The connection manager. */
@GuardedBy("this")
private ClientConnectionManager connManager;
/** The connection re-use strategy. */
@GuardedBy("this")
private ConnectionReuseStrategy reuseStrategy;
/** The connection keep-alive strategy. */
@GuardedBy("this")
private ConnectionKeepAliveStrategy keepAliveStrategy;
/** The cookie spec registry. */
@GuardedBy("this")
private CookieSpecRegistry supportedCookieSpecs;
/** The authentication scheme registry. */
@GuardedBy("this")
private AuthSchemeRegistry supportedAuthSchemes;
/** The HTTP protocol processor and its immutable copy. */
@GuardedBy("this")
private BasicHttpProcessor mutableProcessor;
@GuardedBy("this")
private ImmutableHttpProcessor protocolProcessor;
/** The request retry handler. */
@GuardedBy("this")
private HttpRequestRetryHandler retryHandler;
/** The redirect handler. */
@GuardedBy("this")
private RedirectStrategy redirectStrategy;
/** The target authentication handler. */
@GuardedBy("this")
private AuthenticationStrategy targetAuthStrategy;
/** The proxy authentication handler. */
@GuardedBy("this")
private AuthenticationStrategy proxyAuthStrategy;
/** The cookie store. */
@GuardedBy("this")
private CookieStore cookieStore;
/** The credentials provider. */
@GuardedBy("this")
private CredentialsProvider credsProvider;
/** The route planner. */
@GuardedBy("this")
private HttpRoutePlanner routePlanner;
/** The user token handler. */
@GuardedBy("this")
private UserTokenHandler userTokenHandler;
/** The connection backoff strategy. */
@GuardedBy("this")
private ConnectionBackoffStrategy connectionBackoffStrategy;
/** The backoff manager. */
@GuardedBy("this")
private BackoffManager backoffManager;
/**
@ -328,9 +273,15 @@ public abstract class AbstractHttpClient extends CloseableHttpClient {
final String className = (String) params.getParameter(
ClientPNames.CONNECTION_MANAGER_FACTORY_CLASS_NAME);
final ClassLoader contextLoader = Thread.currentThread().getContextClassLoader();
if (className != null) {
try {
final Class<?> clazz = Class.forName(className);
final Class<?> clazz;
if (contextLoader != null) {
clazz = Class.forName(className, true, contextLoader);
} else {
clazz = Class.forName(className);
}
factory = (ClientConnectionManagerFactory) clazz.newInstance();
} catch (final ClassNotFoundException ex) {
throw new IllegalStateException("Invalid class name: " + className);
@ -462,6 +413,7 @@ public abstract class AbstractHttpClient extends CloseableHttpClient {
}
// non-javadoc, see interface HttpClient
@Override
public synchronized final HttpParams getParams() {
if (defaultParams == null) {
defaultParams = createHttpParams();
@ -480,6 +432,7 @@ public abstract class AbstractHttpClient extends CloseableHttpClient {
}
@Override
public synchronized final ClientConnectionManager getConnectionManager() {
if (connManager == null) {
connManager = createClientConnectionManager();
@ -1008,6 +961,7 @@ public abstract class AbstractHttpClient extends CloseableHttpClient {
}
@Override
public void close() {
getConnectionManager().shutdown();
}

10
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/AuthenticationStrategyAdaptor.java

@ -38,7 +38,8 @@ import org.apache.commons.logging.LogFactory;
import com.fr.third.org.apache.http.Header;
import com.fr.third.org.apache.http.HttpHost;
import com.fr.third.org.apache.http.HttpResponse;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.auth.AuthOption;
import com.fr.third.org.apache.http.auth.AuthScheme;
import com.fr.third.org.apache.http.auth.AuthScope;
@ -57,7 +58,7 @@ import com.fr.third.org.apache.http.util.Args;
/**
* @deprecated (4.2) do not use
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
@Deprecated
class AuthenticationStrategyAdaptor implements AuthenticationStrategy {
@ -70,6 +71,7 @@ class AuthenticationStrategyAdaptor implements AuthenticationStrategy {
this.handler = handler;
}
@Override
public boolean isAuthenticationRequested(
final HttpHost authhost,
final HttpResponse response,
@ -77,6 +79,7 @@ class AuthenticationStrategyAdaptor implements AuthenticationStrategy {
return this.handler.isAuthenticationRequested(response, context);
}
@Override
public Map<String, Header> getChallenges(
final HttpHost authhost,
final HttpResponse response,
@ -84,6 +87,7 @@ class AuthenticationStrategyAdaptor implements AuthenticationStrategy {
return this.handler.getChallenges(response, context);
}
@Override
public Queue<AuthOption> select(
final Map<String, Header> challenges,
final HttpHost authhost,
@ -128,6 +132,7 @@ class AuthenticationStrategyAdaptor implements AuthenticationStrategy {
return options;
}
@Override
public void authSucceeded(
final HttpHost authhost, final AuthScheme authScheme, final HttpContext context) {
AuthCache authCache = (AuthCache) context.getAttribute(ClientContext.AUTH_CACHE);
@ -144,6 +149,7 @@ class AuthenticationStrategyAdaptor implements AuthenticationStrategy {
}
}
@Override
public void authFailed(
final HttpHost authhost, final AuthScheme authScheme, final HttpContext context) {
final AuthCache authCache = (AuthCache) context.getAttribute(ClientContext.AUTH_CACHE);

15
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/AutoRetryHttpClient.java

@ -36,7 +36,8 @@ import org.apache.commons.logging.LogFactory;
import com.fr.third.org.apache.http.HttpHost;
import com.fr.third.org.apache.http.HttpRequest;
import com.fr.third.org.apache.http.HttpResponse;
import com.fr.third.org.apache.http.annotation.ThreadSafe;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.client.HttpClient;
import com.fr.third.org.apache.http.client.ResponseHandler;
import com.fr.third.org.apache.http.client.ServiceUnavailableRetryStrategy;
@ -56,7 +57,7 @@ import com.fr.third.org.apache.http.util.EntityUtils;
* @deprecated (4.3) use {@link HttpClientBuilder}.
*/
@Deprecated
@ThreadSafe
@Contract(threading = ThreadingBehavior.SAFE_CONDITIONAL)
public class AutoRetryHttpClient implements HttpClient {
private final HttpClient backend;
@ -107,17 +108,20 @@ public class AutoRetryHttpClient implements HttpClient {
this(client, new DefaultServiceUnavailableRetryStrategy());
}
@Override
public HttpResponse execute(final HttpHost target, final HttpRequest request)
throws IOException {
final HttpContext defaultContext = null;
return execute(target, request, defaultContext);
}
@Override
public <T> T execute(final HttpHost target, final HttpRequest request,
final ResponseHandler<? extends T> responseHandler) throws IOException {
return execute(target, request, responseHandler, null);
}
@Override
public <T> T execute(final HttpHost target, final HttpRequest request,
final ResponseHandler<? extends T> responseHandler, final HttpContext context)
throws IOException {
@ -125,11 +129,13 @@ public class AutoRetryHttpClient implements HttpClient {
return responseHandler.handleResponse(resp);
}
@Override
public HttpResponse execute(final HttpUriRequest request) throws IOException {
final HttpContext context = null;
return execute(request, context);
}
@Override
public HttpResponse execute(final HttpUriRequest request, final HttpContext context)
throws IOException {
final URI uri = request.getURI();
@ -138,11 +144,13 @@ public class AutoRetryHttpClient implements HttpClient {
return execute(httpHost, request, context);
}
@Override
public <T> T execute(final HttpUriRequest request,
final ResponseHandler<? extends T> responseHandler) throws IOException {
return execute(request, responseHandler, null);
}
@Override
public <T> T execute(final HttpUriRequest request,
final ResponseHandler<? extends T> responseHandler, final HttpContext context)
throws IOException {
@ -150,6 +158,7 @@ public class AutoRetryHttpClient implements HttpClient {
return responseHandler.handleResponse(resp);
}
@Override
public HttpResponse execute(final HttpHost target, final HttpRequest request,
final HttpContext context) throws IOException {
for (int c = 1;; c++) {
@ -179,10 +188,12 @@ public class AutoRetryHttpClient implements HttpClient {
}
}
@Override
public ClientConnectionManager getConnectionManager() {
return backend.getConnectionManager();
}
@Override
public HttpParams getParams() {
return backend.getParams();
}

10
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/ClientParamsStack.java

@ -27,7 +27,6 @@
package com.fr.third.org.apache.http.impl.client;
import com.fr.third.org.apache.http.annotation.NotThreadSafe;
import com.fr.third.org.apache.http.client.HttpClient;
import com.fr.third.org.apache.http.params.AbstractHttpParams;
import com.fr.third.org.apache.http.params.HttpParams;
@ -67,10 +66,9 @@ import com.fr.third.org.apache.http.util.Args;
*
* @since 4.0
*
* @deprecated (4.3) use configuration classes provided 'org.apache.http.config'
* and 'org.apache.http.client.config'
* @deprecated (4.3) use configuration classes provided 'com.fr.third.org.apache.http.config'
* and 'com.fr.third.org.apache.http.client.config'
*/
@NotThreadSafe
@Deprecated
public class ClientParamsStack extends AbstractHttpParams {
@ -190,6 +188,7 @@ public class ClientParamsStack extends AbstractHttpParams {
* @return the highest-priority value for that parameter, or
* {@code null} if it is not set anywhere in this stack
*/
@Override
public Object getParameter(final String name) {
Args.notNull(name, "Parameter name");
@ -223,6 +222,7 @@ public class ClientParamsStack extends AbstractHttpParams {
*
* @throws UnsupportedOperationException always
*/
@Override
public HttpParams setParameter(final String name, final Object value)
throws UnsupportedOperationException {
@ -243,6 +243,7 @@ public class ClientParamsStack extends AbstractHttpParams {
*
* @throws UnsupportedOperationException always
*/
@Override
public boolean removeParameter(final String name) {
throw new UnsupportedOperationException
("Removing parameters in a stack is not supported.");
@ -263,6 +264,7 @@ public class ClientParamsStack extends AbstractHttpParams {
*
* @return {@code this} parameter stack
*/
@Override
public HttpParams copy() {
return this;
}

10
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/CloseableHttpResponseProxy.java

@ -36,7 +36,6 @@ import java.lang.reflect.Proxy;
import com.fr.third.org.apache.http.HttpEntity;
import com.fr.third.org.apache.http.HttpResponse;
import com.fr.third.org.apache.http.annotation.NotThreadSafe;
import com.fr.third.org.apache.http.client.methods.CloseableHttpResponse;
import com.fr.third.org.apache.http.util.EntityUtils;
@ -44,7 +43,6 @@ import com.fr.third.org.apache.http.util.EntityUtils;
* @since 4.3
*/
@Deprecated
@NotThreadSafe
class CloseableHttpResponseProxy implements InvocationHandler {
private final static Constructor<?> CONSTRUCTOR;
@ -53,7 +51,7 @@ class CloseableHttpResponseProxy implements InvocationHandler {
try {
CONSTRUCTOR = Proxy.getProxyClass(CloseableHttpResponseProxy.class.getClassLoader(),
new Class<?>[] { CloseableHttpResponse.class }).getConstructor(new Class[] { InvocationHandler.class });
} catch (NoSuchMethodException ex) {
} catch (final NoSuchMethodException ex) {
throw new IllegalStateException(ex);
}
}
@ -94,11 +92,11 @@ class CloseableHttpResponseProxy implements InvocationHandler {
public static CloseableHttpResponse newProxy(final HttpResponse original) {
try {
return (CloseableHttpResponse) CONSTRUCTOR.newInstance(new CloseableHttpResponseProxy(original));
} catch (InstantiationException ex) {
} catch (final InstantiationException ex) {
throw new IllegalStateException(ex);
} catch (InvocationTargetException ex) {
} catch (final InvocationTargetException ex) {
throw new IllegalStateException(ex);
} catch (IllegalAccessException ex) {
} catch (final IllegalAccessException ex) {
throw new IllegalStateException(ex);
}
}

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/ContentEncodingHttpClient.java

@ -26,7 +26,8 @@
*/
package com.fr.third.org.apache.http.impl.client;
import com.fr.third.org.apache.http.annotation.ThreadSafe;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.client.HttpClient;
import com.fr.third.org.apache.http.client.protocol.RequestAcceptEncoding;
import com.fr.third.org.apache.http.client.protocol.ResponseContentEncoding;
@ -51,7 +52,7 @@ import com.fr.third.org.apache.http.protocol.BasicHttpProcessor;
* @deprecated (4.2) use {@link HttpClientBuilder}
*/
@Deprecated
@ThreadSafe // since DefaultHttpClient is
@Contract(threading = ThreadingBehavior.SAFE_CONDITIONAL) // since DefaultHttpClient is
public class ContentEncodingHttpClient extends DefaultHttpClient {
/**

10
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/DecompressingHttpClient.java

@ -107,14 +107,17 @@ public class DecompressingHttpClient implements HttpClient {
this.contentEncodingInterceptor = responseInterceptor;
}
@Override
public HttpParams getParams() {
return backend.getParams();
}
@Override
public ClientConnectionManager getConnectionManager() {
return backend.getConnectionManager();
}
@Override
public HttpResponse execute(final HttpUriRequest request) throws IOException,
ClientProtocolException {
return execute(getHttpHost(request), request, (HttpContext)null);
@ -134,16 +137,19 @@ public class DecompressingHttpClient implements HttpClient {
return URIUtils.extractHost(uri);
}
@Override
public HttpResponse execute(final HttpUriRequest request, final HttpContext context)
throws IOException, ClientProtocolException {
return execute(getHttpHost(request), request, context);
}
@Override
public HttpResponse execute(final HttpHost target, final HttpRequest request)
throws IOException, ClientProtocolException {
return execute(target, request, (HttpContext)null);
}
@Override
public HttpResponse execute(final HttpHost target, final HttpRequest request,
final HttpContext context) throws IOException, ClientProtocolException {
try {
@ -179,24 +185,28 @@ public class DecompressingHttpClient implements HttpClient {
}
}
@Override
public <T> T execute(final HttpUriRequest request,
final ResponseHandler<? extends T> responseHandler) throws IOException,
ClientProtocolException {
return execute(getHttpHost(request), request, responseHandler);
}
@Override
public <T> T execute(final HttpUriRequest request,
final ResponseHandler<? extends T> responseHandler, final HttpContext context)
throws IOException, ClientProtocolException {
return execute(getHttpHost(request), request, responseHandler, context);
}
@Override
public <T> T execute(final HttpHost target, final HttpRequest request,
final ResponseHandler<? extends T> responseHandler) throws IOException,
ClientProtocolException {
return execute(target, request, responseHandler, null);
}
@Override
public <T> T execute(final HttpHost target, final HttpRequest request,
final ResponseHandler<? extends T> responseHandler, final HttpContext context)
throws IOException, ClientProtocolException {

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/DefaultHttpClient.java

@ -35,7 +35,8 @@ import com.fr.third.org.apache.http.cookie.params.CookieSpecPNames;
import com.fr.third.org.apache.http.params.CoreConnectionPNames;
import com.fr.third.org.apache.http.params.CoreProtocolPNames;
import com.fr.third.org.apache.http.HttpVersion;
import com.fr.third.org.apache.http.annotation.ThreadSafe;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.client.protocol.RequestAddCookies;
import com.fr.third.org.apache.http.client.protocol.RequestAuthCache;
import com.fr.third.org.apache.http.client.protocol.RequestClientConnControl;
@ -119,7 +120,7 @@ import com.fr.third.org.apache.http.util.VersionInfo;
*
* @deprecated (4.3) use {@link HttpClientBuilder} see also {@link CloseableHttpClient}.
*/
@ThreadSafe
@Contract(threading = ThreadingBehavior.SAFE_CONDITIONAL)
@Deprecated
public class DefaultHttpClient extends AbstractHttpClient {

7
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/DefaultProxyAuthenticationHandler.java

@ -33,7 +33,8 @@ import java.util.Map;
import com.fr.third.org.apache.http.Header;
import com.fr.third.org.apache.http.HttpResponse;
import com.fr.third.org.apache.http.HttpStatus;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.auth.AUTH;
import com.fr.third.org.apache.http.auth.MalformedChallengeException;
import com.fr.third.org.apache.http.auth.params.AuthPNames;
@ -50,13 +51,14 @@ import com.fr.third.org.apache.http.util.Args;
* @deprecated (4.2) use {@link ProxyAuthenticationStrategy}
*/
@Deprecated
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
public class DefaultProxyAuthenticationHandler extends AbstractAuthenticationHandler {
public DefaultProxyAuthenticationHandler() {
super();
}
@Override
public boolean isAuthenticationRequested(
final HttpResponse response,
final HttpContext context) {
@ -65,6 +67,7 @@ public class DefaultProxyAuthenticationHandler extends AbstractAuthenticationHan
return status == HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED;
}
@Override
public Map<String, Header> getChallenges(
final HttpResponse response,
final HttpContext context) throws MalformedChallengeException {

7
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/DefaultRedirectHandler.java

@ -40,7 +40,8 @@ import com.fr.third.org.apache.http.HttpRequest;
import com.fr.third.org.apache.http.HttpResponse;
import com.fr.third.org.apache.http.HttpStatus;
import com.fr.third.org.apache.http.ProtocolException;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.client.CircularRedirectException;
import com.fr.third.org.apache.http.client.RedirectHandler;
import com.fr.third.org.apache.http.client.methods.HttpGet;
@ -60,7 +61,7 @@ import com.fr.third.org.apache.http.util.Asserts;
*
* @deprecated (4.1) use {@link DefaultRedirectStrategy}.
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
@Deprecated
public class DefaultRedirectHandler implements RedirectHandler {
@ -72,6 +73,7 @@ public class DefaultRedirectHandler implements RedirectHandler {
super();
}
@Override
public boolean isRedirectRequested(
final HttpResponse response,
final HttpContext context) {
@ -94,6 +96,7 @@ public class DefaultRedirectHandler implements RedirectHandler {
} //end of switch
}
@Override
public URI getLocationURI(
final HttpResponse response,
final HttpContext context) throws ProtocolException {

7
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/DefaultRedirectStrategyAdaptor.java

@ -32,7 +32,8 @@ import java.net.URI;
import com.fr.third.org.apache.http.HttpRequest;
import com.fr.third.org.apache.http.HttpResponse;
import com.fr.third.org.apache.http.ProtocolException;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.client.RedirectHandler;
import com.fr.third.org.apache.http.client.RedirectStrategy;
import com.fr.third.org.apache.http.client.methods.HttpGet;
@ -43,7 +44,7 @@ import com.fr.third.org.apache.http.protocol.HttpContext;
/**
* @deprecated (4.1) do not use
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
@Deprecated
class DefaultRedirectStrategyAdaptor implements RedirectStrategy {
@ -54,6 +55,7 @@ class DefaultRedirectStrategyAdaptor implements RedirectStrategy {
this.handler = handler;
}
@Override
public boolean isRedirected(
final HttpRequest request,
final HttpResponse response,
@ -61,6 +63,7 @@ class DefaultRedirectStrategyAdaptor implements RedirectStrategy {
return this.handler.isRedirectRequested(response, context);
}
@Override
public HttpUriRequest getRedirect(
final HttpRequest request,
final HttpResponse response,

3
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/DefaultRequestDirector.java

@ -50,7 +50,6 @@ import com.fr.third.org.apache.http.HttpResponse;
import com.fr.third.org.apache.http.NoHttpResponseException;
import com.fr.third.org.apache.http.ProtocolException;
import com.fr.third.org.apache.http.ProtocolVersion;
import com.fr.third.org.apache.http.annotation.NotThreadSafe;
import com.fr.third.org.apache.http.auth.AuthProtocolState;
import com.fr.third.org.apache.http.auth.AuthScheme;
import com.fr.third.org.apache.http.auth.AuthState;
@ -137,7 +136,6 @@ import com.fr.third.org.apache.http.util.EntityUtils;
* @deprecated (4.3)
*/
@Deprecated
@NotThreadSafe // e.g. managedConn
public class DefaultRequestDirector implements RequestDirector {
private final Log log;
@ -371,6 +369,7 @@ public class DefaultRequestDirector implements RequestDirector {
// non-javadoc, see interface ClientRequestDirector
@Override
public HttpResponse execute(final HttpHost targetHost, final HttpRequest request,
final HttpContext context)
throws HttpException, IOException {

7
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/DefaultTargetAuthenticationHandler.java

@ -33,7 +33,8 @@ import java.util.Map;
import com.fr.third.org.apache.http.Header;
import com.fr.third.org.apache.http.HttpResponse;
import com.fr.third.org.apache.http.HttpStatus;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.auth.AUTH;
import com.fr.third.org.apache.http.auth.MalformedChallengeException;
import com.fr.third.org.apache.http.auth.params.AuthPNames;
@ -50,13 +51,14 @@ import com.fr.third.org.apache.http.util.Args;
* @deprecated (4.2) use {@link TargetAuthenticationStrategy}
*/
@Deprecated
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
public class DefaultTargetAuthenticationHandler extends AbstractAuthenticationHandler {
public DefaultTargetAuthenticationHandler() {
super();
}
@Override
public boolean isAuthenticationRequested(
final HttpResponse response,
final HttpContext context) {
@ -65,6 +67,7 @@ public class DefaultTargetAuthenticationHandler extends AbstractAuthenticationHa
return status == HttpStatus.SC_UNAUTHORIZED;
}
@Override
public Map<String, Header> getChallenges(
final HttpResponse response,
final HttpContext context) throws MalformedChallengeException {

4
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/RoutedRequest.java

@ -27,7 +27,6 @@
package com.fr.third.org.apache.http.impl.client;
import com.fr.third.org.apache.http.annotation.NotThreadSafe;
import com.fr.third.org.apache.http.conn.routing.HttpRoute;
import com.fr.third.org.apache.http.impl.client.RequestWrapper;
@ -39,11 +38,10 @@ import com.fr.third.org.apache.http.impl.client.RequestWrapper;
* @deprecated (4.3) do not use.
*/
@Deprecated
@NotThreadSafe // RequestWrapper is @NotThreadSafe
public class RoutedRequest {
protected final RequestWrapper request; // @NotThreadSafe
protected final HttpRoute route; // @Immutable
protected final HttpRoute route; // @Contract(threading = ThreadingBehavior.IMMUTABLE)
/**
* Creates a new routed request.

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/SystemDefaultHttpClient.java

@ -36,7 +36,8 @@ import com.fr.third.org.apache.http.cookie.params.CookieSpecPNames;
import com.fr.third.org.apache.http.params.CoreConnectionPNames;
import com.fr.third.org.apache.http.params.CoreProtocolPNames;
import com.fr.third.org.apache.http.ConnectionReuseStrategy;
import com.fr.third.org.apache.http.annotation.ThreadSafe;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.conn.ClientConnectionManager;
import com.fr.third.org.apache.http.conn.routing.HttpRoutePlanner;
import com.fr.third.org.apache.http.impl.DefaultConnectionReuseStrategy;
@ -110,7 +111,7 @@ import com.fr.third.org.apache.http.params.HttpParams;
*
* @deprecated (4.3) use {@link HttpClientBuilder}
*/
@ThreadSafe
@Contract(threading = ThreadingBehavior.SAFE_CONDITIONAL)
@Deprecated
public class SystemDefaultHttpClient extends DefaultHttpClient {

2
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/client/TunnelRefusedException.java

@ -29,7 +29,6 @@ package com.fr.third.org.apache.http.impl.client;
import com.fr.third.org.apache.http.HttpException;
import com.fr.third.org.apache.http.HttpResponse;
import com.fr.third.org.apache.http.annotation.Immutable;
/**
* Signals that the tunnel request was rejected by the proxy host.
@ -39,7 +38,6 @@ import com.fr.third.org.apache.http.annotation.Immutable;
* @deprecated (4.3) reserved for internal use.
*/
@Deprecated
@Immutable
public class TunnelRefusedException extends HttpException {
private static final long serialVersionUID = -8646722842745617323L;

30
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/AbstractClientConnAdapter.java

@ -40,7 +40,6 @@ import com.fr.third.org.apache.http.HttpEntityEnclosingRequest;
import com.fr.third.org.apache.http.HttpException;
import com.fr.third.org.apache.http.HttpRequest;
import com.fr.third.org.apache.http.HttpResponse;
import com.fr.third.org.apache.http.annotation.NotThreadSafe;
import com.fr.third.org.apache.http.conn.ClientConnectionManager;
import com.fr.third.org.apache.http.conn.ManagedClientConnection;
import com.fr.third.org.apache.http.impl.conn.ConnectionShutdownException;
@ -71,7 +70,6 @@ import com.fr.third.org.apache.http.protocol.HttpContext;
* @deprecated (4.2) do not use
*/
@Deprecated
@NotThreadSafe
public abstract class AbstractClientConnAdapter implements ManagedClientConnection, HttpContext {
/**
@ -157,6 +155,7 @@ public abstract class AbstractClientConnAdapter implements ManagedClientConnecti
}
}
@Override
public boolean isOpen() {
final OperatedClientConnection conn = getWrappedConnection();
if (conn == null) {
@ -166,6 +165,7 @@ public abstract class AbstractClientConnAdapter implements ManagedClientConnecti
return conn.isOpen();
}
@Override
public boolean isStale() {
if (isReleased()) {
return true;
@ -178,36 +178,42 @@ public abstract class AbstractClientConnAdapter implements ManagedClientConnecti
return conn.isStale();
}
@Override
public void setSocketTimeout(final int timeout) {
final OperatedClientConnection conn = getWrappedConnection();
assertValid(conn);
conn.setSocketTimeout(timeout);
}
@Override
public int getSocketTimeout() {
final OperatedClientConnection conn = getWrappedConnection();
assertValid(conn);
return conn.getSocketTimeout();
}
@Override
public HttpConnectionMetrics getMetrics() {
final OperatedClientConnection conn = getWrappedConnection();
assertValid(conn);
return conn.getMetrics();
}
@Override
public void flush() throws IOException {
final OperatedClientConnection conn = getWrappedConnection();
assertValid(conn);
conn.flush();
}
@Override
public boolean isResponseAvailable(final int timeout) throws IOException {
final OperatedClientConnection conn = getWrappedConnection();
assertValid(conn);
return conn.isResponseAvailable(timeout);
}
@Override
public void receiveResponseEntity(final HttpResponse response)
throws HttpException, IOException {
final OperatedClientConnection conn = getWrappedConnection();
@ -216,6 +222,7 @@ public abstract class AbstractClientConnAdapter implements ManagedClientConnecti
conn.receiveResponseEntity(response);
}
@Override
public HttpResponse receiveResponseHeader()
throws HttpException, IOException {
final OperatedClientConnection conn = getWrappedConnection();
@ -224,6 +231,7 @@ public abstract class AbstractClientConnAdapter implements ManagedClientConnecti
return conn.receiveResponseHeader();
}
@Override
public void sendRequestEntity(final HttpEntityEnclosingRequest request)
throws HttpException, IOException {
final OperatedClientConnection conn = getWrappedConnection();
@ -232,6 +240,7 @@ public abstract class AbstractClientConnAdapter implements ManagedClientConnecti
conn.sendRequestEntity(request);
}
@Override
public void sendRequestHeader(final HttpRequest request)
throws HttpException, IOException {
final OperatedClientConnection conn = getWrappedConnection();
@ -240,40 +249,47 @@ public abstract class AbstractClientConnAdapter implements ManagedClientConnecti
conn.sendRequestHeader(request);
}
@Override
public InetAddress getLocalAddress() {
final OperatedClientConnection conn = getWrappedConnection();
assertValid(conn);
return conn.getLocalAddress();
}
@Override
public int getLocalPort() {
final OperatedClientConnection conn = getWrappedConnection();
assertValid(conn);
return conn.getLocalPort();
}
@Override
public InetAddress getRemoteAddress() {
final OperatedClientConnection conn = getWrappedConnection();
assertValid(conn);
return conn.getRemoteAddress();
}
@Override
public int getRemotePort() {
final OperatedClientConnection conn = getWrappedConnection();
assertValid(conn);
return conn.getRemotePort();
}
@Override
public boolean isSecure() {
final OperatedClientConnection conn = getWrappedConnection();
assertValid(conn);
return conn.isSecure();
}
@Override
public void bind(final Socket socket) throws IOException {
throw new UnsupportedOperationException();
}
@Override
public Socket getSocket() {
final OperatedClientConnection conn = getWrappedConnection();
assertValid(conn);
@ -283,6 +299,7 @@ public abstract class AbstractClientConnAdapter implements ManagedClientConnecti
return conn.getSocket();
}
@Override
public SSLSession getSSLSession() {
final OperatedClientConnection conn = getWrappedConnection();
assertValid(conn);
@ -298,18 +315,22 @@ public abstract class AbstractClientConnAdapter implements ManagedClientConnecti
return result;
}
@Override
public void markReusable() {
markedReusable = true;
}
@Override
public void unmarkReusable() {
markedReusable = false;
}
@Override
public boolean isMarkedReusable() {
return markedReusable;
}
@Override
public void setIdleDuration(final long duration, final TimeUnit unit) {
if(duration > 0) {
this.duration = unit.toMillis(duration);
@ -318,6 +339,7 @@ public abstract class AbstractClientConnAdapter implements ManagedClientConnecti
}
}
@Override
public synchronized void releaseConnection() {
if (released) {
return;
@ -326,6 +348,7 @@ public abstract class AbstractClientConnAdapter implements ManagedClientConnecti
connManager.releaseConnection(this, duration, TimeUnit.MILLISECONDS);
}
@Override
public synchronized void abortConnection() {
if (released) {
return;
@ -339,6 +362,7 @@ public abstract class AbstractClientConnAdapter implements ManagedClientConnecti
connManager.releaseConnection(this, duration, TimeUnit.MILLISECONDS);
}
@Override
public Object getAttribute(final String id) {
final OperatedClientConnection conn = getWrappedConnection();
assertValid(conn);
@ -349,6 +373,7 @@ public abstract class AbstractClientConnAdapter implements ManagedClientConnecti
}
}
@Override
public Object removeAttribute(final String id) {
final OperatedClientConnection conn = getWrappedConnection();
assertValid(conn);
@ -359,6 +384,7 @@ public abstract class AbstractClientConnAdapter implements ManagedClientConnecti
}
}
@Override
public void setAttribute(final String id, final Object obj) {
final OperatedClientConnection conn = getWrappedConnection();
assertValid(conn);

12
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/AbstractPooledConnAdapter.java

@ -29,8 +29,8 @@ package com.fr.third.org.apache.http.impl.conn;
import java.io.IOException;
import com.fr.third.org.apache.http.HttpHost;
import com.fr.third.org.apache.http.conn.ManagedClientConnection;
import com.fr.third.org.apache.http.conn.ClientConnectionManager;
import com.fr.third.org.apache.http.conn.ManagedClientConnection;
import com.fr.third.org.apache.http.conn.OperatedClientConnection;
import com.fr.third.org.apache.http.conn.routing.HttpRoute;
import com.fr.third.org.apache.http.params.HttpParams;
@ -68,6 +68,7 @@ public abstract class AbstractPooledConnAdapter extends AbstractClientConnAdapte
this.poolEntry = entry;
}
@Override
public String getId() {
return null;
}
@ -118,12 +119,14 @@ public abstract class AbstractPooledConnAdapter extends AbstractClientConnAdapte
super.detach();
}
@Override
public HttpRoute getRoute() {
final AbstractPoolEntry entry = getPoolEntry();
assertValid(entry);
return (entry.tracker == null) ? null : entry.tracker.toRoute();
}
@Override
public void open(final HttpRoute route,
final HttpContext context, final HttpParams params)
throws IOException {
@ -132,6 +135,7 @@ public abstract class AbstractPooledConnAdapter extends AbstractClientConnAdapte
entry.open(route, context, params);
}
@Override
public void tunnelTarget(final boolean secure, final HttpParams params)
throws IOException {
final AbstractPoolEntry entry = getPoolEntry();
@ -139,6 +143,7 @@ public abstract class AbstractPooledConnAdapter extends AbstractClientConnAdapte
entry.tunnelTarget(secure, params);
}
@Override
public void tunnelProxy(final HttpHost next, final boolean secure, final HttpParams params)
throws IOException {
final AbstractPoolEntry entry = getPoolEntry();
@ -146,6 +151,7 @@ public abstract class AbstractPooledConnAdapter extends AbstractClientConnAdapte
entry.tunnelProxy(next, secure, params);
}
@Override
public void layerProtocol(final HttpContext context, final HttpParams params)
throws IOException {
final AbstractPoolEntry entry = getPoolEntry();
@ -153,6 +159,7 @@ public abstract class AbstractPooledConnAdapter extends AbstractClientConnAdapte
entry.layerProtocol(context, params);
}
@Override
public void close() throws IOException {
final AbstractPoolEntry entry = getPoolEntry();
if (entry != null) {
@ -165,6 +172,7 @@ public abstract class AbstractPooledConnAdapter extends AbstractClientConnAdapte
}
}
@Override
public void shutdown() throws IOException {
final AbstractPoolEntry entry = getPoolEntry();
if (entry != null) {
@ -177,12 +185,14 @@ public abstract class AbstractPooledConnAdapter extends AbstractClientConnAdapte
}
}
@Override
public Object getState() {
final AbstractPoolEntry entry = getPoolEntry();
assertValid(entry);
return entry.getState();
}
@Override
public void setState(final Object state) {
final AbstractPoolEntry entry = getPoolEntry();
assertValid(entry);

17
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/BasicClientConnectionManager.java

@ -34,8 +34,8 @@ import java.util.concurrent.atomic.AtomicLong;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.fr.third.org.apache.http.HttpClientConnection;
import com.fr.third.org.apache.http.annotation.GuardedBy;
import com.fr.third.org.apache.http.annotation.ThreadSafe;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.conn.ClientConnectionManager;
import com.fr.third.org.apache.http.conn.ClientConnectionOperator;
import com.fr.third.org.apache.http.conn.ClientConnectionRequest;
@ -66,7 +66,7 @@ import com.fr.third.org.apache.http.util.Asserts;
*
* @deprecated (4.3) use {@link BasicHttpClientConnectionManager}.
*/
@ThreadSafe
@Contract(threading = ThreadingBehavior.SAFE)
@Deprecated
public class BasicClientConnectionManager implements ClientConnectionManager {
@ -86,15 +86,12 @@ public class BasicClientConnectionManager implements ClientConnectionManager {
private final ClientConnectionOperator connOperator;
/** The one and only entry in this pool. */
@GuardedBy("this")
private HttpPoolEntry poolEntry;
/** The currently issued managed connection, if any. */
@GuardedBy("this")
private ManagedClientConnectionImpl conn;
/** Indicates whether this connection manager is shut down. */
@GuardedBy("this")
private volatile boolean shutdown;
/**
@ -121,6 +118,7 @@ public class BasicClientConnectionManager implements ClientConnectionManager {
}
}
@Override
public SchemeRegistry getSchemeRegistry() {
return this.schemeRegistry;
}
@ -129,16 +127,19 @@ public class BasicClientConnectionManager implements ClientConnectionManager {
return new DefaultClientConnectionOperator(schreg);
}
@Override
public final ClientConnectionRequest requestConnection(
final HttpRoute route,
final Object state) {
return new ClientConnectionRequest() {
@Override
public void abortRequest() {
// Nothing to abort, since requests are immediate.
}
@Override
public ManagedClientConnection getConnection(
final long timeout, final TimeUnit tunit) {
return BasicClientConnectionManager.this.getConnection(
@ -189,6 +190,7 @@ public class BasicClientConnectionManager implements ClientConnectionManager {
}
}
@Override
public void releaseConnection(final ManagedClientConnection conn, final long keepalive, final TimeUnit tunit) {
Args.check(conn instanceof ManagedClientConnectionImpl, "Connection class mismatch, " +
"connection not obtained from this manager");
@ -234,6 +236,7 @@ public class BasicClientConnectionManager implements ClientConnectionManager {
}
}
@Override
public void closeExpiredConnections() {
synchronized (this) {
assertNotShutdown();
@ -245,6 +248,7 @@ public class BasicClientConnectionManager implements ClientConnectionManager {
}
}
@Override
public void closeIdleConnections(final long idletime, final TimeUnit tunit) {
Args.notNull(tunit, "Time unit");
synchronized (this) {
@ -261,6 +265,7 @@ public class BasicClientConnectionManager implements ClientConnectionManager {
}
}
@Override
public void shutdown() {
synchronized (this) {
this.shutdown = true;

15
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/DefaultClientConnection.java

@ -44,9 +44,8 @@ import com.fr.third.org.apache.http.HttpHost;
import com.fr.third.org.apache.http.HttpRequest;
import com.fr.third.org.apache.http.HttpResponse;
import com.fr.third.org.apache.http.HttpResponseFactory;
import com.fr.third.org.apache.http.annotation.NotThreadSafe;
import com.fr.third.org.apache.http.conn.OperatedClientConnection;
import com.fr.third.org.apache.http.conn.ManagedHttpClientConnection;
import com.fr.third.org.apache.http.conn.OperatedClientConnection;
import com.fr.third.org.apache.http.impl.SocketHttpClientConnection;
import com.fr.third.org.apache.http.io.HttpMessageParser;
import com.fr.third.org.apache.http.io.SessionInputBuffer;
@ -64,7 +63,6 @@ import com.fr.third.org.apache.http.util.Args;
*
* @deprecated (4.3) use {@link ManagedHttpClientConnectionFactory}.
*/
@NotThreadSafe // connSecure, targetHost
@Deprecated
public class DefaultClientConnection extends SocketHttpClientConnection
implements OperatedClientConnection, ManagedHttpClientConnection, HttpContext {
@ -93,14 +91,17 @@ public class DefaultClientConnection extends SocketHttpClientConnection
this.attributes = new HashMap<String, Object>();
}
@Override
public String getId() {
return null;
}
@Override
public final HttpHost getTargetHost() {
return this.targetHost;
}
@Override
public final boolean isSecure() {
return this.connSecure;
}
@ -110,6 +111,7 @@ public class DefaultClientConnection extends SocketHttpClientConnection
return this.socket;
}
@Override
public SSLSession getSSLSession() {
if (this.socket instanceof SSLSocket) {
return ((SSLSocket) this.socket).getSession();
@ -118,6 +120,7 @@ public class DefaultClientConnection extends SocketHttpClientConnection
}
}
@Override
public void opening(final Socket sock, final HttpHost target) throws IOException {
assertNotOpen();
this.socket = sock;
@ -131,6 +134,7 @@ public class DefaultClientConnection extends SocketHttpClientConnection
}
}
@Override
public void openCompleted(final boolean secure, final HttpParams params) throws IOException {
Args.notNull(params, "Parameters");
assertNotOpen();
@ -226,10 +230,12 @@ public class DefaultClientConnection extends SocketHttpClientConnection
(buffer, null, responseFactory, params);
}
@Override
public void bind(final Socket socket) throws IOException {
bind(socket, new BasicHttpParams());
}
@Override
public void update(final Socket sock, final HttpHost target,
final boolean secure, final HttpParams params)
throws IOException {
@ -277,14 +283,17 @@ public class DefaultClientConnection extends SocketHttpClientConnection
}
}
@Override
public Object getAttribute(final String id) {
return this.attributes.get(id);
}
@Override
public Object removeAttribute(final String id) {
return this.attributes.remove(id);
}
@Override
public void setAttribute(final String id, final Object obj) {
this.attributes.put(id, obj);
}

10
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/DefaultClientConnectionOperator.java

@ -39,7 +39,8 @@ import com.fr.third.org.apache.http.params.CoreProtocolPNames;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.fr.third.org.apache.http.HttpHost;
import com.fr.third.org.apache.http.annotation.ThreadSafe;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.client.protocol.ClientContext;
import com.fr.third.org.apache.http.conn.ClientConnectionOperator;
import com.fr.third.org.apache.http.conn.ConnectTimeoutException;
@ -88,13 +89,13 @@ import com.fr.third.org.apache.http.util.Asserts;
* @deprecated (4.3) use {@link PoolingHttpClientConnectionManager}.
*/
@Deprecated
@ThreadSafe
@Contract(threading = ThreadingBehavior.SAFE_CONDITIONAL)
public class DefaultClientConnectionOperator implements ClientConnectionOperator {
private final Log log = LogFactory.getLog(getClass());
/** The scheme registry for looking up socket factories. */
protected final SchemeRegistry schemeRegistry; // @ThreadSafe
protected final SchemeRegistry schemeRegistry; // @Contract(threading = ThreadingBehavior.SAFE)
/** the custom-configured DNS lookup mechanism. */
protected final DnsResolver dnsResolver;
@ -130,6 +131,7 @@ public class DefaultClientConnectionOperator implements ClientConnectionOperator
this.dnsResolver = dnsResolver;
}
@Override
public OperatedClientConnection createConnection() {
return new DefaultClientConnection();
}
@ -143,6 +145,7 @@ public class DefaultClientConnectionOperator implements ClientConnectionOperator
return reg;
}
@Override
public void openConnection(
final OperatedClientConnection conn,
final HttpHost target,
@ -200,6 +203,7 @@ public class DefaultClientConnectionOperator implements ClientConnectionOperator
}
}
@Override
public void updateSecureConnection(
final OperatedClientConnection conn,
final HttpHost target,

8
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/DefaultHttpRoutePlanner.java

@ -33,7 +33,8 @@ import java.net.InetAddress;
import com.fr.third.org.apache.http.HttpException;
import com.fr.third.org.apache.http.HttpHost;
import com.fr.third.org.apache.http.HttpRequest;
import com.fr.third.org.apache.http.annotation.ThreadSafe;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.conn.params.ConnRoutePNames;
import com.fr.third.org.apache.http.impl.conn.DefaultRoutePlanner;
import com.fr.third.org.apache.http.conn.params.ConnRouteParams;
@ -63,12 +64,12 @@ import com.fr.third.org.apache.http.util.Asserts;
*
* @deprecated (4.3) use {@link DefaultRoutePlanner}
*/
@ThreadSafe
@Contract(threading = ThreadingBehavior.SAFE)
@Deprecated
public class DefaultHttpRoutePlanner implements HttpRoutePlanner {
/** The scheme registry. */
protected final SchemeRegistry schemeRegistry; // class is @ThreadSafe
protected final SchemeRegistry schemeRegistry; // class is @Contract(threading = ThreadingBehavior.SAFE)
/**
* Creates a new default route planner.
@ -80,6 +81,7 @@ public class DefaultHttpRoutePlanner implements HttpRoutePlanner {
schemeRegistry = schreg;
}
@Override
public HttpRoute determineRoute(final HttpHost target,
final HttpRequest request,
final HttpContext context)

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/DefaultResponseParser.java

@ -40,7 +40,8 @@ import com.fr.third.org.apache.http.HttpResponseFactory;
import com.fr.third.org.apache.http.NoHttpResponseException;
import com.fr.third.org.apache.http.ProtocolException;
import com.fr.third.org.apache.http.StatusLine;
import com.fr.third.org.apache.http.annotation.ThreadSafe;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.impl.io.AbstractMessageParser;
import com.fr.third.org.apache.http.io.SessionInputBuffer;
import com.fr.third.org.apache.http.message.LineParser;
@ -65,7 +66,7 @@ import com.fr.third.org.apache.http.util.CharArrayBuffer;
* @deprecated (4.2) use {@link DefaultHttpResponseParser}
*/
@Deprecated
@ThreadSafe // no public methods
@Contract(threading = ThreadingBehavior.SAFE_CONDITIONAL)
public class DefaultResponseParser extends AbstractMessageParser<HttpMessage> {
private final Log log = LogFactory.getLog(getClass());

1
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/HttpConnPool.java

@ -75,6 +75,7 @@ class HttpConnPool extends AbstractConnPool<HttpRoute, OperatedClientConnection,
this.connOperator = connOperator;
}
@Override
public OperatedClientConnection create(final HttpRoute route) throws IOException {
return connOperator.createConnection();
}

13
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/LoggingSessionInputBuffer.java

@ -29,7 +29,8 @@ package com.fr.third.org.apache.http.impl.conn;
import java.io.IOException;
import com.fr.third.org.apache.http.Consts;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.impl.conn.Wire;
import com.fr.third.org.apache.http.io.EofSensor;
import com.fr.third.org.apache.http.io.HttpTransportMetrics;
@ -43,7 +44,7 @@ import com.fr.third.org.apache.http.util.CharArrayBuffer;
*
* @deprecated (4.3) no longer used.
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
@Deprecated
public class LoggingSessionInputBuffer implements SessionInputBuffer, EofSensor {
@ -76,10 +77,12 @@ public class LoggingSessionInputBuffer implements SessionInputBuffer, EofSensor
this(in, wire, null);
}
@Override
public boolean isDataAvailable(final int timeout) throws IOException {
return this.in.isDataAvailable(timeout);
}
@Override
public int read(final byte[] b, final int off, final int len) throws IOException {
final int l = this.in.read(b, off, len);
if (this.wire.enabled() && l > 0) {
@ -88,6 +91,7 @@ public class LoggingSessionInputBuffer implements SessionInputBuffer, EofSensor
return l;
}
@Override
public int read() throws IOException {
final int l = this.in.read();
if (this.wire.enabled() && l != -1) {
@ -96,6 +100,7 @@ public class LoggingSessionInputBuffer implements SessionInputBuffer, EofSensor
return l;
}
@Override
public int read(final byte[] b) throws IOException {
final int l = this.in.read(b);
if (this.wire.enabled() && l > 0) {
@ -104,6 +109,7 @@ public class LoggingSessionInputBuffer implements SessionInputBuffer, EofSensor
return l;
}
@Override
public String readLine() throws IOException {
final String s = this.in.readLine();
if (this.wire.enabled() && s != null) {
@ -113,6 +119,7 @@ public class LoggingSessionInputBuffer implements SessionInputBuffer, EofSensor
return s;
}
@Override
public int readLine(final CharArrayBuffer buffer) throws IOException {
final int l = this.in.readLine(buffer);
if (this.wire.enabled() && l >= 0) {
@ -124,10 +131,12 @@ public class LoggingSessionInputBuffer implements SessionInputBuffer, EofSensor
return l;
}
@Override
public HttpTransportMetrics getMetrics() {
return this.in.getMetrics();
}
@Override
public boolean isEof() {
if (this.eofSensor != null) {
return this.eofSensor.isEof();

12
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/LoggingSessionOutputBuffer.java

@ -29,7 +29,8 @@ package com.fr.third.org.apache.http.impl.conn;
import java.io.IOException;
import com.fr.third.org.apache.http.Consts;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.impl.conn.Wire;
import com.fr.third.org.apache.http.io.HttpTransportMetrics;
import com.fr.third.org.apache.http.io.SessionOutputBuffer;
@ -40,7 +41,7 @@ import com.fr.third.org.apache.http.util.CharArrayBuffer;
* @since 4.0
* @deprecated (4.3) no longer used.
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
@Deprecated
public class LoggingSessionOutputBuffer implements SessionOutputBuffer {
@ -70,6 +71,7 @@ public class LoggingSessionOutputBuffer implements SessionOutputBuffer {
this(out, wire, null);
}
@Override
public void write(final byte[] b, final int off, final int len) throws IOException {
this.out.write(b, off, len);
if (this.wire.enabled()) {
@ -77,6 +79,7 @@ public class LoggingSessionOutputBuffer implements SessionOutputBuffer {
}
}
@Override
public void write(final int b) throws IOException {
this.out.write(b);
if (this.wire.enabled()) {
@ -84,6 +87,7 @@ public class LoggingSessionOutputBuffer implements SessionOutputBuffer {
}
}
@Override
public void write(final byte[] b) throws IOException {
this.out.write(b);
if (this.wire.enabled()) {
@ -91,10 +95,12 @@ public class LoggingSessionOutputBuffer implements SessionOutputBuffer {
}
}
@Override
public void flush() throws IOException {
this.out.flush();
}
@Override
public void writeLine(final CharArrayBuffer buffer) throws IOException {
this.out.writeLine(buffer);
if (this.wire.enabled()) {
@ -104,6 +110,7 @@ public class LoggingSessionOutputBuffer implements SessionOutputBuffer {
}
}
@Override
public void writeLine(final String s) throws IOException {
this.out.writeLine(s);
if (this.wire.enabled()) {
@ -112,6 +119,7 @@ public class LoggingSessionOutputBuffer implements SessionOutputBuffer {
}
}
@Override
public HttpTransportMetrics getMetrics() {
return this.out.getMetrics();
}

37
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/ManagedClientConnectionImpl.java

@ -41,7 +41,6 @@ import com.fr.third.org.apache.http.HttpException;
import com.fr.third.org.apache.http.HttpHost;
import com.fr.third.org.apache.http.HttpRequest;
import com.fr.third.org.apache.http.HttpResponse;
import com.fr.third.org.apache.http.annotation.NotThreadSafe;
import com.fr.third.org.apache.http.conn.ClientConnectionManager;
import com.fr.third.org.apache.http.conn.ClientConnectionOperator;
import com.fr.third.org.apache.http.conn.ManagedClientConnection;
@ -59,7 +58,6 @@ import com.fr.third.org.apache.http.util.Asserts;
* @deprecated (4.3) use {@link ManagedHttpClientConnectionFactory}.
*/
@Deprecated
@NotThreadSafe
class ManagedClientConnectionImpl implements ManagedClientConnection {
private final ClientConnectionManager manager;
@ -83,6 +81,7 @@ class ManagedClientConnectionImpl implements ManagedClientConnection {
this.duration = Long.MAX_VALUE;
}
@Override
public String getId() {
return null;
}
@ -125,6 +124,7 @@ class ManagedClientConnectionImpl implements ManagedClientConnection {
return local;
}
@Override
public void close() throws IOException {
final HttpPoolEntry local = this.poolEntry;
if (local != null) {
@ -134,6 +134,7 @@ class ManagedClientConnectionImpl implements ManagedClientConnection {
}
}
@Override
public void shutdown() throws IOException {
final HttpPoolEntry local = this.poolEntry;
if (local != null) {
@ -143,6 +144,7 @@ class ManagedClientConnectionImpl implements ManagedClientConnection {
}
}
@Override
public boolean isOpen() {
final OperatedClientConnection conn = getConnection();
if (conn != null) {
@ -152,6 +154,7 @@ class ManagedClientConnectionImpl implements ManagedClientConnection {
}
}
@Override
public boolean isStale() {
final OperatedClientConnection conn = getConnection();
if (conn != null) {
@ -161,88 +164,105 @@ class ManagedClientConnectionImpl implements ManagedClientConnection {
}
}
@Override
public void setSocketTimeout(final int timeout) {
final OperatedClientConnection conn = ensureConnection();
conn.setSocketTimeout(timeout);
}
@Override
public int getSocketTimeout() {
final OperatedClientConnection conn = ensureConnection();
return conn.getSocketTimeout();
}
@Override
public HttpConnectionMetrics getMetrics() {
final OperatedClientConnection conn = ensureConnection();
return conn.getMetrics();
}
@Override
public void flush() throws IOException {
final OperatedClientConnection conn = ensureConnection();
conn.flush();
}
@Override
public boolean isResponseAvailable(final int timeout) throws IOException {
final OperatedClientConnection conn = ensureConnection();
return conn.isResponseAvailable(timeout);
}
@Override
public void receiveResponseEntity(
final HttpResponse response) throws HttpException, IOException {
final OperatedClientConnection conn = ensureConnection();
conn.receiveResponseEntity(response);
}
@Override
public HttpResponse receiveResponseHeader() throws HttpException, IOException {
final OperatedClientConnection conn = ensureConnection();
return conn.receiveResponseHeader();
}
@Override
public void sendRequestEntity(
final HttpEntityEnclosingRequest request) throws HttpException, IOException {
final OperatedClientConnection conn = ensureConnection();
conn.sendRequestEntity(request);
}
@Override
public void sendRequestHeader(
final HttpRequest request) throws HttpException, IOException {
final OperatedClientConnection conn = ensureConnection();
conn.sendRequestHeader(request);
}
@Override
public InetAddress getLocalAddress() {
final OperatedClientConnection conn = ensureConnection();
return conn.getLocalAddress();
}
@Override
public int getLocalPort() {
final OperatedClientConnection conn = ensureConnection();
return conn.getLocalPort();
}
@Override
public InetAddress getRemoteAddress() {
final OperatedClientConnection conn = ensureConnection();
return conn.getRemoteAddress();
}
@Override
public int getRemotePort() {
final OperatedClientConnection conn = ensureConnection();
return conn.getRemotePort();
}
@Override
public boolean isSecure() {
final OperatedClientConnection conn = ensureConnection();
return conn.isSecure();
}
@Override
public void bind(final Socket socket) throws IOException {
throw new UnsupportedOperationException();
}
@Override
public Socket getSocket() {
final OperatedClientConnection conn = ensureConnection();
return conn.getSocket();
}
@Override
public SSLSession getSSLSession() {
final OperatedClientConnection conn = ensureConnection();
SSLSession result = null;
@ -278,11 +298,13 @@ class ManagedClientConnectionImpl implements ManagedClientConnection {
}
}
@Override
public HttpRoute getRoute() {
final HttpPoolEntry local = ensurePoolEntry();
return local.getEffectiveRoute();
}
@Override
public void open(
final HttpRoute route,
final HttpContext context,
@ -320,6 +342,7 @@ class ManagedClientConnectionImpl implements ManagedClientConnection {
}
}
@Override
public void tunnelTarget(
final boolean secure, final HttpParams params) throws IOException {
Args.notNull(params, "HTTP parameters");
@ -348,6 +371,7 @@ class ManagedClientConnectionImpl implements ManagedClientConnection {
}
}
@Override
public void tunnelProxy(
final HttpHost next, final boolean secure, final HttpParams params) throws IOException {
Args.notNull(next, "Next proxy");
@ -374,6 +398,7 @@ class ManagedClientConnectionImpl implements ManagedClientConnection {
}
}
@Override
public void layerProtocol(
final HttpContext context, final HttpParams params) throws IOException {
Args.notNull(params, "HTTP parameters");
@ -402,28 +427,34 @@ class ManagedClientConnectionImpl implements ManagedClientConnection {
}
}
@Override
public Object getState() {
final HttpPoolEntry local = ensurePoolEntry();
return local.getState();
}
@Override
public void setState(final Object state) {
final HttpPoolEntry local = ensurePoolEntry();
local.setState(state);
}
@Override
public void markReusable() {
this.reusable = true;
}
@Override
public void unmarkReusable() {
this.reusable = false;
}
@Override
public boolean isMarkedReusable() {
return this.reusable;
}
@Override
public void setIdleDuration(final long duration, final TimeUnit unit) {
if(duration > 0) {
this.duration = unit.toMillis(duration);
@ -432,6 +463,7 @@ class ManagedClientConnectionImpl implements ManagedClientConnection {
}
}
@Override
public void releaseConnection() {
synchronized (this) {
if (this.poolEntry == null) {
@ -442,6 +474,7 @@ class ManagedClientConnectionImpl implements ManagedClientConnection {
}
}
@Override
public void abortConnection() {
synchronized (this) {
if (this.poolEntry == null) {

21
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/PoolingClientConnectionManager.java

@ -35,7 +35,8 @@ import java.util.concurrent.TimeoutException;
import com.fr.third.org.apache.http.conn.OperatedClientConnection;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.fr.third.org.apache.http.annotation.ThreadSafe;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.conn.ClientConnectionManager;
import com.fr.third.org.apache.http.conn.ClientConnectionOperator;
import com.fr.third.org.apache.http.conn.ClientConnectionRequest;
@ -70,7 +71,7 @@ import com.fr.third.org.apache.http.util.Asserts;
* @deprecated (4.3) use {@link PoolingHttpClientConnectionManager}.
*/
@Deprecated
@ThreadSafe
@Contract(threading = ThreadingBehavior.SAFE_CONDITIONAL)
public class PoolingClientConnectionManager implements ClientConnectionManager, ConnPoolControl<HttpRoute> {
private final Log log = LogFactory.getLog(getClass());
@ -139,6 +140,7 @@ public class PoolingClientConnectionManager implements ClientConnectionManager,
return new DefaultClientConnectionOperator(schreg, this.dnsResolver);
}
@Override
public SchemeRegistry getSchemeRegistry() {
return this.schemeRegistry;
}
@ -175,6 +177,7 @@ public class PoolingClientConnectionManager implements ClientConnectionManager,
return buf.toString();
}
@Override
public ClientConnectionRequest requestConnection(
final HttpRoute route,
final Object state) {
@ -186,10 +189,12 @@ public class PoolingClientConnectionManager implements ClientConnectionManager,
return new ClientConnectionRequest() {
@Override
public void abortRequest() {
future.cancel(true);
}
@Override
public ManagedClientConnection getConnection(
final long timeout,
final TimeUnit tunit) throws InterruptedException, ConnectionPoolTimeoutException {
@ -228,6 +233,7 @@ public class PoolingClientConnectionManager implements ClientConnectionManager,
}
}
@Override
public void releaseConnection(
final ManagedClientConnection conn, final long keepalive, final TimeUnit tunit) {
@ -272,6 +278,7 @@ public class PoolingClientConnectionManager implements ClientConnectionManager,
}
}
@Override
public void shutdown() {
this.log.debug("Connection manager is shutting down");
try {
@ -282,6 +289,7 @@ public class PoolingClientConnectionManager implements ClientConnectionManager,
this.log.debug("Connection manager shut down");
}
@Override
public void closeIdleConnections(final long idleTimeout, final TimeUnit tunit) {
if (this.log.isDebugEnabled()) {
this.log.debug("Closing connections idle longer than " + idleTimeout + " " + tunit);
@ -289,39 +297,48 @@ public class PoolingClientConnectionManager implements ClientConnectionManager,
this.pool.closeIdle(idleTimeout, tunit);
}
@Override
public void closeExpiredConnections() {
this.log.debug("Closing expired connections");
this.pool.closeExpired();
}
@Override
public int getMaxTotal() {
return this.pool.getMaxTotal();
}
@Override
public void setMaxTotal(final int max) {
this.pool.setMaxTotal(max);
}
@Override
public int getDefaultMaxPerRoute() {
return this.pool.getDefaultMaxPerRoute();
}
@Override
public void setDefaultMaxPerRoute(final int max) {
this.pool.setDefaultMaxPerRoute(max);
}
@Override
public int getMaxPerRoute(final HttpRoute route) {
return this.pool.getMaxPerRoute(route);
}
@Override
public void setMaxPerRoute(final HttpRoute route, final int max) {
this.pool.setMaxPerRoute(route, max);
}
@Override
public PoolStats getTotalStats() {
return this.pool.getTotalStats();
}
@Override
public PoolStats getStats(final HttpRoute route) {
return this.pool.getStats(route);
}

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/ProxySelectorRoutePlanner.java

@ -39,7 +39,6 @@ import java.util.List;
import com.fr.third.org.apache.http.HttpException;
import com.fr.third.org.apache.http.HttpHost;
import com.fr.third.org.apache.http.HttpRequest;
import com.fr.third.org.apache.http.annotation.NotThreadSafe;
import com.fr.third.org.apache.http.conn.params.ConnRoutePNames;
import com.fr.third.org.apache.http.impl.conn.SystemDefaultRoutePlanner;
import com.fr.third.org.apache.http.conn.params.ConnRouteParams;
@ -73,12 +72,11 @@ import com.fr.third.org.apache.http.util.Asserts;
*
* @deprecated (4.3) use {@link SystemDefaultRoutePlanner}
*/
@NotThreadSafe // e.g [gs]etProxySelector()
@Deprecated
public class ProxySelectorRoutePlanner implements HttpRoutePlanner {
/** The scheme registry. */
protected final SchemeRegistry schemeRegistry; // @ThreadSafe
protected final SchemeRegistry schemeRegistry; // @Contract(threading = ThreadingBehavior.SAFE)
/** The proxy selector to use, or {@code null} for system default. */
protected ProxySelector proxySelector;
@ -116,6 +114,7 @@ public class ProxySelectorRoutePlanner implements HttpRoutePlanner {
this.proxySelector = prosel;
}
@Override
public HttpRoute determineRoute(final HttpHost target,
final HttpRequest request,
final HttpContext context)

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/SchemeRegistryFactory.java

@ -26,7 +26,8 @@
*/
package com.fr.third.org.apache.http.impl.conn;
import com.fr.third.org.apache.http.annotation.ThreadSafe;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.impl.client.HttpClientBuilder;
import com.fr.third.org.apache.http.conn.scheme.PlainSocketFactory;
import com.fr.third.org.apache.http.conn.scheme.Scheme;
@ -38,7 +39,7 @@ import com.fr.third.org.apache.http.conn.ssl.SSLSocketFactory;
*
* @deprecated (4.3) use {@link HttpClientBuilder}.
*/
@ThreadSafe
@Contract(threading = ThreadingBehavior.SAFE)
@Deprecated
public final class SchemeRegistryFactory {

18
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/SingleClientConnManager.java

@ -32,8 +32,8 @@ import java.util.concurrent.TimeUnit;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.fr.third.org.apache.http.annotation.GuardedBy;
import com.fr.third.org.apache.http.annotation.ThreadSafe;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.conn.ClientConnectionManager;
import com.fr.third.org.apache.http.conn.ClientConnectionOperator;
import com.fr.third.org.apache.http.conn.ClientConnectionRequest;
@ -61,7 +61,7 @@ import com.fr.third.org.apache.http.util.Asserts;
*
* @deprecated (4.2) use {@link BasicClientConnectionManager}
*/
@ThreadSafe
@Contract(threading = ThreadingBehavior.SAFE)
@Deprecated
public class SingleClientConnManager implements ClientConnectionManager {
@ -82,19 +82,15 @@ public class SingleClientConnManager implements ClientConnectionManager {
protected final boolean alwaysShutDown;
/** The one and only entry in this pool. */
@GuardedBy("this")
protected volatile PoolEntry uniquePoolEntry;
/** The currently issued managed connection, if any. */
@GuardedBy("this")
protected volatile ConnAdapter managedConn;
/** The time of the last connection release, or -1. */
@GuardedBy("this")
protected volatile long lastReleaseTime;
/** The time the last released connection expires and shouldn't be reused. */
@GuardedBy("this")
protected volatile long connectionExpiresTime;
/** Indicates whether this connection manager is shut down. */
@ -145,6 +141,7 @@ public class SingleClientConnManager implements ClientConnectionManager {
}
}
@Override
public SchemeRegistry getSchemeRegistry() {
return this.schemeRegistry;
}
@ -175,16 +172,19 @@ public class SingleClientConnManager implements ClientConnectionManager {
Asserts.check(!this.isShutDown, "Manager is shut down");
}
@Override
public final ClientConnectionRequest requestConnection(
final HttpRoute route,
final Object state) {
return new ClientConnectionRequest() {
@Override
public void abortRequest() {
// Nothing to abort, since requests are immediate.
}
@Override
public ManagedClientConnection getConnection(
final long timeout, final TimeUnit tunit) {
return SingleClientConnManager.this.getConnection(
@ -253,6 +253,7 @@ public class SingleClientConnManager implements ClientConnectionManager {
}
}
@Override
public void releaseConnection(
final ManagedClientConnection conn,
final long validDuration, final TimeUnit timeUnit) {
@ -307,6 +308,7 @@ public class SingleClientConnManager implements ClientConnectionManager {
}
}
@Override
public void closeExpiredConnections() {
final long time = connectionExpiresTime;
if (System.currentTimeMillis() >= time) {
@ -314,6 +316,7 @@ public class SingleClientConnManager implements ClientConnectionManager {
}
}
@Override
public void closeIdleConnections(final long idletime, final TimeUnit tunit) {
assertStillUp();
@ -336,6 +339,7 @@ public class SingleClientConnManager implements ClientConnectionManager {
}
}
@Override
public void shutdown() {
this.isShutDown = true;
synchronized (this) {

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/tsccm/AbstractConnPool.java

@ -38,7 +38,6 @@ import java.util.concurrent.locks.ReentrantLock;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.fr.third.org.apache.http.annotation.GuardedBy;
import com.fr.third.org.apache.http.conn.ConnectionPoolTimeoutException;
import com.fr.third.org.apache.http.conn.OperatedClientConnection;
import com.fr.third.org.apache.http.conn.routing.HttpRoute;
@ -66,12 +65,8 @@ public abstract class AbstractConnPool {
*/
protected final Lock poolLock;
/** References to issued connections */
@GuardedBy("poolLock")
protected Set<BasicPoolEntry> leasedConnections;
/** The current total number of connections. */
@GuardedBy("poolLock")
protected int numConnections;
/** Indicates whether this pool is shut down. */

2
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/tsccm/BasicPoolEntryRef.java

@ -45,7 +45,7 @@ import com.fr.third.org.apache.http.util.Args;
public class BasicPoolEntryRef extends WeakReference<BasicPoolEntry> {
/** The planned route of the entry. */
private final HttpRoute route; // HttpRoute is @Immutable
private final HttpRoute route; // HttpRoute is @Contract(threading = ThreadingBehavior.IMMUTABLE)
/**

2
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java

@ -282,6 +282,7 @@ public class ConnPoolByRoute extends AbstractConnPool {
return new PoolEntryRequest() {
@Override
public void abortRequest() {
poolLock.lock();
try {
@ -291,6 +292,7 @@ public class ConnPoolByRoute extends AbstractConnPool {
}
}
@Override
public BasicPoolEntry getPoolEntry(
final long timeout,
final TimeUnit tunit)

1
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/tsccm/RouteSpecificPool.java

@ -85,6 +85,7 @@ public class RouteSpecificPool {
this.route = route;
this.maxEntries = maxEntries;
this.connPerRoute = new ConnPerRoute() {
@Override
public int getMaxForRoute(final HttpRoute unused) {
return RouteSpecificPool.this.maxEntries;
}

19
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java

@ -33,7 +33,8 @@ import com.fr.third.org.apache.http.conn.OperatedClientConnection;
import com.fr.third.org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.fr.third.org.apache.http.annotation.ThreadSafe;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.conn.ClientConnectionManager;
import com.fr.third.org.apache.http.conn.ClientConnectionOperator;
import com.fr.third.org.apache.http.conn.ClientConnectionRequest;
@ -68,14 +69,14 @@ import com.fr.third.org.apache.http.util.Asserts;
*
* @deprecated (4.2) use {@link PoolingHttpClientConnectionManager}
*/
@ThreadSafe
@Contract(threading = ThreadingBehavior.SAFE_CONDITIONAL)
@Deprecated
public class ThreadSafeClientConnManager implements ClientConnectionManager {
private final Log log;
/** The schemes supported by this connection manager. */
protected final SchemeRegistry schemeRegistry; // @ThreadSafe
protected final SchemeRegistry schemeRegistry; // @Contract(threading = ThreadingBehavior.SAFE)
protected final AbstractConnPool connectionPool;
@ -83,7 +84,7 @@ public class ThreadSafeClientConnManager implements ClientConnectionManager {
protected final ConnPoolByRoute pool;
/** The operator for opening and updating connections. */
protected final ClientConnectionOperator connOperator; // DefaultClientConnectionOperator is @ThreadSafe
protected final ClientConnectionOperator connOperator; // DefaultClientConnectionOperator is @Contract(threading = ThreadingBehavior.SAFE)
protected final ConnPerRouteBean connPerRoute;
@ -208,13 +209,15 @@ public class ThreadSafeClientConnManager implements ClientConnectionManager {
protected ClientConnectionOperator
createConnectionOperator(final SchemeRegistry schreg) {
return new DefaultClientConnectionOperator(schreg);// @ThreadSafe
return new DefaultClientConnectionOperator(schreg);// @Contract(threading = ThreadingBehavior.SAFE)
}
@Override
public SchemeRegistry getSchemeRegistry() {
return this.schemeRegistry;
}
@Override
public ClientConnectionRequest requestConnection(
final HttpRoute route,
final Object state) {
@ -224,10 +227,12 @@ public class ThreadSafeClientConnManager implements ClientConnectionManager {
return new ClientConnectionRequest() {
@Override
public void abortRequest() {
poolRequest.abortRequest();
}
@Override
public ManagedClientConnection getConnection(
final long timeout, final TimeUnit tunit) throws InterruptedException,
ConnectionPoolTimeoutException {
@ -245,6 +250,7 @@ public class ThreadSafeClientConnManager implements ClientConnectionManager {
}
@Override
public void releaseConnection(final ManagedClientConnection conn, final long validDuration, final TimeUnit timeUnit) {
Args.check(conn instanceof BasicPooledConnAdapter, "Connection class mismatch, " +
"connection not obtained from this manager");
@ -290,6 +296,7 @@ public class ThreadSafeClientConnManager implements ClientConnectionManager {
}
}
@Override
public void shutdown() {
log.debug("Shutting down");
pool.shutdown();
@ -321,6 +328,7 @@ public class ThreadSafeClientConnManager implements ClientConnectionManager {
return pool.getConnectionsInPool();
}
@Override
public void closeIdleConnections(final long idleTimeout, final TimeUnit tunit) {
if (log.isDebugEnabled()) {
log.debug("Closing connections idle longer than " + idleTimeout + " " + tunit);
@ -328,6 +336,7 @@ public class ThreadSafeClientConnManager implements ClientConnectionManager {
pool.closeIdleConnections(idleTimeout, tunit);
}
@Override
public void closeExpiredConnections() {
log.debug("Closing expired connections");
pool.closeExpiredConnections();

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/BestMatchSpec.java

@ -27,7 +27,8 @@
package com.fr.third.org.apache.http.impl.cookie;
import com.fr.third.org.apache.http.annotation.ThreadSafe;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.impl.cookie.DefaultCookieSpec;
/**
@ -38,7 +39,7 @@ import com.fr.third.org.apache.http.impl.cookie.DefaultCookieSpec;
*
* @since 4.0
*/
@ThreadSafe
@Contract(threading = ThreadingBehavior.SAFE)
@Deprecated
public class BestMatchSpec extends DefaultCookieSpec {

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/BestMatchSpecFactory.java

@ -29,7 +29,8 @@ package com.fr.third.org.apache.http.impl.cookie;
import java.util.Collection;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.cookie.CookieSpec;
import com.fr.third.org.apache.http.cookie.CookieSpecFactory;
import com.fr.third.org.apache.http.cookie.CookieSpecProvider;
@ -46,7 +47,7 @@ import com.fr.third.org.apache.http.protocol.HttpContext;
*
* @since 4.0
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
@Deprecated
public class BestMatchSpecFactory implements CookieSpecFactory, CookieSpecProvider {

6
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/BrowserCompatSpec.java

@ -36,7 +36,8 @@ import com.fr.third.org.apache.http.FormattedHeader;
import com.fr.third.org.apache.http.Header;
import com.fr.third.org.apache.http.HeaderElement;
import com.fr.third.org.apache.http.NameValuePair;
import com.fr.third.org.apache.http.annotation.ThreadSafe;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.client.utils.DateUtils;
import com.fr.third.org.apache.http.cookie.Cookie;
import com.fr.third.org.apache.http.cookie.CookieAttributeHandler;
@ -60,7 +61,8 @@ import com.fr.third.org.apache.http.util.CharArrayBuffer;
*
* @since 4.0
*/
@ThreadSafe
@Deprecated
@Contract(threading = ThreadingBehavior.SAFE)
public class BrowserCompatSpec extends CookieSpecBase {

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/BrowserCompatSpecFactory.java

@ -29,7 +29,8 @@ package com.fr.third.org.apache.http.impl.cookie;
import java.util.Collection;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.cookie.CookieSpec;
import com.fr.third.org.apache.http.cookie.CookieSpecFactory;
import com.fr.third.org.apache.http.cookie.CookieSpecProvider;
@ -46,7 +47,7 @@ import com.fr.third.org.apache.http.protocol.HttpContext;
*
* @since 4.0
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
@Deprecated
public class BrowserCompatSpecFactory implements CookieSpecFactory, CookieSpecProvider {

6
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/BrowserCompatVersionAttributeHandler.java

@ -27,7 +27,8 @@
package com.fr.third.org.apache.http.impl.cookie;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.cookie.ClientCookie;
import com.fr.third.org.apache.http.cookie.CommonCookieAttributeHandler;
import com.fr.third.org.apache.http.cookie.MalformedCookieException;
@ -42,7 +43,8 @@ import com.fr.third.org.apache.http.util.Args;
*
* @since 4.3
*/
@Immutable
@Deprecated
@Contract(threading = ThreadingBehavior.IMMUTABLE)
public class BrowserCompatVersionAttributeHandler extends
AbstractCookieAttributeHandler implements CommonCookieAttributeHandler {

3
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/DateParseException.java

@ -27,8 +27,6 @@
package com.fr.third.org.apache.http.impl.cookie;
import com.fr.third.org.apache.http.annotation.Immutable;
/**
* An exception to indicate an error parsing a date string.
*
@ -40,7 +38,6 @@ import com.fr.third.org.apache.http.annotation.Immutable;
* @deprecated (4.3) no longer used.
*/
@Deprecated
@Immutable
public class DateParseException extends Exception {
private static final long serialVersionUID = 4417696455000643370L;

3
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/DateUtils.java

@ -30,8 +30,6 @@ package com.fr.third.org.apache.http.impl.cookie;
import java.util.Date;
import java.util.TimeZone;
import com.fr.third.org.apache.http.annotation.Immutable;
/**
* A utility class for parsing and formatting HTTP dates as used in cookies and
* other headers. This class handles dates as defined by RFC 2616 section
@ -43,7 +41,6 @@ import com.fr.third.org.apache.http.annotation.Immutable;
* @deprecated (4.3) Use {@link com.fr.third.org.apache.http.client.utils.DateUtils}.
*/
@Deprecated
@Immutable
public final class DateUtils {
/**

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/IgnoreSpecFactory.java

@ -27,7 +27,8 @@
package com.fr.third.org.apache.http.impl.cookie;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.cookie.CookieSpec;
import com.fr.third.org.apache.http.cookie.CookieSpecFactory;
import com.fr.third.org.apache.http.cookie.CookieSpecProvider;
@ -43,7 +44,7 @@ import com.fr.third.org.apache.http.protocol.HttpContext;
*
* @since 4.1
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
@Deprecated
public class IgnoreSpecFactory implements CookieSpecFactory, CookieSpecProvider {

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/NetscapeDraftSpecFactory.java

@ -29,7 +29,8 @@ package com.fr.third.org.apache.http.impl.cookie;
import java.util.Collection;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.cookie.CookieSpec;
import com.fr.third.org.apache.http.cookie.CookieSpecFactory;
import com.fr.third.org.apache.http.cookie.CookieSpecProvider;
@ -48,7 +49,7 @@ import com.fr.third.org.apache.http.protocol.HttpContext;
*
* @since 4.0
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
@Deprecated
public class NetscapeDraftSpecFactory implements CookieSpecFactory, CookieSpecProvider {

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/PublicSuffixListParser.java

@ -29,7 +29,8 @@ package com.fr.third.org.apache.http.impl.cookie;
import java.io.IOException;
import java.io.Reader;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.conn.util.PublicSuffixList;
/**
@ -40,7 +41,7 @@ import com.fr.third.org.apache.http.conn.util.PublicSuffixList;
*
* @since 4.0
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
@Deprecated
public class PublicSuffixListParser {

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/RFC2109SpecFactory.java

@ -29,7 +29,8 @@ package com.fr.third.org.apache.http.impl.cookie;
import java.util.Collection;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.cookie.CookieSpec;
import com.fr.third.org.apache.http.cookie.CookieSpecFactory;
import com.fr.third.org.apache.http.cookie.CookieSpecProvider;
@ -48,7 +49,7 @@ import com.fr.third.org.apache.http.protocol.HttpContext;
*
* @since 4.0
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
@Deprecated
public class RFC2109SpecFactory implements CookieSpecFactory, CookieSpecProvider {

5
fine-httpcomponents/http-client/httpclient/src/main/java-deprecated/com/fr/third/org/apache/http/impl/cookie/RFC2965SpecFactory.java

@ -29,7 +29,8 @@ package com.fr.third.org.apache.http.impl.cookie;
import java.util.Collection;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.cookie.CookieSpec;
import com.fr.third.org.apache.http.cookie.CookieSpecFactory;
import com.fr.third.org.apache.http.cookie.CookieSpecProvider;
@ -48,7 +49,7 @@ import com.fr.third.org.apache.http.protocol.HttpContext;
*
* @since 4.0
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
@Deprecated
public class RFC2965SpecFactory implements CookieSpecFactory, CookieSpecProvider {

3
fine-httpcomponents/http-client/httpclient/src/main/java/com/fr/third/org/apache/http/auth/AUTH.java

@ -27,15 +27,12 @@
package com.fr.third.org.apache.http.auth;
import com.fr.third.org.apache.http.annotation.Immutable;
/**
* Constants and static helpers related to the HTTP authentication.
*
*
* @since 4.0
*/
@Immutable
public final class AUTH {
/**

5
fine-httpcomponents/http-client/httpclient/src/main/java/com/fr/third/org/apache/http/auth/AuthOption.java

@ -26,13 +26,14 @@
*/
package com.fr.third.org.apache.http.auth;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.util.Args;
/**
* @since 4.2
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
public final class AuthOption {
private final AuthScheme authScheme;

5
fine-httpcomponents/http-client/httpclient/src/main/java/com/fr/third/org/apache/http/auth/AuthSchemeRegistry.java

@ -34,7 +34,8 @@ import java.util.concurrent.ConcurrentHashMap;
import com.fr.third.org.apache.http.config.Registry;
import com.fr.third.org.apache.http.HttpRequest;
import com.fr.third.org.apache.http.annotation.ThreadSafe;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.config.Lookup;
import com.fr.third.org.apache.http.params.HttpParams;
import com.fr.third.org.apache.http.protocol.ExecutionContext;
@ -49,7 +50,7 @@ import com.fr.third.org.apache.http.util.Args;
*
* @deprecated (4.3) use {@link Registry}
*/
@ThreadSafe
@Contract(threading = ThreadingBehavior.SAFE)
@Deprecated
public final class AuthSchemeRegistry implements Lookup<AuthSchemeProvider> {

5
fine-httpcomponents/http-client/httpclient/src/main/java/com/fr/third/org/apache/http/auth/AuthScope.java

@ -29,7 +29,8 @@ package com.fr.third.org.apache.http.auth;
import java.util.Locale;
import com.fr.third.org.apache.http.HttpHost;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.util.Args;
import com.fr.third.org.apache.http.util.LangUtils;
@ -42,7 +43,7 @@ import com.fr.third.org.apache.http.util.LangUtils;
* </p>
* @since 4.0
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
public class AuthScope {
/**

2
fine-httpcomponents/http-client/httpclient/src/main/java/com/fr/third/org/apache/http/auth/AuthState.java

@ -28,7 +28,6 @@ package com.fr.third.org.apache.http.auth;
import java.util.Queue;
import com.fr.third.org.apache.http.annotation.NotThreadSafe;
import com.fr.third.org.apache.http.util.Args;
/**
@ -36,7 +35,6 @@ import com.fr.third.org.apache.http.util.Args;
*
* @since 4.0
*/
@NotThreadSafe
public class AuthState {
/** Actual state of authentication protocol */

2
fine-httpcomponents/http-client/httpclient/src/main/java/com/fr/third/org/apache/http/auth/AuthenticationException.java

@ -27,7 +27,6 @@
package com.fr.third.org.apache.http.auth;
import com.fr.third.org.apache.http.ProtocolException;
import com.fr.third.org.apache.http.annotation.Immutable;
/**
* Signals a failure in authentication process
@ -35,7 +34,6 @@ import com.fr.third.org.apache.http.annotation.Immutable;
*
* @since 4.0
*/
@Immutable
public class AuthenticationException extends ProtocolException {
private static final long serialVersionUID = -6794031905674764776L;

5
fine-httpcomponents/http-client/httpclient/src/main/java/com/fr/third/org/apache/http/auth/BasicUserPrincipal.java

@ -29,7 +29,8 @@ package com.fr.third.org.apache.http.auth;
import java.io.Serializable;
import java.security.Principal;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import com.fr.third.org.apache.http.util.Args;
import com.fr.third.org.apache.http.util.LangUtils;
@ -38,7 +39,7 @@ import com.fr.third.org.apache.http.util.LangUtils;
*
* @since 4.0
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
public final class BasicUserPrincipal implements Principal, Serializable {
private static final long serialVersionUID = -2266305184969850467L;

3
fine-httpcomponents/http-client/httpclient/src/main/java/com/fr/third/org/apache/http/auth/InvalidCredentialsException.java

@ -26,8 +26,6 @@
*/
package com.fr.third.org.apache.http.auth;
import com.fr.third.org.apache.http.annotation.Immutable;
/**
* Authentication credentials required to respond to a authentication
* challenge are invalid
@ -35,7 +33,6 @@ import com.fr.third.org.apache.http.annotation.Immutable;
*
* @since 4.0
*/
@Immutable
public class InvalidCredentialsException extends AuthenticationException {
private static final long serialVersionUID = -4834003835215460648L;

7
fine-httpcomponents/http-client/httpclient/src/main/java/com/fr/third/org/apache/http/auth/KerberosCredentials.java

@ -29,7 +29,8 @@ package com.fr.third.org.apache.http.auth;
import java.io.Serializable;
import java.security.Principal;
import com.fr.third.org.apache.http.annotation.Immutable;
import com.fr.third.org.apache.http.annotation.Contract;
import com.fr.third.org.apache.http.annotation.ThreadingBehavior;
import org.ietf.jgss.GSSCredential;
/**
@ -37,7 +38,7 @@ import org.ietf.jgss.GSSCredential;
*
* @since 4.4
*/
@Immutable
@Contract(threading = ThreadingBehavior.IMMUTABLE)
public class KerberosCredentials implements Credentials, Serializable {
private static final long serialVersionUID = 487421613855550713L;
@ -58,10 +59,12 @@ public class KerberosCredentials implements Credentials, Serializable {
return gssCredential;
}
@Override
public Principal getUserPrincipal() {
return null;
}
@Override
public String getPassword() {
return null;
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save