Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Push property setting down to bean instances
This allows the removal of many additional intermediate
abstract parent beans, and makes the instances clearer
at the cost of being slightly longer.
iay committed May 1, 2017
1 parent a6e9ecd commit ef717ef
Showing 16 changed files with 80 additions and 74 deletions.
6 changes: 4 additions & 2 deletions mdx/at_aconet/beans.xml
@@ -27,7 +27,8 @@
<!--
Fetch the production aggregate.
-->
<bean id="at_aconet_productionAggregate" parent="DOMResourceSourceStage">
<bean id="at_aconet_productionAggregate" parent="mda.DOMResourceSourceStage">
<property name="parserPool" ref="parserPool"/>
<property name="DOMResource">
<bean parent="HTTPResource">
<constructor-arg name="client" ref="httpClient"/>
@@ -39,7 +40,8 @@
<!--
Fetch the eduGAIN export aggregate.
-->
<bean id="at_aconet_edugainAggregate" parent="DOMResourceSourceStage">
<bean id="at_aconet_edugainAggregate" parent="mda.DOMResourceSourceStage">
<property name="parserPool" ref="parserPool"/>
<property name="DOMResource">
<bean parent="HTTPResource">
<constructor-arg name="client" ref="httpClient"/>
3 changes: 2 additions & 1 deletion mdx/at_aconet/verbs.xml
@@ -22,7 +22,8 @@
-->
<import resource="classpath:at_aconet/beans.xml"/>

<bean id="serializeImported" parent="SerializationStage">
<bean id="serializeImported" parent="mda.SerializationStage">
<property name="serializer" ref="serializer"/>
<property name="outputFile">
<bean class="java.io.File">
<constructor-arg value="${mdx.dir}/at_aconet/imported.xml"/>
34 changes: 0 additions & 34 deletions mdx/common-beans.xml
@@ -118,27 +118,6 @@
</property>
</bean>

<bean id="XPathFilteringStage" abstract="true" parent="mda.XPathFilteringStage"
p:namespaceContext-ref="commonNamespaces"/>

<!--
DomFilesystemSourceStage
Parent for DOM filesystem source stages.
-->
<bean id="DOMFilesystemSourceStage" abstract="true" parent="mda.DOMFilesystemSourceStage">
<property name="parserPool" ref="parserPool"/>
</bean>

<!--
DOMResourceSourceStage
Parent for DOM resource source stages.
-->
<bean id="DOMResourceSourceStage" abstract="true" parent="mda.DOMResourceSourceStage">
<property name="parserPool" ref="parserPool"/>
</bean>

<!-- *** Parent beans for Shibboleth spring-extensions factory beans. *** -->

<bean id="DOMDocumentFactoryBean" abstract="true"
@@ -160,19 +139,6 @@
<bean id="X509CertificateFactoryBean" abstract="true"
class="net.shibboleth.ext.spring.factory.X509CertificateFactoryBean"/>

<!-- *** Parent beans for net.shibboleth.metadata.pipeline package. *** -->

<bean id="MultiOutputSerializationStage" abstract="true" parent="mda.MultiOutputSerializationStage">
<property name="serializer" ref="serializer"/>
</bean>

<bean id="PipelineMergeStage.deduplicate" abstract="true" parent="mda.PipelineMergeStage"
p:collectionMergeStrategy-ref="deduplicateMergeStrategy"/>

<bean id="SerializationStage" abstract="true" parent="mda.SerializationStage">
<property name="serializer" ref="serializer"/>
</bean>

<!-- *** Parent beans for ukf-mda. *** -->

<bean id="EntityAttributeAddingStage" abstract="true" parent="stage_parent"
3 changes: 2 additions & 1 deletion mdx/int_cobweb/beans.xml
@@ -22,7 +22,8 @@
<!--
Fetch the production aggregate.
-->
<bean id="int_cobweb_productionAggregate" parent="DOMResourceSourceStage">
<bean id="int_cobweb_productionAggregate" parent="mda.DOMResourceSourceStage">
<property name="parserPool" ref="parserPool"/>
<property name="DOMResource">
<bean parent="HTTPResource">
<constructor-arg name="client" ref="httpClient"/>
3 changes: 2 additions & 1 deletion mdx/int_cobweb/verbs.xml
@@ -22,7 +22,8 @@
-->
<import resource="classpath:int_cobweb/beans.xml"/>

<bean id="serializeImported" parent="SerializationStage">
<bean id="serializeImported" parent="mda.SerializationStage">
<property name="serializer" ref="serializer"/>
<property name="outputFile">
<bean class="java.io.File">
<constructor-arg value="${mdx.dir}/int_cobweb/imported.xml"/>
6 changes: 4 additions & 2 deletions mdx/int_edugain/beans.xml
@@ -33,7 +33,8 @@
<!--
Fetches the eduGAIN production aggregate.
-->
<bean id="int_edugain_productionAggregate" parent="DOMResourceSourceStage">
<bean id="int_edugain_productionAggregate" parent="mda.DOMResourceSourceStage">
<property name="parserPool" ref="parserPool"/>
<property name="DOMResource">
<bean parent="HTTPResource">
<constructor-arg name="client" ref="httpClient"/>
@@ -45,7 +46,8 @@
<!--
Fetch the eduGAIN test aggregate.
-->
<bean id="int_edugain_testAggregate" parent="DOMResourceSourceStage">
<bean id="int_edugain_testAggregate" parent="mda.DOMResourceSourceStage">
<property name="parserPool" ref="parserPool"/>
<property name="DOMResource">
<bean parent="HTTPResource">
<constructor-arg name="client" ref="httpClient"/>
3 changes: 2 additions & 1 deletion mdx/int_edugain/verbs.xml
@@ -22,7 +22,8 @@
-->
<import resource="classpath:int_edugain/beans.xml"/>

<bean id="serializeImported" parent="SerializationStage">
<bean id="serializeImported" parent="mda.SerializationStage">
<property name="serializer" ref="serializer"/>
<property name="outputFile">
<bean class="java.io.File">
<constructor-arg value="${mdx.dir}/int_edugain/imported.xml"/>
3 changes: 2 additions & 1 deletion mdx/test/beans.xml
@@ -15,7 +15,8 @@
<!--
Fetch the aggregate aggregate.
-->
<bean id="test_aggregate" parent="DOMResourceSourceStage"
<bean id="test_aggregate" parent="mda.DOMResourceSourceStage"
p:parserPool-ref="parserPool"
p:DOMResource="classpath:test/input.xml"/>

<!--
3 changes: 2 additions & 1 deletion mdx/test/verbs.xml
@@ -22,7 +22,8 @@
-->
<import resource="classpath:test/beans.xml"/>

<bean id="serializeImported" parent="SerializationStage">
<bean id="serializeImported" parent="mda.SerializationStage">
<property name="serializer" ref="serializer"/>
<property name="outputFile">
<bean class="java.io.File">
<constructor-arg value="${mdx.dir}/test/imported.xml"/>
9 changes: 6 additions & 3 deletions mdx/uk/beans.xml
@@ -42,7 +42,8 @@
<!--
Fetch the export aggregate.
-->
<bean id="uk_exportAggregate" parent="DOMResourceSourceStage">
<bean id="uk_exportAggregate" parent="mda.DOMResourceSourceStage">
<property name="parserPool" ref="parserPool"/>
<property name="DOMResource">
<bean parent="HTTPResource">
<constructor-arg name="client" ref="httpClient"/>
@@ -55,7 +56,8 @@
<!--
Fetch the production aggregate.
-->
<bean id="uk_productionAggregate" parent="DOMResourceSourceStage">
<bean id="uk_productionAggregate" parent="mda.DOMResourceSourceStage">
<property name="parserPool" ref="parserPool"/>
<property name="DOMResource">
<bean parent="HTTPResource">
<constructor-arg name="client" ref="httpClient"/>
@@ -448,7 +450,8 @@
Serialise the (assumed HTML) DomDocumentItem into the UK federation statistics
output file in the production XML directory.
-->
<bean id="uk_serializeStatistics" parent="SerializationStage">
<bean id="uk_serializeStatistics" parent="mda.SerializationStage">
<property name="serializer" ref="serializer"/>
<property name="outputFile">
<bean class="java.io.File">
<constructor-arg value="${output.dir}/ukfederation-stats.html"/>
3 changes: 2 additions & 1 deletion mdx/uk/collect.xml
@@ -22,7 +22,8 @@
-->
<import resource="classpath:uk/beans.xml"/>

<bean id="serializeCollected" parent="SerializationStage">
<bean id="serializeCollected" parent="mda.SerializationStage">
<property name="serializer" ref="serializer"/>
<property name="outputFile">
<bean class="java.io.File">
<constructor-arg value="${mdx.dir}/uk/collected.xml"/>
51 changes: 34 additions & 17 deletions mdx/uk/generate.xml
@@ -250,7 +250,8 @@
</property>
</bean>

<bean id="serializeUnsignedProductionAggregate" parent="SerializationStage">
<bean id="serializeUnsignedProductionAggregate" parent="mda.SerializationStage">
<property name="serializer" ref="serializer"/>
<property name="outputFile">
<bean class="java.io.File">
<constructor-arg value="${output.dir}/ukfederation-metadata-unsigned.xml"/>
@@ -305,7 +306,8 @@
<constructor-arg ref="commonNamespaces"/>
</bean>

<bean id="serializeUnsignedWayfAggregate" parent="SerializationStage">
<bean id="serializeUnsignedWayfAggregate" parent="mda.SerializationStage">
<property name="serializer" ref="serializer"/>
<property name="outputFile">
<bean class="java.io.File">
<constructor-arg value="${output.dir}/ukfederation-wayf-unsigned.xml"/>
@@ -424,7 +426,8 @@
<constructor-arg ref="commonNamespaces"/>
</bean>

<bean id="serializeCDSAllAggregate" parent="SerializationStage">
<bean id="serializeCDSAllAggregate" parent="mda.SerializationStage">
<property name="serializer" ref="serializer"/>
<property name="outputFile">
<bean class="java.io.File">
<constructor-arg value="${output.dir}/ukfederation-cdsall-unsigned.xml"/>
@@ -486,7 +489,8 @@
<bean id="uk_normaliseFallback" parent="mda.XSLTransformationStage"
p:XSLResource="classpath:uk/ns_norm_back.xsl"/>

<bean id="serializeUnsignedFallbackAggregate" parent="SerializationStage">
<bean id="serializeUnsignedFallbackAggregate" parent="mda.SerializationStage">
<property name="serializer" ref="serializer"/>
<property name="outputFile">
<bean class="java.io.File">
<constructor-arg value="${output.dir}/ukfederation-back-unsigned.xml"/>
@@ -538,7 +542,8 @@
<bean id="uk_normaliseTest" parent="mda.XSLTransformationStage"
p:XSLResource="classpath:uk/ns_norm_test.xsl"/>

<bean id="serializeUnsignedTestAggregate" parent="SerializationStage">
<bean id="serializeUnsignedTestAggregate" parent="mda.SerializationStage">
<property name="serializer" ref="serializer"/>
<property name="outputFile">
<bean class="java.io.File">
<constructor-arg value="${output.dir}/ukfederation-test-unsigned.xml"/>
@@ -591,7 +596,8 @@
<constructor-arg ref="commonNamespaces"/>
</bean>

<bean id="serializeUnsignedExportAggregate" parent="SerializationStage">
<bean id="serializeUnsignedExportAggregate" parent="mda.SerializationStage">
<property name="serializer" ref="serializer"/>
<property name="outputFile">
<bean class="java.io.File">
<constructor-arg value="${output.dir}/ukfederation-export-unsigned.xml"/>
@@ -631,7 +637,8 @@
<list>

<!-- Identity providers lacking support for SAML 2.0 -->
<bean id="SAML1onlyIdPs" parent="XPathFilteringStage"
<bean id="SAML1onlyIdPs" parent="mda.XPathFilteringStage"
p:namespaceContext-ref="commonNamespaces"
p:XPathExpression="md:IDPSSODescriptor
[not(contains(@protocolSupportEnumeration,'urn:oasis:names:tc:SAML:2.0:protocol'))]">
</bean>
@@ -640,13 +647,15 @@
<!--
Preferred implementation:
<bean id="syntheticScopes" parent="XPathFilteringStage"
<bean id="syntheticScopes" parent="mda.XPathFilteringStage"
p:namespaceContext-ref="commonNamespaces"
p:XPathExpression="shibmd:Scope[ends-with(., '.eng.ukfederation.org.uk']"/>
Unfortunately, the "ends-with" function is an XPath 2 feature, so we settle for
using "contains" instead; in our case it is equivalent.
-->
<bean id="syntheticScopes" parent="XPathFilteringStage"
<bean id="syntheticScopes" parent="mda.XPathFilteringStage"
p:namespaceContext-ref="commonNamespaces"
p:XPathExpression="//shibmd:Scope[contains(., '.eng.ukfederation.org.uk')]"/>
<!-- Specific providers not caught by the previous condition -->
<bean id="GlowScotland" parent="mda.EntityFilterStage">
@@ -658,7 +667,8 @@
</bean>

<!-- Identity providers with regular expression scopes -->
<bean id="regexScopes" parent="XPathFilteringStage"
<bean id="regexScopes" parent="mda.XPathFilteringStage"
p:namespaceContext-ref="commonNamespaces"
p:XPathExpression="//shibmd:Scope[@regexp='true']"/>
</list>
</property>
@@ -743,7 +753,8 @@
<list>

<!-- Identity providers lacking support for SAML 2.0 -->
<bean id="SAML1onlyIdPs" parent="XPathFilteringStage"
<bean id="SAML1onlyIdPs" parent="mda.XPathFilteringStage"
p:namespaceContext-ref="commonNamespaces"
p:XPathExpression="md:IDPSSODescriptor
[not(contains(@protocolSupportEnumeration,'urn:oasis:names:tc:SAML:2.0:protocol'))]">
</bean>
@@ -752,13 +763,15 @@
<!--
Preferred implementation:
<bean id="syntheticScopes" parent="XPathFilteringStage"
<bean id="syntheticScopes" parent="mda.XPathFilteringStage"
p:namespaceContext-ref="commonNamespaces"
p:XPathExpression="shibmd:Scope[ends-with(., '.eng.ukfederation.org.uk']"/>
Unfortunately, the "ends-with" function is an XPath 2 feature, so we settle for
using "contains" instead; in our case it is equivalent.
-->
<bean id="syntheticScopes" parent="XPathFilteringStage"
<bean id="syntheticScopes" parent="mda.XPathFilteringStage"
p:namespaceContext-ref="commonNamespaces"
p:XPathExpression="//shibmd:Scope[contains(., '.eng.ukfederation.org.uk')]"/>
<!-- Specific providers not caught by the previous condition -->
<bean id="GlowScotland" parent="mda.EntityFilterStage">
@@ -770,7 +783,8 @@
</bean>

<!-- Identity providers with regular expression scopes -->
<bean id="regexScopes" parent="XPathFilteringStage"
<bean id="regexScopes" parent="mda.XPathFilteringStage"
p:namespaceContext-ref="commonNamespaces"
p:XPathExpression="//shibmd:Scope[@regexp='true']"/>
</list>
</property>
@@ -805,7 +819,8 @@
<ref bean="check_namespaces"/>
<ref bean="errorTerminatingFilter"/>

<bean id="serializeUnsignedExportPreviewAggregate" parent="SerializationStage">
<bean id="serializeUnsignedExportPreviewAggregate" parent="mda.SerializationStage">
<property name="serializer" ref="serializer"/>
<property name="outputFile">
<bean class="java.io.File">
<constructor-arg value="${output.dir}/ukfederation-export-preview-unsigned.xml"/>
@@ -927,7 +942,8 @@
Merge in entities from production metadata exchange sources.
-->

<bean id="mergeProductionMDXEntities" parent="PipelineMergeStage.deduplicate">
<bean id="mergeProductionMDXEntities" parent="mda.PipelineMergeStage"
p:collectionMergeStrategy-ref="deduplicateMergeStrategy">
<property name="mergedPipelines">
<list>
<!-- entries earlier in the list have higher precedence -->
@@ -982,7 +998,8 @@
Merge in entities from pre-production metadata exchange sources.
-->

<bean id="mergePreproductionMDXEntities" parent="PipelineMergeStage.deduplicate">
<bean id="mergePreproductionMDXEntities" parent="mda.PipelineMergeStage"
p:collectionMergeStrategy-ref="deduplicateMergeStrategy">
<property name="mergedPipelines">
<list>
<!-- entries earlier in the list have higher precedence -->
6 changes: 4 additions & 2 deletions mdx/uk/mdq-multisign.xml
@@ -44,7 +44,8 @@
<!--
Start with the unsigned production aggregate.
-->
<bean id="production_aggregate" parent="DOMResourceSourceStage">
<bean id="production_aggregate" parent="mda.DOMResourceSourceStage">
<property name="parserPool" ref="parserPool"/>
<property name="DOMResource">
<bean parent="FileSystemResource" c:_0="${mdq.input}"/>
</property>
@@ -77,7 +78,8 @@
</bean>

<!-- Write individual entity documents to files. -->
<bean id="write.perentity" parent="MultiOutputSerializationStage">
<bean id="write.perentity" parent="mda.MultiOutputSerializationStage">
<property name="serializer" ref="serializer"/>
<property name="outputStrategy">
<bean parent="mda.FilesInDirectoryMultiOutputStrategy" p:nameSuffix=".xml">
<property name="directory">
15 changes: 10 additions & 5 deletions mdx/uk/verbs.xml
@@ -64,7 +64,8 @@
</map>
</property>
</bean>
<bean parent="SerializationStage">
<bean parent="mda.SerializationStage">
<property name="serializer" ref="serializer"/>
<property name="outputFile">
<bean class="java.io.File">
<constructor-arg value="${output.dir}/statistics-charting.html"/>
@@ -88,7 +89,8 @@
<ref bean="assemble"/>
<bean id="process" parent="mda.XSLTransformationStage"
p:XSLResource="classpath:uk/sp_mdui_test.xsl"/>
<bean id="serialize" parent="SerializationStage">
<bean id="serialize" parent="mda.SerializationStage">
<property name="serializer" ref="serializer"/>
<property name="outputFile">
<bean class="java.io.File">
<constructor-arg value="${mdx.dir}/uk/temp.html"/>
@@ -220,7 +222,8 @@
Fetches the contents of the file used to hold metadata to be imported
into a UK federation fragment file.
-->
<bean id="fetchImportMetadata" parent="DOMFilesystemSourceStage">
<bean id="fetchImportMetadata" parent="mda.DOMFilesystemSourceStage">
<property name="parserPool" ref="parserPool"/>
<property name="source">
<bean class="java.io.File">
<constructor-arg value="${entities.dir}/import.xml"/>
@@ -233,7 +236,8 @@
Serialise the fragment file just imported.
-->
<bean id="serializeImportedMetadata" parent="SerializationStage">
<bean id="serializeImportedMetadata" parent="mda.SerializationStage">
<property name="serializer" ref="serializer"/>
<property name="outputFile">
<bean class="java.io.File">
<constructor-arg value="${entities.dir}/imported.xml"/>
@@ -352,7 +356,8 @@
#################################################
-->

<bean id="serializeImported" parent="SerializationStage">
<bean id="serializeImported" parent="mda.SerializationStage">
<property name="serializer" ref="serializer"/>
<property name="outputFile">
<bean class="java.io.File">
<constructor-arg value="${mdx.dir}/uk/imported.xml"/>
3 changes: 2 additions & 1 deletion mdx/us_incommon/beans.xml
@@ -31,7 +31,8 @@
<!--
Fetch the production aggregate.
-->
<bean id="us_incommon_productionAggregate" parent="DOMResourceSourceStage">
<bean id="us_incommon_productionAggregate" parent="mda.DOMResourceSourceStage">
<property name="parserPool" ref="parserPool"/>
<property name="DOMResource">
<bean parent="HTTPResource">
<constructor-arg name="client" ref="httpClient"/>
3 changes: 2 additions & 1 deletion mdx/us_incommon/verbs.xml
@@ -25,7 +25,8 @@
<!--
Serialise into this channel's "imported" aggregate file.
-->
<bean id="serializeImported" parent="SerializationStage">
<bean id="serializeImported" parent="mda.SerializationStage">
<property name="serializer" ref="serializer"/>
<property name="outputFile">
<bean class="java.io.File">
<constructor-arg value="${mdx.dir}/us_incommon/imported.xml"/>

0 comments on commit ef717ef

Please sign in to comment.