BeanManagedConnection
Namespace: urn:mace:shibboleth:2.0:resolver
Schema: http://shibboleth.net/schema/idp/shibboleth-attribute-resolver.xsd
Overview
The <BeanManagedConnection>
element specifies an externally-defined bean which defines a DataSource.
This is the most effective way to control connection properties, implement robust pooling support, and share connections across components. The content of the element is the name of the externally-defined bean, and it defines no XML Attributes or Elements.
Examples
The example illustrates an Oracle data source via the DBCP pooling library, which is included with the software. The Oracle JDBC driver would have to added by hand to the edit-webapp tree and the WAR rebuilt.
Oracle Backend Example
<!-- Oracle Spring connection pooling data source configuration, e.g., in global.xml -->
<bean id="OracleDataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close"
p:driverClassName="%{datasource.driverClass}"
p:url="%{datasource.jdbcUrl}"
p:username="%{datasource.user}"
p:password="%{datasource.password}"
p:initialSize="5"
p:maxTotal="50"
p:maxIdle="5"
p:maxWaitMillis="2000"
p:testOnBorrow="true"
p:testWhileIdle="true"
p:testOnReturn="true"
p:timeBetweenEvictionRunsMillis="120000"
p:minEvictableIdleTimeMillis="120000"
p:validationQuery="select 1 from dual"
p:validationQueryTimeout="4" />
<!-- Properties defined separately -->
datasource.driverClass = oracle.jdbc.OracleDriver
datasource.jdbcUrl = jdbc:oracle:thin:@<serverFQDN>:1521:<dbmame>
datasource.user = <USER>
datasource.password = <PASS>
<!-- Example of attribute-resolver.xml usage -->
<DataConnector xsi:type="dc:RelationalDatabase" id="oracledbcf" >
<BeanManagedConnection>MyDataSource</dc:BeanManagedConnection>
<QueryTemplate>
<![CDATA[
SELECT CF from DB.TABLE where USER_ID='$resolutionContext.principal'
]]>
</QueryTemplate>
<Column columnName="CF" attributeID="personalUniqueID_it_CF" />
</DataConnector>