[java-identity-provider] branch master updated: IDP-1121 <ApplicationManagedConnection> is no more
Rod Widdowson
rdw at steadingsoftware.com
Tue Feb 12 10:06:20 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=4d8dca57184ab243665272dc557026e95b19d254
The following commit(s) were added to refs/heads/master by this push:
new 4d8dca5 IDP-1121 <ApplicationManagedConnection> is no more
4d8dca5 is described below
commit 4d8dca57184ab243665272dc557026e95b19d254
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Tue Feb 12 15:04:34 2019 +0000
IDP-1121 <ApplicationManagedConnection> is no more
https://issues.shibboleth.net/jira/browse/IDP-1121
Most changes to the tests are to swap over to using dchp from c3po
althoug the StoredIdConnector does get a new tests for the
BeanManagedConnection.
---
idp-attribute-resolver-spring/pom.xml | 4 -
.../spring/dc/impl/ManagedConnectionParser.java | 124 +--------------------
.../spring/dc/StoredIDDataConnectorParserTest.java | 42 +++++++
.../dc/rdbms/RDBMSDataConnectorParserTest.java | 30 ++---
.../resolver/spring/attribute-resolver.xml | 2 +-
.../rdbms-attribute-resolver-spring-context.xml | 8 +-
...bms-attribute-resolver-spring-props-context.xml | 9 +-
.../resolver/rdbms-attribute-resolver-v2-props.xml | 16 +--
.../rdbms/resolver/rdbms-attribute-resolver-v2.xml | 12 +-
.../resolver/spring/dc/resolver/stored.xml | 2 +-
.../resolver/{stored.xml => storedBeanManaged.xml} | 4 +-
.../resolver/spring/dc/resolver/storedNoSalt.xml | 2 +-
.../schema/shibboleth-attribute-resolver.xsd | 117 +------------------
13 files changed, 71 insertions(+), 301 deletions(-)
diff --git a/idp-attribute-resolver-spring/pom.xml b/idp-attribute-resolver-spring/pom.xml
index 5c94713..d00feac 100644
--- a/idp-attribute-resolver-spring/pom.xml
+++ b/idp-attribute-resolver-spring/pom.xml
@@ -74,10 +74,6 @@
</dependency>
<dependency>
- <groupId>com.mchange</groupId>
- <artifactId>c3p0</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
<exclusions>
diff --git a/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/impl/ManagedConnectionParser.java b/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/impl/ManagedConnectionParser.java
index 275f38b..490259d 100644
--- a/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/impl/ManagedConnectionParser.java
+++ b/idp-attribute-resolver-spring/src/main/java/net/shibboleth/idp/attribute/resolver/spring/dc/impl/ManagedConnectionParser.java
@@ -37,8 +37,6 @@ import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.ManagedMap;
import org.w3c.dom.Element;
-import com.mchange.v2.c3p0.ComboPooledDataSource;
-
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;
@@ -54,10 +52,6 @@ public class ManagedConnectionParser {
@Nonnull public static final QName CONTAINER_MANAGED_CONNECTION_RESOLVER =
new QName(AttributeResolverNamespaceHandler.NAMESPACE, "ContainerManagedConnection");
- /** resolver: ApplicationManagedConnection (legacy).*/
- @Nonnull public static final QName APPLICATION_MANAGED_CONNECTION_RESOLVER =
- new QName(AttributeResolverNamespaceHandler.NAMESPACE, "ApplicationManagedConnection");
-
/** resolver:BeanManagedConnection.*/
@Nonnull public static final QName BEAN_MANAGED_CONNECTION_RESOLVER =
new QName(AttributeResolverNamespaceHandler.NAMESPACE, "BeanManagedConnection");
@@ -92,15 +86,11 @@ public class ManagedConnectionParser {
final List<Element> containerManagedElements =
ElementSupport.getChildElements(configElement, CONTAINER_MANAGED_CONNECTION_RESOLVER);
- final List<Element> applicationManagedElements =
- ElementSupport.getChildElements(configElement, APPLICATION_MANAGED_CONNECTION_RESOLVER);
-
final List<Element> simpleManagedElements =
ElementSupport.getChildElements(configElement, SIMPLE_MANAGED_CONNECTION_RESOLVER);
- if ((simpleManagedElements.size() + containerManagedElements.size() + applicationManagedElements.size()) > 1) {
- LOG.warn("Only one <ApplicationManagedConnection>, <SimpleManagedConnection> or"
- +" <ContainerManagedConnection> is allowed per DataConnector");
+ if ((simpleManagedElements.size() + containerManagedElements.size() ) > 1) {
+ LOG.warn("Only one <SimpleManagedConnection> or <ContainerManagedConnection> is allowed per DataConnector");
}
if (!simpleManagedElements.isEmpty()) {
@@ -111,10 +101,6 @@ public class ManagedConnectionParser {
return createContainerManagedDataSource(containerManagedElements.get(0));
}
- if (!applicationManagedElements.isEmpty()) {
- return createApplicationManagedDataSource(applicationManagedElements.get(0));
- }
-
return null;
}
@@ -195,108 +181,6 @@ public class ManagedConnectionParser {
return dataSource.getBeanDefinition();
}
- /**
- * Creates an application managed data source bean definition.
- *
- * @param applicationManagedElement to parse
- *
- * @return data source bean definition
- */
- // Checkstyle: CyclomaticComplexity|MethodLength OFF
- @Deprecated @Nonnull protected BeanDefinition createApplicationManagedDataSource(
- @Nonnull final Element applicationManagedElement) {
-
- DeprecationSupport.warn(ObjectType.ELEMENT,
- APPLICATION_MANAGED_CONNECTION_RESOLVER.getLocalPart(),
- null,
- BEAN_MANAGED_CONNECTION_RESOLVER.getLocalPart() + " or " +
- SIMPLE_MANAGED_CONNECTION_RESOLVER.getLocalPart());
-
- Constraint.isNotNull(applicationManagedElement, "ApplicationManagedConnection element cannot be null");
- final BeanDefinitionBuilder dataSource =
- BeanDefinitionBuilder.genericBeanDefinition(ComboPooledDataSource.class);
-
- final BeanDefinitionBuilder jdbcDriver =
- BeanDefinitionBuilder.rootBeanDefinition(ManagedConnectionParser.class, "loadJdbcDriver");
- jdbcDriver.addConstructorArgValue(AttributeSupport.getAttributeValue(applicationManagedElement, new QName(
- "jdbcDriver")));
- dataSource.addPropertyValue("driverClass", jdbcDriver.getBeanDefinition());
- dataSource.addPropertyValue("jdbcUrl",
- AttributeSupport.getAttributeValue(applicationManagedElement, new QName("jdbcURL")));
- dataSource.addPropertyValue("user",
- AttributeSupport.getAttributeValue(applicationManagedElement, new QName("jdbcUserName")));
- dataSource.addPropertyValue("password",
- AttributeSupport.getAttributeValue(applicationManagedElement, new QName("jdbcPassword")));
-
- final String poolAcquireIncrement =
- AttributeSupport.getAttributeValue(applicationManagedElement, new QName("poolAcquireIncrement"));
- if (poolAcquireIncrement != null) {
- dataSource.addPropertyValue("acquireIncrement", poolAcquireIncrement);
- } else {
- dataSource.addPropertyValue("acquireIncrement", 3);
- }
-
- final String poolAcquireRetryAttempts =
- AttributeSupport.getAttributeValue(applicationManagedElement, new QName("poolAcquireRetryAttempts"));
- if (poolAcquireRetryAttempts != null) {
- dataSource.addPropertyValue("acquireRetryAttempts", poolAcquireRetryAttempts);
- } else {
- dataSource.addPropertyValue("acquireRetryAttempts", 36);
- }
-
- final String poolAcquireRetryDelay =
- AttributeSupport.getAttributeValue(applicationManagedElement, new QName("poolAcquireRetryDelay"));
- if (poolAcquireRetryDelay != null) {
- dataSource.addPropertyValue("acquireRetryDelay", poolAcquireRetryDelay);
- } else {
- dataSource.addPropertyValue("acquireRetryDelay", 5000);
- }
-
- final String poolBreakAfterAcquireFailure =
- AttributeSupport
- .getAttributeValue(applicationManagedElement, new QName("poolBreakAfterAcquireFailure"));
- if (poolBreakAfterAcquireFailure != null) {
- dataSource.addPropertyValue("breakAfterAcquireFailure", poolBreakAfterAcquireFailure);
- } else {
- dataSource.addPropertyValue("breakAfterAcquireFailure", true);
- }
-
- final String poolMinSize =
- AttributeSupport.getAttributeValue(applicationManagedElement, new QName("poolMinSize"));
- if (poolMinSize != null) {
- dataSource.addPropertyValue("minPoolSize", poolMinSize);
- } else {
- dataSource.addPropertyValue("minPoolSize", 2);
- }
-
- final String poolMaxSize =
- AttributeSupport.getAttributeValue(applicationManagedElement, new QName("poolMaxSize"));
- if (poolMaxSize != null) {
- dataSource.addPropertyValue("maxPoolSize", poolMaxSize);
- } else {
- dataSource.addPropertyValue("maxPoolSize", 50);
- }
-
- final String poolMaxIdleTime =
- AttributeSupport.getAttributeValue(applicationManagedElement, new QName("poolMaxIdleTime"));
- if (poolMaxIdleTime != null) {
- dataSource.addPropertyValue("maxIdleTime", poolMaxIdleTime);
- } else {
- dataSource.addPropertyValue("maxIdleTime", 600);
- }
-
- final String poolIdleTestPeriod =
- AttributeSupport.getAttributeValue(applicationManagedElement, new QName("poolIdleTestPeriod"));
- if (poolIdleTestPeriod != null) {
- dataSource.addPropertyValue("idleConnectionTestPeriod", poolIdleTestPeriod);
- } else {
- dataSource.addPropertyValue("idleConnectionTestPeriod", 180);
- }
-
- return dataSource.getBeanDefinition();
- }
-
- // Checkstyle: MethodLength|CyclomaticComplexity ON
/**
* Factory builder a container managed datasource.
@@ -356,13 +240,11 @@ public class ManagedConnectionParser {
final List<Element> managedElements = ElementSupport.getChildElements(config,
CONTAINER_MANAGED_CONNECTION_RESOLVER);
- managedElements.addAll(ElementSupport.getChildElements(config, APPLICATION_MANAGED_CONNECTION_RESOLVER));
managedElements.addAll(ElementSupport.getChildElements(config, SIMPLE_MANAGED_CONNECTION_RESOLVER));
if (managedElements.size() > 0) {
LOG.warn("<BeanManagedConnection> is incompatible with <ContainerManagedConnection>"
- + ", <SimpleManagedConnection> or <ApplicationManagedConnection>. The "
- + "<BeanManagedConnection> has been used");
+ + "or <SimpleManagedConnection>. The <BeanManagedConnection> has been used");
}
return StringSupport.trimOrNull(ElementSupport.getElementContentAsString(beanManagedElements.get(0)));
diff --git a/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/StoredIDDataConnectorParserTest.java b/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/StoredIDDataConnectorParserTest.java
index a077e3a..fea4f9a 100644
--- a/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/StoredIDDataConnectorParserTest.java
+++ b/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/StoredIDDataConnectorParserTest.java
@@ -17,14 +17,23 @@
package net.shibboleth.idp.attribute.resolver.spring.dc;
+import java.io.IOException;
import java.util.Arrays;
+import java.util.HashSet;
+import org.springframework.context.support.ConversionServiceFactoryBean;
+import org.springframework.context.support.GenericApplicationContext;
import org.testng.Assert;
import org.testng.annotations.Test;
+import net.shibboleth.ext.spring.config.DurationToLongConverter;
+import net.shibboleth.ext.spring.config.StringToIPRangeConverter;
+import net.shibboleth.ext.spring.config.StringToResourceConverter;
+import net.shibboleth.ext.spring.util.SchemaTypeAwareXMLBeanDefinitionReader;
import net.shibboleth.idp.attribute.resolver.ResolverAttributeDefinitionDependency;
import net.shibboleth.idp.attribute.resolver.spring.BaseAttributeDefinitionParserTest;
import net.shibboleth.idp.attribute.resolver.spring.dc.impl.StoredIDDataConnectorParser;
+import net.shibboleth.idp.attribute.resolver.spring.dc.rdbms.RDBMSDataConnectorParserTest;
import net.shibboleth.idp.saml.attribute.resolver.impl.StoredIDDataConnector;
import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
@@ -53,6 +62,39 @@ public class StoredIDDataConnectorParserTest extends BaseAttributeDefinitionPars
testIt(connector);
}
+ protected StoredIDDataConnector getStoredDataConnector(final String... beanDefinitions) throws IOException {
+ final GenericApplicationContext context = new GenericApplicationContext();
+ setTestContext(context);
+ context.setDisplayName("ApplicationContext: " + RDBMSDataConnectorParserTest.class);
+
+ final ConversionServiceFactoryBean service = new ConversionServiceFactoryBean();
+ service.setConverters(new HashSet<>(Arrays.asList(new DurationToLongConverter(), new StringToIPRangeConverter(),
+ new StringToResourceConverter())));
+ service.afterPropertiesSet();
+
+ context.getBeanFactory().setConversionService(service.getObject());
+
+ final SchemaTypeAwareXMLBeanDefinitionReader beanDefinitionReader =
+ new SchemaTypeAwareXMLBeanDefinitionReader(context);
+
+ beanDefinitionReader.setValidating(true);
+ beanDefinitionReader.loadBeanDefinitions(beanDefinitions);
+ context.refresh();
+
+ return (StoredIDDataConnector) context.getBean(StoredIDDataConnector.class);
+ }
+
+ @Test public void beanManaged() throws ComponentInitializationException, IOException {
+ final StoredIDDataConnector connector = getStoredDataConnector(DATACONNECTOR_FILE_PATH + "resolver/storedBeanManaged.xml",
+ DATACONNECTOR_FILE_PATH + "rdbms/rdbms-attribute-resolver-spring-context.xml");
+ final ResolverAttributeDefinitionDependency attrib = connector.getAttributeDependencies().iterator().next();
+ Assert.assertEquals(attrib.getDependencyPluginId(), "theSourceRemainsTheSame");
+ Assert.assertEquals(connector.getSalt(), "abcdefghijklmnopqrst".getBytes());
+ testIt(connector);
+ }
+
+
+
@Test public void withOutSalt() throws ComponentInitializationException {
final StoredIDDataConnector connector = getDataConnector("resolver/storedNoSalt.xml", StoredIDDataConnector.class);
final ResolverAttributeDefinitionDependency attrib = connector.getAttributeDependencies().iterator().next();
diff --git a/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/RDBMSDataConnectorParserTest.java b/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/RDBMSDataConnectorParserTest.java
index 444b79f..2bdfc12 100644
--- a/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/RDBMSDataConnectorParserTest.java
+++ b/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/RDBMSDataConnectorParserTest.java
@@ -41,7 +41,6 @@ import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import com.google.common.cache.Cache;
-import com.mchange.v2.c3p0.ComboPooledDataSource;
import net.shibboleth.ext.spring.config.DurationToLongConverter;
import net.shibboleth.ext.spring.config.StringToIPRangeConverter;
@@ -196,28 +195,13 @@ public class RDBMSDataConnectorParserTest {
Assert.assertEquals("myDatabase", id);
Assert.assertEquals(300000, dataConnector.getNoRetryDelay());
- if ( dataConnector.getDataSource() instanceof ComboPooledDataSource) {
- final ComboPooledDataSource dataSource = (ComboPooledDataSource) dataConnector.getDataSource();
- Assert.assertNotNull(dataSource);
- Assert.assertEquals("jdbc:hsqldb:mem:RDBMSDataConnectorStore", dataSource.getJdbcUrl());
- Assert.assertEquals("SA", dataSource.getUser());
- Assert.assertEquals(3, dataSource.getAcquireIncrement());
- Assert.assertEquals(24, dataSource.getAcquireRetryAttempts());
- Assert.assertEquals(5000, dataSource.getAcquireRetryDelay());
- Assert.assertEquals(true, dataSource.isBreakAfterAcquireFailure());
- Assert.assertEquals(1, dataSource.getMinPoolSize());
- Assert.assertEquals(5, dataSource.getMaxPoolSize());
- Assert.assertEquals(300, dataSource.getMaxIdleTime());
- Assert.assertEquals(360, dataSource.getIdleConnectionTestPeriod());
- } else {
- final BasicDataSource dataSource = (BasicDataSource) dataConnector.getDataSource();
- Assert.assertNotNull(dataSource);
- Assert.assertEquals(dataSource.getUrl(), "jdbc:hsqldb:mem:RDBMSDataConnectorStore");
- Assert.assertEquals(dataSource.getUsername(), "SA");
- Assert.assertEquals(dataSource.getMaxTotal(), 20);
- Assert.assertEquals(dataSource.getMaxIdle(), 5);
- Assert.assertEquals(dataSource.getMaxWaitMillis(), 5000);
- }
+ final BasicDataSource dataSource = (BasicDataSource) dataConnector.getDataSource();
+ Assert.assertNotNull(dataSource);
+ Assert.assertEquals(dataSource.getUrl(), "jdbc:hsqldb:mem:RDBMSDataConnectorStore");
+ Assert.assertEquals(dataSource.getUsername(), "SA");
+ Assert.assertEquals(dataSource.getMaxTotal(), 20);
+ Assert.assertEquals(dataSource.getMaxIdle(), 5);
+ Assert.assertEquals(dataSource.getMaxWaitMillis(), 5000);
Assert.assertFalse(dataConnector.isConnectionReadOnly());
final DataSourceValidator validator = (DataSourceValidator) dataConnector.getValidator();
diff --git a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/attribute-resolver.xml b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/attribute-resolver.xml
index d7b49fe..0393105 100644
--- a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/attribute-resolver.xml
+++ b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/attribute-resolver.xml
@@ -205,7 +205,7 @@
<!-- Example Relational Database Connector -->
<DataConnector id="myDB" xsi:type="RelationalDatabase">
- <ApplicationManagedConnection
+ <SimpleManagedConnection
jdbcDriver="org.hsqldb.jdbc.JDBCDriver"
jdbcURL="jdbc:hsqldb:mem:myTestDB"
jdbcUserName="SA"
diff --git a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/rdbms-attribute-resolver-spring-context.xml b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/rdbms-attribute-resolver-spring-context.xml
index 5fe4d76..ac57a2b 100644
--- a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/rdbms-attribute-resolver-spring-context.xml
+++ b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/rdbms-attribute-resolver-spring-context.xml
@@ -4,10 +4,10 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"
default-init-method="initialize"
default-destroy-method="destroy">
- <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close" p:driverClass="org.hsqldb.jdbc.JDBCDriver"
- p:jdbcUrl="jdbc:hsqldb:mem:RDBMSDataConnectorStore" p:user="SA" p:password="" p:acquireIncrement="3"
- p:acquireRetryAttempts="24" p:acquireRetryDelay="5000" p:breakAfterAcquireFailure="true" p:minPoolSize="1"
- p:maxPoolSize="5" p:maxIdleTime="300" p:idleConnectionTestPeriod="360" />
+
+ <bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close" p:driverClassName="org.hsqldb.jdbc.JDBCDriver"
+ p:maxTotal="20" p:maxIdle="5" p:maxWaitMillis="5000" p:url="jdbc:hsqldb:mem:RDBMSDataConnectorStore" p:username="SA" p:password="" />
+
<bean id="connectionReadOnly" class="java.lang.Boolean" factory-method="valueOf">
<constructor-arg value="false" />
</bean>
diff --git a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/rdbms-attribute-resolver-spring-props-context.xml b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/rdbms-attribute-resolver-spring-props-context.xml
index 56d5f11..a654820 100644
--- a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/rdbms-attribute-resolver-spring-props-context.xml
+++ b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/rdbms-attribute-resolver-spring-props-context.xml
@@ -5,12 +5,9 @@
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd"
default-init-method="initialize"
default-destroy-method="destroy">
- <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close" p:driverClass="%{datasource.driverClass}"
- p:jdbcUrl="%{datasource.jdbcUrl}" p:user="%{datasource.user}" p:password="%{datasource.password}"
- p:acquireIncrement="%{datasource.acquireIncrement}" p:acquireRetryAttempts="%{datasource.acquireRetryAttempts}"
- p:acquireRetryDelay="%{datasource.acquireRetryDelay}" p:breakAfterAcquireFailure="%{datasource.breakAfterAcquireFailure}"
- p:minPoolSize="%{datasource.minPoolSize}" p:maxPoolSize="%{datasource.maxPoolSize}" p:maxIdleTime="%{datasource.maxIdleTime}"
- p:idleConnectionTestPeriod="%{datasource.idleConnectionTestPeriod}" />
+ <bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close" p:driverClassName="org.hsqldb.jdbc.JDBCDriver"
+ p:maxTotal="20" p:maxIdle="5" p:maxWaitMillis="5000" p:url="jdbc:hsqldb:mem:RDBMSDataConnectorStore" p:username="SA" p:password="" />
+
<bean id="connectionReadOnly" class="java.lang.Boolean" factory-method="valueOf">
<constructor-arg value="%{dataConnector.readOnlyConnection}" />
</bean>
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 a11bea9..f7165f4 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
@@ -8,19 +8,9 @@
multipleResultsIsError="%{multipleResultsIsError}"
readOnlyConnection="%{readOnlyConnection}"
noRetryDelay="%{noRetryDelay}">
- <ApplicationManagedConnection
- jdbcDriver="%{datasource.driverClass}"
- jdbcURL="%{datasource.jdbcUrl}"
- jdbcUserName="%{datasource.user}"
- jdbcPassword="%{datasource.password}"
- poolAcquireIncrement="%{datasource.acquireIncrement}"
- poolAcquireRetryAttempts="%{datasource.acquireRetryAttempts}"
- poolAcquireRetryDelay="%{datasource.acquireRetryDelay}"
- poolBreakAfterAcquireFailure="%{datasource.breakAfterAcquireFailure}"
- poolMinSize="%{datasource.minPoolSize}"
- poolMaxSize="%{datasource.maxPoolSize}"
- poolMaxIdleTime="%{datasource.maxIdleTime}"
- poolIdleTestPeriod="%{datasource.idleConnectionTestPeriod}"/>
+
+ <SimpleManagedConnection jdbcDriver="%{datasource.driverClass}" jdbcURL="%{datasource.jdbcUrl}"
+ jdbcUserName="%{datasource.user}" jdbcPassword="%{datasource.password}" />
<QueryTemplate>
<![CDATA[
${statementBuilder.selectStatement}
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 363884f..a3031b8 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
@@ -9,19 +9,11 @@
readOnlyConnection="false"
noRetryDelay="PT5M">
- <ApplicationManagedConnection
+ <SimpleManagedConnection
jdbcDriver="org.hsqldb.jdbc.JDBCDriver"
jdbcURL="jdbc:hsqldb:mem:RDBMSDataConnectorStore"
jdbcUserName="SA"
- jdbcPassword=""
- poolAcquireIncrement="3"
- poolAcquireRetryAttempts="24"
- poolAcquireRetryDelay="5000"
- poolBreakAfterAcquireFailure="true"
- poolMinSize="1"
- poolMaxSize="5"
- poolMaxIdleTime="300"
- poolIdleTestPeriod="360"/>
+ jdbcPassword=""/>
<Column columnName="homephone" attributeID="phonenumber" />
<ResultCache expireAfterAccess="PT10S"/>
diff --git a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/stored.xml b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/stored.xml
index 94bc44b..e8f0ca3 100644
--- a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/stored.xml
+++ b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/stored.xml
@@ -11,7 +11,7 @@
xsi:schemaLocation="urn:mace:shibboleth:2.0:resolver http://shibboleth.net/schema/idp/shibboleth-attribute-resolver.xsd">
- <ApplicationManagedConnection
+ <SimpleManagedConnection
jdbcDriver="org.hsqldb.jdbc.JDBCDriver"
jdbcURL="jdbc:hsqldb:mem:RDBMSDataConnectorStore" />
diff --git a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/stored.xml b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/storedBeanManaged.xml
similarity index 82%
copy from idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/stored.xml
copy to idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/storedBeanManaged.xml
index 94bc44b..297bdcf 100644
--- a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/stored.xml
+++ b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/storedBeanManaged.xml
@@ -11,9 +11,7 @@
xsi:schemaLocation="urn:mace:shibboleth:2.0:resolver http://shibboleth.net/schema/idp/shibboleth-attribute-resolver.xsd">
- <ApplicationManagedConnection
- jdbcDriver="org.hsqldb.jdbc.JDBCDriver"
- jdbcURL="jdbc:hsqldb:mem:RDBMSDataConnectorStore" />
+ <BeanManagedConnection>dataSource</BeanManagedConnection>
<FailoverDataConnector ref="sddsadas"/>
<FailoverDataConnector ref="sddsadas"/>
diff --git a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/storedNoSalt.xml b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/storedNoSalt.xml
index cde4468..15bc931 100644
--- a/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/storedNoSalt.xml
+++ b/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/dc/resolver/storedNoSalt.xml
@@ -10,7 +10,7 @@
generatedAttributeID="jenny"
xsi:schemaLocation="urn:mace:shibboleth:2.0:resolver http://shibboleth.net/schema/idp/shibboleth-attribute-resolver.xsd">
<InputAttributeDefinition ref="theSourceRemainsTheSame"/>
- <ApplicationManagedConnection
+ <SimpleManagedConnection
jdbcDriver="org.hsqldb.jdbc.JDBCDriver"
jdbcURL="jdbc:hsqldb:mem:RDBMSDataConnectorStore" />
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 2bb4d90..faf3d60 100644
--- a/idp-schema/src/main/resources/schema/shibboleth-attribute-resolver.xsd
+++ b/idp-schema/src/main/resources/schema/shibboleth-attribute-resolver.xsd
@@ -957,13 +957,6 @@
</documentation>
</annotation>
</element>
- <element ref="resolver:ApplicationManagedConnection">
- <annotation>
- <documentation>
- DEPRECATED A connection, or pool of connections, to the database managed by the data connector.
- </documentation>
- </annotation>
- </element>
<element ref="resolver:SimpleManagedConnection">
<annotation>
<documentation>
@@ -1325,6 +1318,7 @@
<element ref="resolver:InputAttributeDefinition"/>
<element ref="resolver:InputDataConnector"/>
<element ref="resolver:FailoverDataConnector"/>
+ <element ref="resolver:SimpleManagedConnection"/>
<element ref="resolver:ContainerManagedConnection">
<annotation>
<documentation>
@@ -1333,20 +1327,13 @@
</documentation>
</annotation>
</element>
- <element ref="resolver:ApplicationManagedConnection">
+ <element name="BeanManagedConnection" type="string">
<annotation>
<documentation>
- A connection, or pool of connections, to the database managed by the data connector.
+ A connection, or pool of connections, to the database configured in a Spring bean.
</documentation>
</annotation>
</element>
- <element name="BeanManagedConnection" type="string">
- <annotation>
- <documentation>
- A connection, or pool of connections, to the database configured in a Spring bean.
- </documentation>
- </annotation>
- </element>
</choice>
<attribute name="queryTimeout" type="string">
<annotation>
@@ -1702,104 +1689,6 @@
</attribute>
</complexType>
- <element name="ApplicationManagedConnection" type="resolver:ApplicationManagedConnectionType">
- <annotation>
- <documentation>
- DEPRECATED
- Describes a database connection source that is managed by the attribute resolver data connector.
- </documentation>
- </annotation>
- </element>
-
- <complexType name="ApplicationManagedConnectionType">
- <attribute name="jdbcDriver" type="string" use="required">
- <annotation>
- <documentation>
- This is the full qualified class name of the JDBC driver used to connect to the database.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="jdbcURL" type="string" use="required">
- <annotation>
- <documentation>
- The JDBC URL for the database. These are usually of the form
- jdbc:databaseProduceName:databaseSpecificInformation. For example, jdbc:hsql:mem:MyDatabase
- </documentation>
- </annotation>
- </attribute>
- <attribute name="jdbcUserName" type="string">
- <annotation>
- <documentation>The user name to use while connecting to the database.</documentation>
- </annotation>
- </attribute>
- <attribute name="jdbcPassword" type="string">
- <annotation>
- <documentation>The password to use while connecting to the database.</documentation>
- </annotation>
- </attribute>
- <attribute name="poolAcquireIncrement" type="string">
- <annotation>
- <documentation>
- The number of new connections that will be created when the pool is exhausted.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="poolAcquireRetryAttempts" type="string">
- <annotation>
- <documentation>
- The number of times the pool will try to establish a connection to a database.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="poolAcquireRetryDelay" type="string">
- <annotation>
- <documentation>
- The amount of time, in milliseconds, the pool will wait before trying to retrieve a new connection
- after it has failed.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="poolBreakAfterAcquireFailure" type="string">
- <annotation>
- <documentation>
- A boolean flag that indicates whether the pool should be marked as permanently unavailable if a new
- connection can not be established after the acquire retry attempts is reached.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="poolMinSize" type="string">
- <annotation>
- <documentation>
- The minimum number of connections the pool will establish with the database. A value of zero means
- there is no minimum.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="poolMaxSize" type="string">
- <annotation>
- <documentation>
- The maximum number of connections the pool will establish with the database. A value of zero means
- there is no maximum.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="poolMaxIdleTime" type="string">
- <annotation>
- <documentation>
- The maximum time, in seconds, that an established connection will remain idle before it is closed.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="poolIdleTestPeriod" type="string">
- <annotation>
- <documentation>
- The interval, in seconds, that the pool will scan idle established connections, using the validation
- query, for liveness.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
-
<!-- Encoders that produce SAML 1 or SAML 2 Attributes -->
<complexType name="SAML1String">
<annotation>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list