[java-identity-provider] 01/03: IDP-1121 Remove cacheResults and elementTimeToLive from <ResultCache>
Rod Widdowson
rdw at steadingsoftware.com
Tue Feb 12 09:28:28 EST 2019
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch master
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=c1203d8f0782394f0a5100492f6c8169a5463bfd
commit c1203d8f0782394f0a5100492f6c8169a5463bfd
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Tue Feb 12 13:43:46 2019 +0000
IDP-1121 Remove cacheResults and elementTimeToLive from <ResultCache>
https://issues.shibboleth.net/jira/browse/IDP-1121
---
.../resolver/spring/dc/impl/CacheConfigParser.java | 24 +---------------------
.../dc/rdbms/impl/RDBMSDataConnectorParser.java | 4 ----
.../resolver/ldap-attribute-resolver-v2-multi.xml | 2 +-
.../resolver/ldap-attribute-resolver-v2-nosec.xml | 4 ++--
.../resolver/ldap-attribute-resolver-v2-props.xml | 2 +-
.../ldap/resolver/ldap-attribute-resolver-v2.xml | 2 +-
.../resolver/rdbms-attribute-resolver-v2-props.xml | 2 +-
.../rdbms-attribute-resolver-v2-simple.xml | 2 +-
.../rdbms/resolver/rdbms-attribute-resolver-v2.xml | 4 ++--
.../schema/shibboleth-attribute-resolver.xsd | 10 ---------
10 files changed, 10 insertions(+), 46 deletions(-)
diff --git a/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/impl/CacheConfigParser.java b/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/impl/CacheConfigParser.java
index f2d3e59..7447e84 100644
--- a/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/impl/CacheConfigParser.java
+++ b/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/impl/CacheConfigParser.java
@@ -28,8 +28,6 @@ import javax.xml.namespace.QName;
import net.shibboleth.idp.attribute.IdPAttribute;
import net.shibboleth.idp.attribute.resolver.spring.impl.AttributeResolverNamespaceHandler;
import net.shibboleth.utilities.java.support.logic.Constraint;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport;
-import net.shibboleth.utilities.java.support.primitive.DeprecationSupport.ObjectType;
import net.shibboleth.utilities.java.support.primitive.StringSupport;
import net.shibboleth.utilities.java.support.xml.AttributeSupport;
import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
@@ -80,7 +78,6 @@ public class CacheConfigParser {
configElement = config;
}
-// Checkstyle: CyclomaticComplexity OFF
/**
* Creates a new cache bean definition from a v2 XML configuration.
*
@@ -90,14 +87,6 @@ public class CacheConfigParser {
*/
@Nonnull public BeanDefinition createCache(@Nonnull final ParserContext parserContext) {
- final String defaultCache = AttributeSupport.getAttributeValue(configElement, new QName("cacheResults"));
- if (defaultCache != null) {
- DeprecationSupport.warnOnce(ObjectType.ATTRIBUTE, "cacheResults",
- parserContext != null ? parserContext.getReaderContext().getResource().getDescription() : null,
- RESULT_CACHE_RESOLVER.toString());
- return null;
- }
-
final List<Element> cacheElements = ElementSupport.getChildElements(configElement, RESULT_CACHE_RESOLVER);
if (cacheElements.isEmpty()) {
return null;
@@ -108,13 +97,6 @@ public class CacheConfigParser {
}
final Element cacheElement = cacheElements.get(0);
- final String elementTimeToLive =
- AttributeSupport.getAttributeValue(cacheElement, new QName("elementTimeToLive"));
- if (null != elementTimeToLive) {
- DeprecationSupport.warnOnce(ObjectType.ATTRIBUTE, "elementTimeToLive",
- parserContext != null ? parserContext.getReaderContext().getResource().getDescription() : null,
- "expireAfterAccess");
- }
final String expireAfterWrite =
AttributeSupport.getAttributeValue(cacheElement, new QName("expireAfterWrite"));
final String expireAfterAccess =
@@ -122,15 +104,12 @@ public class CacheConfigParser {
final BeanDefinitionBuilder cache;
if (expireAfterWrite != null) {
- if (null != expireAfterAccess || null != elementTimeToLive) {
+ if (null != expireAfterAccess ) {
log.warn("ResultCache: Attribute 'expireAfterAccess' is mutually exclusive with 'expireAfterWrite'."
+ " Used 'expireAfterWrite'.");
}
cache = BeanDefinitionBuilder.rootBeanDefinition(CacheConfigParser.class, "buildCacheWrite");
cache.addConstructorArgValue(expireAfterWrite);
- } else if (elementTimeToLive != null) {
- cache = BeanDefinitionBuilder.rootBeanDefinition(CacheConfigParser.class, "buildCacheAccess");
- cache.addConstructorArgValue(elementTimeToLive);
} else {
cache = BeanDefinitionBuilder.rootBeanDefinition(CacheConfigParser.class, "buildCacheAccess");
cache.addConstructorArgValue(expireAfterAccess);
@@ -139,7 +118,6 @@ public class CacheConfigParser {
AttributeSupport.getAttributeValue(cacheElement, new QName("maximumCachedElements")));
return cache.getBeanDefinition();
}
-// Checkstyle: CyclomaticComplexity ON
/** Helper function to return size provided with a suitable default.
*
diff --git a/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/impl/RDBMSDataConnectorParser.java b/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/impl/RDBMSDataConnectorParser.java
index 3f61b1d..b97c75b 100644
--- a/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/impl/RDBMSDataConnectorParser.java
+++ b/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/impl/RDBMSDataConnectorParser.java
@@ -158,10 +158,6 @@ public class RDBMSDataConnectorParser extends AbstractDataConnectorParser {
if (AttributeSupport.hasAttribute(config, new QName("queryUsesStoredProcedure"))) {
DeprecationSupport.warn(ObjectType.ATTRIBUTE, "queryUsesStoredProcedure", prefix, null);
}
- if (AttributeSupport.hasAttribute(config, new QName("cacheResults"))) {
- DeprecationSupport.warn(ObjectType.ATTRIBUTE, "cacheResults", prefix, "<ResultCache>");
- }
-
}
/**
diff --git a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/resolver/ldap-attribute-resolver-v2-multi.xml b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/resolver/ldap-attribute-resolver-v2-multi.xml
index e2971d9..960316c 100644
--- a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/resolver/ldap-attribute-resolver-v2-multi.xml
+++ b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/resolver/ldap-attribute-resolver-v2-multi.xml
@@ -16,7 +16,7 @@
connectTimeout="PT2S"
responseTimeout="PT4S">
- <ResultCache elementTimeToLive="PT10S" maximumCachedElements="25"/>
+ <ResultCache expireAfterAccess="PT10S" maximumCachedElements="25"/>
<Column columnName="homephone" attributeID="phonenumber" />
diff --git a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/resolver/ldap-attribute-resolver-v2-nosec.xml b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/resolver/ldap-attribute-resolver-v2-nosec.xml
index d9d5ff2..709a3e5 100644
--- a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/resolver/ldap-attribute-resolver-v2-nosec.xml
+++ b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/resolver/ldap-attribute-resolver-v2-nosec.xml
@@ -21,7 +21,7 @@
<FailoverDataConnector ref="2123"/>
- <ResultCache elementTimeToLive="PT10S" maximumCachedElements="25"/>
+ <ResultCache expireAfterAccess="PT10S" maximumCachedElements="25"/>
<Column columnName="homephone" attributeID="phonenumber" />
@@ -56,7 +56,7 @@
]]>
</FilterTemplate>
- <ResultCache maximumCachedElements="20"/>
+ <ResultCache expireAfterAccess="20"/>
<FilterTemplate>
<![CDATA[
diff --git a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/resolver/ldap-attribute-resolver-v2-props.xml b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/resolver/ldap-attribute-resolver-v2-props.xml
index f1ad492..7dc1bf6 100644
--- a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/resolver/ldap-attribute-resolver-v2-props.xml
+++ b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/resolver/ldap-attribute-resolver-v2-props.xml
@@ -53,7 +53,7 @@
validateFilter="%{connectionPool.validator.filter}"
failFastInitialize="%{connectionPool.failFastInitialize}"/>
<ResultCache
- elementTimeToLive="%{cache.TTL}"
+ expireAfterAccess="%{cache.TTL}"
maximumCachedElements="%{cache.maxSize}"/>
</DataConnector>
diff --git a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/resolver/ldap-attribute-resolver-v2.xml b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/resolver/ldap-attribute-resolver-v2.xml
index 503e8b8..153bf7f 100644
--- a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/resolver/ldap-attribute-resolver-v2.xml
+++ b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/resolver/ldap-attribute-resolver-v2.xml
@@ -19,7 +19,7 @@
<FailoverDataConnector ref="2123"/>
- <ResultCache elementTimeToLive="PT10S" maximumCachedElements="25"/>
+ <ResultCache expireAfterAccess="PT10S" maximumCachedElements="25"/>
<Column columnName="homephone" attributeID="phonenumber" />
diff --git a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/resolver/rdbms-attribute-resolver-v2-props.xml b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/resolver/rdbms-attribute-resolver-v2-props.xml
index 77764a6..a11bea9 100644
--- a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/resolver/rdbms-attribute-resolver-v2-props.xml
+++ b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/resolver/rdbms-attribute-resolver-v2-props.xml
@@ -27,7 +27,7 @@
]]>
</QueryTemplate>
<ResultCache
- elementTimeToLive="%{cache.TTL}"
+ expireAfterAccess="%{cache.TTL}"
maximumCachedElements="%{cache.maxSize}"/>
</DataConnector>
diff --git a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/resolver/rdbms-attribute-resolver-v2-simple.xml b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/resolver/rdbms-attribute-resolver-v2-simple.xml
index 63d2a4b..3f9878e 100644
--- a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/resolver/rdbms-attribute-resolver-v2-simple.xml
+++ b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/resolver/rdbms-attribute-resolver-v2-simple.xml
@@ -15,7 +15,7 @@
jdbcPassword=""/>
<QueryTemplate><![CDATA[SELECT * FROM people WHERE userid='%s']]></QueryTemplate>
<Column columnName="homephone" attributeID="phonenumber" />
- <ResultCache elementTimeToLive="PT10S"/>
+ <ResultCache expireAfterAccess="PT10S"/>
</DataConnector>
</AttributeResolver>
diff --git a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/resolver/rdbms-attribute-resolver-v2.xml b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/resolver/rdbms-attribute-resolver-v2.xml
index b91f054..363884f 100644
--- a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/resolver/rdbms-attribute-resolver-v2.xml
+++ b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/resolver/rdbms-attribute-resolver-v2.xml
@@ -24,11 +24,11 @@
poolIdleTestPeriod="360"/>
<Column columnName="homephone" attributeID="phonenumber" />
- <ResultCache elementTimeToLive="PT10S"/>
+ <ResultCache expireAfterAccess="PT10S"/>
<FailoverDataConnector ref="2123"/>
- <ResultCache elementTimeToLive="PT10S" maximumCachedElements="25"/>
+ <ResultCache expireAfterAccess="PT10S" maximumCachedElements="25"/>
<InputAttributeDefinition ref="321"/>
diff --git a/idp-schema/src/main/resources/schema/shibboleth-attribute-resolver.xsd b/idp-schema/src/main/resources/schema/shibboleth-attribute-resolver.xsd
index 335c8bc..2bb4d90 100644
--- a/idp-schema/src/main/resources/schema/shibboleth-attribute-resolver.xsd
+++ b/idp-schema/src/main/resources/schema/shibboleth-attribute-resolver.xsd
@@ -1596,16 +1596,6 @@
</documentation>
</annotation>
</attribute>
- <attribute name="elementTimeToLive" type="string">
- <annotation>
- <documentation>
- Length of time a result will be cached since last access.
- Deprecated. expireAfterAccess replaces.
-
- Duration is expressed in ISO8601 duration notation.
- </documentation>
- </annotation>
- </attribute>
<attribute name="expireAfterAccess" type="string">
<annotation>
<documentation>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list