[java-metadata-aggregator COMMIT] in /trunk: aggregator-parent/doc/RELEASE-NOTES.txt aggregator-pipeline/src/main/jav...

noreply at shibboleth.net noreply at shibboleth.net
Sat May 31 09:36:18 EDT 2014


Author: iay
Date: Sat May 31 09:36:18 2014
New Revision: 370

URL: http://svn.shibboleth.net/view/java-metadata-aggregator?rev=370&view=rev
Log:
MDA-134: refactor approach to serialization

Modified:
    trunk/aggregator-parent/doc/RELEASE-NOTES.txt
    trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/ItemSerializer.java
    trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DOMElementSerializer.java
    trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/pipeline/SerializationStage.java
    trunk/aggregator-web-service/src/main/java/net/shibboleth/metadata/query/MetadataSerializerViewAdapter.java

Modified: trunk/aggregator-parent/doc/RELEASE-NOTES.txt
URL: http://svn.shibboleth.net/view/java-metadata-aggregator/trunk/aggregator-parent/doc/RELEASE-NOTES.txt?rev=370&r1=369&r2=370&view=diff
==============================================================================
--- trunk/aggregator-parent/doc/RELEASE-NOTES.txt (original)
+++ trunk/aggregator-parent/doc/RELEASE-NOTES.txt Sat May 31 09:36:18 2014
@@ -81,6 +81,15 @@
          ...
       </bean>
       
+	* The ItemSerializer interface is no longer defined over a collection of
+	  items, but now (less surprisingly) operate on a single item. In addition,
+	  ItemSerializer implementations are no longer responsible for closing the
+	  OutputStream they write the serialized form of their input to. These changes
+	  allow reuse of Serializer implementations in cases other than the current
+	  SerializationStage. The SerializationStage implementation has also
+	  been changed to iterate over all items in the collection instead of serializing
+	  just the first item into the output file. This will not affect configurations which
+	  only passed collections containing a single item to SerializationStage.
 
 API Changes
     * ElementFormattingStage removed
@@ -95,6 +104,7 @@
       and X509CertificateChainFactoryBean input properties are all now
       called "resource" and are all Spring Resource objects rather than
       Java File objects.
+    * ItemSerializer#serialize now takes Item<T> instead of Collection<Item<T>>
 
 ** Bug
     * [MDA-130] - NPE in DOMResourceStage if resource reading fails
@@ -112,6 +122,7 @@
     * [MDA-128] - use @Override annotation in MDA sources
     * [MDA-129] - remove semi-functional ElementFormattingStage
     * [MDA-133] - unbundle "endorsed" libraries from distribution
+    * [MDA-134] - refactor approach to serialisation
 
 
 Release Notes - Metadata Aggregator - Version 0.8.0

Modified: trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/ItemSerializer.java
URL: http://svn.shibboleth.net/view/java-metadata-aggregator/trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/ItemSerializer.java?rev=370&r1=369&r2=370&view=diff
==============================================================================
--- trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/ItemSerializer.java (original)
+++ trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/ItemSerializer.java Sat May 31 09:36:18 2014
@@ -18,25 +18,24 @@
 package net.shibboleth.metadata;
 
 import java.io.OutputStream;
-import java.util.Collection;
 
 import javax.annotation.Nonnull;
 
-import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
-
 /**
- * Serializers convert a collection of {@link Item} in to an octet stream.
+ * Item serializers convert an {@link Item} into an octet stream.
  * 
- * @param <T> type of data contained in the items
+ * The caller is responsible for managing (opening, closing, etc.) the output stream
+ * and orchestrating the serialization of collections of {@link Item}s.
+ * 
+ * @param <T> type of data contained in the item
  */
 public interface ItemSerializer<T> {
 
     /**
-     * Serializes the Item to the given output stream.
+     * Serializes the {@link Item} to the given output stream.
      * 
-     * @param itemCollection collection of Items
-     * @param output output stream to which the Item will be written
+     * @param item {@link Item} to be serialized
+     * @param output output stream to which the serialized {@link Item} will be written
      */
-    public void serialize(@Nonnull @NonnullElements final Collection<Item<T>> itemCollection,
-            @Nonnull final OutputStream output);
+    public void serialize(@Nonnull Item<T> item, @Nonnull OutputStream output);
 }

Modified: trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DOMElementSerializer.java
URL: http://svn.shibboleth.net/view/java-metadata-aggregator/trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DOMElementSerializer.java?rev=370&r1=369&r2=370&view=diff
==============================================================================
--- trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DOMElementSerializer.java (original)
+++ trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DOMElementSerializer.java Sat May 31 09:36:18 2014
@@ -17,9 +17,7 @@
 
 package net.shibboleth.metadata.dom;
 

[... 137 lines stripped ...]


More information about the commits mailing list