[java-identity-provider COMMIT] in /trunk: idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relying...
noreply at shibboleth.net
noreply at shibboleth.net
Tue Oct 18 17:45:32 EDT 2016
Author: putmanb
Date: Tue Oct 18 17:45:32 2016
New Revision: 8508
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=8508&view=rev
Log:
IDP-1065: HTTP metadata resolver XML config schema and parsers should support more HttpClient config options
Added:
trunk/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/metadata/dynamicMaxConnections.xml (with props)
Modified:
trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/impl/AbstractDynamicHTTPMetadataProviderParser.java
trunk/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/DynamicHTTPMetadataProviderParserTest.java
trunk/idp-schema/src/main/resources/schema/shibboleth-metadata.xsd
Modified: trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/impl/AbstractDynamicHTTPMetadataProviderParser.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/impl/AbstractDynamicHTTPMetadataProviderParser.java?rev=8508&r1=8507&r2=8508&view=diff
==============================================================================
--- trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/impl/AbstractDynamicHTTPMetadataProviderParser.java (original)
+++ trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/impl/AbstractDynamicHTTPMetadataProviderParser.java Tue Oct 18 17:45:32 2016
@@ -61,6 +61,12 @@
/** Default caching type . */
private static final String DEFAULT_CACHING = "memory";
+
+ /** Default max total connections. */
+ private static final Integer DEFAULT_MAX_CONNECTIONS_TOTAL = 100;
+
+ /** Default max connections per route. */
+ private static final Integer DEFAULT_MAX_CONNECTIONS_PER_ROUTE = 100;
/** Logger. */
private final Logger log = LoggerFactory.getLogger(AbstractDynamicHTTPMetadataProviderParser.class);
@@ -90,12 +96,15 @@
|| element.hasAttributeNS(null, "connectionTimeout")
|| element.hasAttributeNS(null, "connectionRequestTimeout")
|| element.hasAttributeNS(null, "socketTimeout")
+ || element.hasAttributeNS(null, "maxConnectionsTotal")
+ || element.hasAttributeNS(null, "maxConnectionsPerRoute")
|| element.hasAttributeNS(null, "disregardSslCertificate")
|| element.hasAttributeNS(null, "disregardTLSCertificate")
|| element.hasAttributeNS(null, "proxyHost") || element.hasAttributeNS(null, "proxyPort")
|| element.hasAttributeNS(null, "proxyUser") || element.hasAttributeNS(null, "proxyPassword")) {
- log.warn("httpClientRef overrides settings for requestTimeout, connectionTimeout, connectionRequestTimeout, "
- + "socketTimeout disregardSslCertificate, disregardTLSCertificate, proxyHost, proxyPort, "
+ log.warn("httpClientRef overrides settings for requestTimeout, connectionTimeout, "
+ + "connectionRequestTimeout, socketTimeout, maxConnectionsTotal, maxConnectionsPerRoute, "
+ + "disregardSslCertificate, disregardTLSCertificate, proxyHost, proxyPort, "
+ "proxyUser and proxyPassword");
}
} else {
@@ -197,6 +206,19 @@
if (element.hasAttributeNS(null, "socketTimeout")) {
clientBuilder.addPropertyValue("socketTimeout",
StringSupport.trimOrNull(element.getAttributeNS(null, "socketTimeout")));
+ }
+
+ if (element.hasAttributeNS(null, "maxConnectionsTotal")) {
+ clientBuilder.addPropertyValue("maxConnectionsTotal",
+ StringSupport.trimOrNull(element.getAttributeNS(null, "maxConnectionsTotal")));
+ } else {
+ clientBuilder.addPropertyValue("maxConnectionsTotal", DEFAULT_MAX_CONNECTIONS_TOTAL);
+ }
+ if (element.hasAttributeNS(null, "maxConnectionsPerRoute")) {
+ clientBuilder.addPropertyValue("maxConnectionsPerRoute",
+ StringSupport.trimOrNull(element.getAttributeNS(null, "maxConnectionsPerRoute")));
+ } else {
+ clientBuilder.addPropertyValue("maxConnectionsPerRoute", DEFAULT_MAX_CONNECTIONS_PER_ROUTE);
}
if (haveTLSTrustEngine) {
Modified: trunk/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/DynamicHTTPMetadataProviderParserTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/DynamicHTTPMetadataProviderParserTest.java?rev=8508&r1=8507&r2=8508&view=diff
==============================================================================
[... 47 lines stripped ...]
More information about the commits
mailing list