[utilities COMMIT] in /java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/httpclient: FileCaching...

noreply at shibboleth.net noreply at shibboleth.net
Wed Oct 23 19:48:56 EDT 2013


Author: putmanb
Date: Wed Oct 23 19:48:56 2013
New Revision: 465

URL: http://svn.shibboleth.net/view/utilities?rev=465&view=rev
Log:
Some work around JSPT-33, prep for java-support 2.0 release.
Finalize changes for HttpClientBuilders.
Document in Javadoc various caveats from JSPT-33 around use of a wrapped Apache builder. 

Modified:
    java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/httpclient/FileCachingHttpClientBuilder.java
    java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/httpclient/HttpClientBuilder.java
    java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/httpclient/InMemoryCachingHttpClientBuilder.java

Modified: java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/httpclient/FileCachingHttpClientBuilder.java
URL: http://svn.shibboleth.net/view/utilities/java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/httpclient/FileCachingHttpClientBuilder.java?rev=465&r1=464&r2=465&view=diff
==============================================================================
--- java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/httpclient/FileCachingHttpClientBuilder.java (original)
+++ java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/httpclient/FileCachingHttpClientBuilder.java Wed Oct 23 19:48:56 2013
@@ -38,6 +38,36 @@
  * Cached content is written to disk. Special care should be taken so that multiple clients do not share a single cache
  * directory unintentionally. This could result senstive data being available in ways it should not be.
  * </p>
+ * 
+ * <p>
+ * When using the single-arg constructor variant to wrap an existing instance of
+ * {@link CachingHttpClientBuilder}, there are several caveats of which to be aware:
+ * 
+ * <ul>
+ * 
+ * <li>
+ * Several important non-caching-specific caveats are enumerated in this class's superclass {@link HttpClientBuilder}.
+ * </li>
+ * 
+ * <li>
+ * Instances of the following which are set as the default instance on the Apache builder will be
+ * unconditionally overwritten by this builder when {@link #buildClient()} is called:
+ * 
+ *   <ul>
+ *   <li>{@link CacheConfig}</li>
+ *   </ul>
+ *   
+ *   <p>
+ *   This is due to the unfortunate fact that the Apache builder does not currently provide accessor methods to
+ *   obtain the default instances currently set on the builder.  Therefore, if you need to set any default cache
+ *   config parameters which are not exposed by this builder, then you must use the Apache
+ *   builder directly and may not use this builder.
+ *   </p>
+ * </li>
+ * 
+ * </ul>
+ * 
+ * </p>
  */
 public class FileCachingHttpClientBuilder extends HttpClientBuilder {
 

Modified: java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/httpclient/HttpClientBuilder.java
URL: http://svn.shibboleth.net/view/utilities/java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/httpclient/HttpClientBuilder.java?rev=465&r1=464&r2=465&view=diff
==============================================================================
--- java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/httpclient/HttpClientBuilder.java (original)
+++ java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/httpclient/HttpClientBuilder.java Wed Oct 23 19:48:56 2013
@@ -21,6 +21,7 @@
 import java.net.UnknownHostException;
 
 import javax.annotation.Nonnull;
+import javax.net.ssl.SSLContext;
 
 import net.shibboleth.utilities.java.support.logic.Constraint;
 import net.shibboleth.utilities.java.support.primitive.StringSupport;
@@ -33,11 +34,104 @@
 import org.apache.http.client.config.RequestConfig;
 import org.apache.http.config.ConnectionConfig;
 import org.apache.http.config.SocketConfig;
+import org.apache.http.conn.HttpClientConnectionManager;
+import org.apache.http.conn.socket.LayeredConnectionSocketFactory;
+import org.apache.http.conn.ssl.X509HostnameVerifier;
 import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.apache.http.util.CharsetUtils;
 
 //TODO retry attempts, keep alive strategy
 
-/** Builder used to construct {@link HttpClient} objects configured with particular settings. */
+/** Builder used to construct {@link HttpClient} objects configured with particular settings. 
+ * 
+ * <p>
+ * When using the single-arg constructor variant to wrap an existing instance of
+ * {@link org.apache.http.impl.client.HttpClientBuilder}, there are several caveats
+ * of which to be aware:
+ * 
+ * <ul>
+ * 
+ * <li>
+ * Instances of the following which are set as the default instance on the Apache builder will be
+ * unconditionally overwritten by this builder when {@link #buildClient()} is called:
+ * 
+ *   <ul>
+ *   <li>{@link RequestConfig}</li>
+ *   <li>{@link ConnectionConfig}</li>
+ *   </ul>
+ *   
+ *   <p>
+ *   This is due to the unfortunate fact that the Apache builder does not currently provide accessor methods to
+ *   obtain the default instances currently set on the builder.  Therefore, if you need to set any default request

[... 172 lines stripped ...]


More information about the commits mailing list