Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Push property setting down to bean instances
Browse files Browse the repository at this point in the history
This allows the removal of many additional intermediate
abstract parent beans, and makes the instances clearer
at the cost of being slightly longer.
  • Loading branch information
iay committed May 1, 2017
1 parent a6e9ecd commit ef717ef
Show file tree
Hide file tree
Showing 16 changed files with 80 additions and 74 deletions.
6 changes: 4 additions & 2 deletions mdx/at_aconet/beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand All @@ -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"/>
Expand Down
3 changes: 2 additions & 1 deletion mdx/at_aconet/verbs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand Down
34 changes: 0 additions & 34 deletions mdx/common-beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion mdx/int_cobweb/beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand Down
3 changes: 2 additions & 1 deletion mdx/int_cobweb/verbs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand Down
6 changes: 4 additions & 2 deletions mdx/int_edugain/beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand All @@ -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"/>
Expand Down
3 changes: 2 additions & 1 deletion mdx/int_edugain/verbs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand Down
3 changes: 2 additions & 1 deletion mdx/test/beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

<!--
Expand Down
3 changes: 2 additions & 1 deletion mdx/test/verbs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand Down
9 changes: 6 additions & 3 deletions mdx/uk/beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand All @@ -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"/>
Expand Down Expand Up @@ -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"/>
Expand Down
3 changes: 2 additions & 1 deletion mdx/uk/collect.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand Down
51 changes: 34 additions & 17 deletions mdx/uk/generate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand Down Expand Up @@ -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"/>
Expand Down Expand Up @@ -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"/>
Expand Down Expand Up @@ -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"/>
Expand Down Expand Up @@ -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"/>
Expand Down Expand Up @@ -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"/>
Expand Down Expand Up @@ -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>
Expand All @@ -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">
Expand All @@ -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>
Expand Down Expand Up @@ -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>
Expand All @@ -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">
Expand All @@ -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>
Expand Down Expand Up @@ -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"/>
Expand Down Expand Up @@ -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 -->
Expand Down Expand Up @@ -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 -->
Expand Down
6 changes: 4 additions & 2 deletions mdx/uk/mdq-multisign.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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">
Expand Down
Loading

0 comments on commit ef717ef

Please sign in to comment.