[spring-extensions] branch master updated: IDP-1065: HTTP metadata resolver XML config schema and parsers should support more HttpClient config options

Brent Putman putmanb at georgetown.edu
Mon Oct 17 20:46:01 EDT 2016


This is an automated email from the git hooks/post-receive script.

putmanb pushed a commit to branch master
in repository spring-extensions.

View the commit online:
http://git.shibboleth.net/view/?p=spring-extensions.git;a=commit;h=3cd6e30ad74f730cdb788e7ea61e2d8a9ecd3a8f

The following commit(s) were added to refs/heads/master by this push:
       new  3cd6e30   IDP-1065: HTTP metadata resolver XML config schema and parsers should support more HttpClient config options
3cd6e30 is described below

commit 3cd6e30ad74f730cdb788e7ea61e2d8a9ecd3a8f
Author: Brent Putman <putmanb at georgetown.edu>
AuthorDate: Mon Oct 17 20:45:58 2016 -0400

    IDP-1065: HTTP metadata resolver XML config schema and parsers should
    support more HttpClient config options
---
 .../ext/spring/factory/HttpClientFactoryBean.java  | 42 +++++++++++++++++++++-
 1 file changed, 41 insertions(+), 1 deletion(-)

diff --git a/src/main/java/net/shibboleth/ext/spring/factory/HttpClientFactoryBean.java b/src/main/java/net/shibboleth/ext/spring/factory/HttpClientFactoryBean.java
index 90cfed9..ce214bd 100644
--- a/src/main/java/net/shibboleth/ext/spring/factory/HttpClientFactoryBean.java
+++ b/src/main/java/net/shibboleth/ext/spring/factory/HttpClientFactoryBean.java
@@ -34,10 +34,22 @@ public class HttpClientFactoryBean extends AbstractComponentAwareFactoryBean<Htt
     private final HttpClientBuilder builder;
     
     /**
-     * Connection Timeout.<br/>
+     * Connection timeout.<br/>
      * We need this field to ensure that Spring does the conversion.
      */
     @Duration private long connectionTimeout;
+    
+    /**
+     * Connection request timeout.<br/>
+     * We need this field to ensure that Spring does the conversion.
+     */
+    @Duration private long connectionRequestTimeout;
+
+    /**
+     * Socket timeout.<br/>
+     * We need this field to ensure that Spring does the conversion.
+     */
+    @Duration private long socketTimeout;
 
     /**
      * Constructor.
@@ -68,6 +80,34 @@ public class HttpClientFactoryBean extends AbstractComponentAwareFactoryBean<Htt
     }
     
     /**
+     * Sets the maximum length of time in milliseconds to wait for a connection to be returned from the connection
+     * manager. A value of less than 1 indicates no timeout.
+     * 
+     * @param timeout maximum length of time in milliseconds to wait for a connection from the connection manager
+     */
+    @Duration public void setConnectionRequestTimeout(@Duration final long timeout) {
+        connectionRequestTimeout = timeout;
+        if (timeout > Integer.MAX_VALUE) {
+            throw new IllegalArgumentException("Timeout was too large");
+        }
+        builder.setConnectionRequestTimeout((int) timeout);
+    }
+    
+    /**
+     * Sets the maximum period inactivity between two consecutive data packets in milliseconds. A value of less
+     * than 1 indicates no timeout.
+     * 
+     * @param timeout maximum length of time in milliseconds between two consecutive data packets
+     */
+    @Duration public void setSocketTimeout(@Duration final long timeout) {
+        socketTimeout = timeout;
+        if (timeout > Integer.MAX_VALUE) {
+            throw new IllegalArgumentException("Timeout was too large");
+        }
+        builder.setSocketTimeout((int) timeout);
+    }
+    
+    /**
      * Set the TLS socket factory to use.
      * 
      * @param factory the new socket factory, may be null

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list