[java-metadata-aggregator COMMIT] in /trunk/aggregator-pipeline/src: main/java/net/shibboleth/metadata/dom/DomHttpSou...

noreply at shibboleth.net noreply at shibboleth.net
Sun Oct 2 14:44:33 BST 2011


Author: lajoie
Date: Sun Oct  2 14:44:33 2011
New Revision: 152

URL: http://svn.shibboleth.net/view/java-metadata-aggregator?rev=152&view=rev
Log:
Rework source stage to synch up with API changes in opensaml

Added:
    trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomResourceSourceStage.java   (contents, props changed)
      - copied, changed from r147, trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomHttpSourceStage.java
    trunk/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/DomResourceSourceTest.java   (contents, props changed)
      - copied, changed from r147, trunk/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/DomHttpSourceTest.java
Removed:
    trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomHttpSourceStage.java
    trunk/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/DomHttpSourceTest.java

Copied: trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomResourceSourceStage.java (from r147, trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomHttpSourceStage.java)
URL: http://svn.shibboleth.net/view/java-metadata-aggregator/trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomResourceSourceStage.java?p2=trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomResourceSourceStage.java&p1=trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomHttpSourceStage.java&r1=147&r2=152&rev=152&view=diff
==============================================================================
--- trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomHttpSourceStage.java (original)
+++ trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/DomResourceSourceStage.java Sun Oct  2 14:44:33 2011
@@ -17,7 +17,6 @@
 
 package net.shibboleth.metadata.dom;
 
-import java.io.File;
 import java.io.InputStream;
 import java.util.Collection;
 
@@ -27,38 +26,27 @@
 import net.shibboleth.metadata.pipeline.StageProcessingException;
 
 import org.opensaml.util.CloseableSupport;
-import org.opensaml.util.StringSupport;
-import org.opensaml.util.net.HttpClientBuilder;
-import org.opensaml.util.net.HttpResource;
+import org.opensaml.util.resource.Resource;
 import org.opensaml.util.resource.ResourceException;
 import org.opensaml.util.xml.ParserPool;
 import org.opensaml.util.xml.XMLParserException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.w3c.dom.Document;
-
-import edu.vt.middleware.crypt.digest.MD5;
-import edu.vt.middleware.crypt.util.HexConverter;
 
 /**
- * A pipeline stage which reads an XML document from an HTTP source, parses the document, and places the resultant
+ * A pipeline stage which reads an XML document from an {@link Resource}, parses the document, and places the resultant
  * document (root) element in to the provided {@link DomElementItem} collection.
  * 
- * To initialize this stage either you must provide a {@link #parserPool} and either a {@link #domResource} or
- * {@link #sourceUrl}. If both a {@link #domResource} and {@link #sourceUrl} are specified then {@link #domResource} is
- * used.
+ * To initialize this stage either you must provide a {@link #parserPool} and a {@link #domResource}.
  */
 @ThreadSafe
-public class DomHttpSourceStage extends BaseStage<DomElementItem> {
+public class DomResourceSourceStage extends BaseStage<DomElementItem> {
 
     /** Class logger. */
-    private final Logger log = LoggerFactory.getLogger(DomHttpSourceStage.class);
-
-    /** URL from which the XML document will be fetched. */
-    private String sourceUrl;
+    private final Logger log = LoggerFactory.getLogger(DomResourceSourceStage.class);
 
     /** Resource used to fetch remote XML document. */
-    private HttpResource domResource;
+    private Resource domResource;
 
     /** Pool of parsers used to parse incoming DOM. */
     private ParserPool parserPool;
@@ -69,36 +57,12 @@
      */
     private boolean errorCausesSourceFailure = true;
 
-    /** Cached DOM. */
-    private Document cachedDom;
-
-    /**
-     * Gets the URL from which the XML document will be fetched.
-     * 
-     * @return URL from which the XML document will be fetched
-     */
-    public String getSourceUrl() {
-        return sourceUrl;
-    }
-
-    /**
-     * Sets the URL from which the XML document will be fetched.
-     * 
-     * @param url URL from which the XML document will be fetched
-     */
-    public synchronized void setSourceUrl(String url) {
-        if (isInitialized()) {
-            return;
-        }
-        sourceUrl = StringSupport.trimOrNull(url);
-    }
-
     /**
      * Gets the resource from which the XML Document will be fetched.
      * 
      * @return resource from which the XML document will be fetched
      */
-    public HttpResource getDomResource() {
+    public Resource getDomResource() {
         return domResource;
     }
 
@@ -107,7 +71,7 @@
      * 
      * @param resource resource from which the XML document will be fetched
      */

[... 136 lines stripped ...]


More information about the commits mailing list