You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by ma...@apache.org on 2015/10/10 08:54:32 UTC

[01/10] oodt git commit: OODT-887 remove URL network dependency

Repository: oodt
Updated Branches:
  refs/heads/master 3e41007ec -> 06b5dec1c


OODT-887 remove URL network dependency


Project: http://git-wip-us.apache.org/repos/asf/oodt/repo
Commit: http://git-wip-us.apache.org/repos/asf/oodt/commit/95e04f9a
Tree: http://git-wip-us.apache.org/repos/asf/oodt/tree/95e04f9a
Diff: http://git-wip-us.apache.org/repos/asf/oodt/diff/95e04f9a

Branch: refs/heads/master
Commit: 95e04f9a223d076beee3d4d5604b5296cbb2e315
Parents: afb8fdc
Author: Tom Barber <to...@analytical-labs.com>
Authored: Fri Oct 9 16:57:50 2015 +0100
Committer: Tom Barber <to...@analytical-labs.com>
Committed: Fri Oct 9 16:57:50 2015 +0100

----------------------------------------------------------------------
 .../org/apache/oodt/cas/filemgr/ingest/CachedIngester.java   | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/oodt/blob/95e04f9a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/ingest/CachedIngester.java
----------------------------------------------------------------------
diff --git a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/ingest/CachedIngester.java b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/ingest/CachedIngester.java
index 4c48b1c..f82ef5e 100644
--- a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/ingest/CachedIngester.java
+++ b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/ingest/CachedIngester.java
@@ -20,6 +20,7 @@ package org.apache.oodt.cas.filemgr.ingest;
 //JDK imports
 import java.io.File;
 import java.io.FileInputStream;
+import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -112,7 +113,8 @@ public class CachedIngester extends StdIngester {
      */
     public boolean hasProduct(URL fmUrl, String productName)
             throws CatalogException {
-        if (cache.getFileManagerUrl().equals(fmUrl)) {
+      try {
+        if (cache.getFileManagerUrl().toURI().equals(fmUrl.toURI())) {
             return cache.contains(productName);
         } else {
             // need to re-sync
@@ -129,6 +131,10 @@ public class CachedIngester extends StdIngester {
             }
             return cache.contains(productName);
         }
+      } catch (URISyntaxException e) {
+        LOG.log(Level.SEVERE, "Exception getting URI from URL");
+        throw new CatalogException("Exception getting URL from URL: Message: " + e.getMessage());
+      }
     }
 
     /**


[10/10] oodt git commit: Merge branch 'sonar-blockers'

Posted by ma...@apache.org.
Merge branch 'sonar-blockers'


Project: http://git-wip-us.apache.org/repos/asf/oodt/repo
Commit: http://git-wip-us.apache.org/repos/asf/oodt/commit/06b5dec1
Tree: http://git-wip-us.apache.org/repos/asf/oodt/tree/06b5dec1
Diff: http://git-wip-us.apache.org/repos/asf/oodt/diff/06b5dec1

Branch: refs/heads/master
Commit: 06b5dec1c4d5d2978922fce6c6293d08593b92f0
Parents: 3e41007 700694b
Author: Tom Barber <to...@analytical-labs.com>
Authored: Sat Oct 10 07:44:21 2015 +0100
Committer: Tom Barber <to...@analytical-labs.com>
Committed: Sat Oct 10 07:44:21 2015 +0100

----------------------------------------------------------------------
 CHANGES.txt                                     |  2 ++
 .../oodt/cas/filemgr/ingest/CachedIngester.java |  8 ++++-
 .../oodt/cas/filemgr/ingest/StdIngester.java    |  9 ++++--
 .../lightweight/LightweightProfileServer.java   | 22 ++++++-------
 .../LightweightProfileServerTest.java           |  6 ++--
 .../oodt/cas/pushpull/config/SiteInfo.java      | 28 +++++++++++-----
 .../cas/pushpull/protocol/ProtocolHandler.java  | 34 ++++++++++----------
 .../oodt/cas/pushpull/protocol/RemoteSite.java  | 23 ++++++++++---
 8 files changed, 85 insertions(+), 47 deletions(-)
----------------------------------------------------------------------



[06/10] oodt git commit: OODT-887 change url to uri to prevent dns resolution

Posted by ma...@apache.org.
OODT-887 change url to uri to prevent dns resolution


Project: http://git-wip-us.apache.org/repos/asf/oodt/repo
Commit: http://git-wip-us.apache.org/repos/asf/oodt/commit/d653cb05
Tree: http://git-wip-us.apache.org/repos/asf/oodt/tree/d653cb05
Diff: http://git-wip-us.apache.org/repos/asf/oodt/diff/d653cb05

Branch: refs/heads/master
Commit: d653cb05d0a2c7ebd9f74c26b11b1b2bc45c4a33
Parents: 1b8d1f7
Author: Tom Barber <to...@analytical-labs.com>
Authored: Fri Oct 9 20:33:23 2015 +0100
Committer: Tom Barber <to...@analytical-labs.com>
Committed: Fri Oct 9 20:33:23 2015 +0100

----------------------------------------------------------------------
 .../lightweight/LightweightProfileServer.java   | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/oodt/blob/d653cb05/profile/src/main/java/org/apache/oodt/profile/handlers/lightweight/LightweightProfileServer.java
----------------------------------------------------------------------
diff --git a/profile/src/main/java/org/apache/oodt/profile/handlers/lightweight/LightweightProfileServer.java b/profile/src/main/java/org/apache/oodt/profile/handlers/lightweight/LightweightProfileServer.java
index 947d67f..a557724 100644
--- a/profile/src/main/java/org/apache/oodt/profile/handlers/lightweight/LightweightProfileServer.java
+++ b/profile/src/main/java/org/apache/oodt/profile/handlers/lightweight/LightweightProfileServer.java
@@ -34,6 +34,7 @@ import org.xml.sax.SAXParseException;
 
 import java.io.IOException;
 import java.net.MalformedURLException;
+import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.*;
 
@@ -51,9 +52,8 @@ final public class LightweightProfileServer implements ProfileHandler {
 	 *
 	 * @throws IOException If an I/O error occurs.
 	 * @throws SAXException If an error occurs parsing the profile file.
-	 * @throws MalformedURLException If the default profile URL is malformed.
 	 */
-	public LightweightProfileServer() throws IOException, SAXException, MalformedURLException {
+	public LightweightProfileServer() throws IOException, SAXException {
 		this(System.getProperties());
 	}
 
@@ -90,8 +90,12 @@ final public class LightweightProfileServer implements ProfileHandler {
 		this.id = id;
 
 		// Get the list of profiles from the cache, if it's there.
-		profiles = (List) cache.get(url);
-		if (profiles != null) return;
+	  try {
+		profiles = (List) cache.get(url.toURI());
+	  } catch (URISyntaxException e) {
+		e.printStackTrace();
+	  }
+	  if (profiles != null) return;
 
 		// It wasn't in the cache, so create a parser to parse the file.  We only
 		// deal with correct files, so turn on validation and install an error
@@ -122,9 +126,13 @@ final public class LightweightProfileServer implements ProfileHandler {
 		doc.normalize();
 		Element root = doc.getDocumentElement();
 		profiles = Profile.createProfiles(root, new SearchableObjectFactory());
-		cache.put(url, profiles);
+	  try {
+		cache.put(url.toURI(), profiles);
+	  } catch (URISyntaxException e) {
+		e.printStackTrace();
+	  }
 
-		System.err.println("LightweightProfileServer ready");
+	  System.err.println("LightweightProfileServer ready");
 	}
 
 	public List findProfiles(XMLQuery query) throws ProfileException {


[04/10] oodt git commit: OODT-887 remove URL network dependency

Posted by ma...@apache.org.
OODT-887 remove URL network dependency


Project: http://git-wip-us.apache.org/repos/asf/oodt/repo
Commit: http://git-wip-us.apache.org/repos/asf/oodt/commit/77cfebf7
Tree: http://git-wip-us.apache.org/repos/asf/oodt/tree/77cfebf7
Diff: http://git-wip-us.apache.org/repos/asf/oodt/diff/77cfebf7

Branch: refs/heads/master
Commit: 77cfebf7fd8d1f09f40d4894d0de22b70b8c220c
Parents: 5cad567
Author: Tom Barber <to...@analytical-labs.com>
Authored: Fri Oct 9 17:03:31 2015 +0100
Committer: Tom Barber <to...@analytical-labs.com>
Committed: Fri Oct 9 17:03:31 2015 +0100

----------------------------------------------------------------------
 .../oodt/cas/pushpull/protocol/RemoteSite.java   | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/oodt/blob/77cfebf7/pushpull/src/main/java/org/apache/oodt/cas/pushpull/protocol/RemoteSite.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/protocol/RemoteSite.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/protocol/RemoteSite.java
index 1edee22..4275228 100644
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/protocol/RemoteSite.java
+++ b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/protocol/RemoteSite.java
@@ -19,7 +19,10 @@
 package org.apache.oodt.cas.pushpull.protocol;
 
 //JDK imports
+import java.net.URISyntaxException;
 import java.net.URL;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
  * 
@@ -31,7 +34,11 @@ import java.net.URL;
  * </p>.
  */
 public class RemoteSite {
-    
+
+    /* our log stream */
+    private final static Logger LOG = Logger.getLogger(RemoteSite.class
+        .getName());
+
     private String alias, username, password, cdTestDir;
     private int maxConnections;
     private URL url;
@@ -90,9 +97,13 @@ public class RemoteSite {
     public boolean equals(Object obj) {
         if (obj instanceof RemoteSite) {
             RemoteSite rs = (RemoteSite) obj;
-            return (rs.alias.equals(this.alias) && rs.url.equals(this.url)
-                    && rs.username.equals(this.username) && rs.password
-                    .equals(this.password) && rs.maxConnections == this.maxConnections);
+            try {
+                return (rs.alias.equals(this.alias) && rs.url.toURI().equals(this.url.toURI())
+                        && rs.username.equals(this.username) && rs.password
+                        .equals(this.password) && rs.maxConnections == this.maxConnections);
+            } catch (URISyntaxException e) {
+                LOG.log(Level.SEVERE, "Could not convert URL to URL: Message: "+e.getMessage());
+            }
         } else
             return false;
     }


[07/10] oodt git commit: fix javadoc

Posted by ma...@apache.org.
fix javadoc


Project: http://git-wip-us.apache.org/repos/asf/oodt/repo
Commit: http://git-wip-us.apache.org/repos/asf/oodt/commit/9e2a0574
Tree: http://git-wip-us.apache.org/repos/asf/oodt/tree/9e2a0574
Diff: http://git-wip-us.apache.org/repos/asf/oodt/diff/9e2a0574

Branch: refs/heads/master
Commit: 9e2a0574394a3516515a18c26f639ba79e733f02
Parents: d653cb0
Author: Tom Barber <to...@analytical-labs.com>
Authored: Sat Oct 10 07:25:00 2015 +0100
Committer: Tom Barber <to...@analytical-labs.com>
Committed: Sat Oct 10 07:25:00 2015 +0100

----------------------------------------------------------------------
 .../oodt/cas/pushpull/protocol/ProtocolHandler.java    | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/oodt/blob/9e2a0574/pushpull/src/main/java/org/apache/oodt/cas/pushpull/protocol/ProtocolHandler.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/protocol/ProtocolHandler.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/protocol/ProtocolHandler.java
index da104b3..e572ee3 100644
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/protocol/ProtocolHandler.java
+++ b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/protocol/ProtocolHandler.java
@@ -71,7 +71,7 @@ public class ProtocolHandler {
   /**
    * Creates a new ProtocolHandler for the given Config object
    *
-   * @param config
+   * @param pi
    *          The Config object that guides this ProtocolHandler in making class
    *          instanciations
    */
@@ -86,7 +86,7 @@ public class ProtocolHandler {
   /**
    * Returns the appropriate protocol for the given Path
    *
-   * @param ProtocolPath
+   * @param pFile
    *          Used to determine the appropriate Protocol to be returned and the
    *          path to navigate on if navigateToPathLoc is set to true.
    * @param allowReuse
@@ -99,7 +99,7 @@ public class ProtocolHandler {
    *          If true, will navigate the to the end of the Path location
    *          specified
    * @return Protocol for the given Path
-   * @throws RemoteCommunicationException
+   * @throws RemoteConnectionException
    *           If there is an error creating the protocol
    */
   public Protocol getAppropriateProtocol(RemoteSiteFile pFile,
@@ -285,12 +285,9 @@ public class ProtocolHandler {
    *
    * @param protocol
    *          The Protocol that will be connected
-   * @param url
+   * @param remoteSite
    *          The server to which the Protocol will connect
-   * @throws RemoteConnectionException
-   *           If connection fails
-   * @throws RemoteLoginException
-   *           If login fails
+   * @param test
    */
   public boolean connect(Protocol protocol, RemoteSite remoteSite, boolean test) {
     for (int tries = 0; tries < 3; tries++) {


[05/10] oodt git commit: OODT-887 change url to uri to prevent dns resolution

Posted by ma...@apache.org.
OODT-887 change url to uri to prevent dns resolution


Project: http://git-wip-us.apache.org/repos/asf/oodt/repo
Commit: http://git-wip-us.apache.org/repos/asf/oodt/commit/1b8d1f70
Tree: http://git-wip-us.apache.org/repos/asf/oodt/tree/1b8d1f70
Diff: http://git-wip-us.apache.org/repos/asf/oodt/diff/1b8d1f70

Branch: refs/heads/master
Commit: 1b8d1f701782ee16f76303f9aa6a8fffeee76ff1
Parents: 77cfebf
Author: Tom Barber <to...@analytical-labs.com>
Authored: Fri Oct 9 20:24:35 2015 +0100
Committer: Tom Barber <to...@analytical-labs.com>
Committed: Fri Oct 9 20:24:35 2015 +0100

----------------------------------------------------------------------
 .../cas/pushpull/protocol/ProtocolHandler.java  | 34 ++++++++++----------
 .../oodt/cas/pushpull/protocol/RemoteSite.java  |  4 ++-
 2 files changed, 20 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/oodt/blob/1b8d1f70/pushpull/src/main/java/org/apache/oodt/cas/pushpull/protocol/ProtocolHandler.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/protocol/ProtocolHandler.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/protocol/ProtocolHandler.java
index b1fcb83..da104b3 100644
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/protocol/ProtocolHandler.java
+++ b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/protocol/ProtocolHandler.java
@@ -21,28 +21,24 @@ package org.apache.oodt.cas.pushpull.protocol;
 import org.apache.oodt.cas.protocol.Protocol;
 import org.apache.oodt.cas.protocol.ProtocolFactory;
 import org.apache.oodt.cas.protocol.ProtocolFile;
-import org.apache.oodt.cas.pushpull.protocol.RemoteSiteFile;
-import org.apache.oodt.cas.pushpull.config.ProtocolInfo;
 import org.apache.oodt.cas.protocol.auth.BasicAuthentication;
 import org.apache.oodt.cas.protocol.exceptions.ProtocolException;
 import org.apache.oodt.cas.protocol.util.ProtocolFileFilter;
+import org.apache.oodt.cas.pushpull.config.ProtocolInfo;
 import org.apache.oodt.cas.pushpull.exceptions.RemoteConnectionException;
 
-
 //JDK imports
 import java.io.File;
 import java.io.IOException;
 import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.*;
 import java.util.Map.Entry;
-import java.util.Vector;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+
 /**
  * This class is responsible for creating the appropriate Protocol for the given
  * RemoteSites. The boolean argument 'allowReuse' allows for one unique protocol
@@ -59,9 +55,9 @@ import java.util.logging.Logger;
  */
 public class ProtocolHandler {
 
-  private final HashMap<URL, ProtocolFactory> urlAndProtocolFactory;
+  private final HashMap<URI, ProtocolFactory> urlAndProtocolFactory;
 
-  private final HashMap<URL, Protocol> reuseProtocols;
+  private final HashMap<URI, Protocol> reuseProtocols;
 
   private final HashMap<RemoteSiteFile, PagingInfo> pageInfos;
 
@@ -81,8 +77,8 @@ public class ProtocolHandler {
    */
   public ProtocolHandler(ProtocolInfo pi) {
     this.pi = pi;
-    urlAndProtocolFactory = new HashMap<URL, ProtocolFactory>();
-    reuseProtocols = new HashMap<URL, Protocol>();
+    urlAndProtocolFactory = new HashMap<URI, ProtocolFactory>();
+    reuseProtocols = new HashMap<URI, Protocol>();
     pageInfos = new HashMap<RemoteSiteFile, PagingInfo>();
     pathAndFileListMap = new HashMap<RemoteSiteFile, List<RemoteSiteFile>>();
   }
@@ -154,7 +150,7 @@ public class ProtocolHandler {
                         + remoteSite.getURL());
                 protocol = null;
               } else {
-                this.urlAndProtocolFactory.put(remoteSite.getURL(),
+                this.urlAndProtocolFactory.put(remoteSite.getURL().toURI(),
                     protocolFactory);
                 break;
               }
@@ -171,7 +167,11 @@ public class ProtocolHandler {
         connect(protocol = protocolFactory.newInstance(), remoteSite, false);
       }
       if (allowReuse)
-        this.reuseProtocols.put(remoteSite.getURL(), protocol);
+        try {
+          this.reuseProtocols.put(remoteSite.getURL().toURI(), protocol);
+        } catch (URISyntaxException e) {
+          LOG.log(Level.SEVERE, "Couildn't covert URL to URI Mesage: " + e.getMessage());
+        }
     }
     return protocol;
   }
@@ -515,8 +515,8 @@ public class ProtocolHandler {
    * @throws RemoteConnectionException
    */
   public void close() throws RemoteConnectionException {
-    Set<Entry<URL, Protocol>> entries = reuseProtocols.entrySet();
-    for (Entry<URL, Protocol> entry : entries) {
+    Set<Entry<URI, Protocol>> entries = reuseProtocols.entrySet();
+    for (Entry<URI, Protocol> entry : entries) {
       disconnect(entry.getValue());
     }
     this.reuseProtocols.clear();

http://git-wip-us.apache.org/repos/asf/oodt/blob/1b8d1f70/pushpull/src/main/java/org/apache/oodt/cas/pushpull/protocol/RemoteSite.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/protocol/RemoteSite.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/protocol/RemoteSite.java
index 4275228..76e2779 100644
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/protocol/RemoteSite.java
+++ b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/protocol/RemoteSite.java
@@ -104,8 +104,10 @@ public class RemoteSite {
             } catch (URISyntaxException e) {
                 LOG.log(Level.SEVERE, "Could not convert URL to URL: Message: "+e.getMessage());
             }
-        } else
+        } else {
             return false;
+        }
+        return false;
     }
 
     public String toString() {


[09/10] oodt git commit: OODT-887 apart from the lightweightprofileserver, I have only converted url to uri internally to prevent changes to method signatures and API

Posted by ma...@apache.org.
OODT-887 apart from the lightweightprofileserver, I have only converted url to uri internally to prevent changes to method signatures and API


Project: http://git-wip-us.apache.org/repos/asf/oodt/repo
Commit: http://git-wip-us.apache.org/repos/asf/oodt/commit/700694bd
Tree: http://git-wip-us.apache.org/repos/asf/oodt/tree/700694bd
Diff: http://git-wip-us.apache.org/repos/asf/oodt/diff/700694bd

Branch: refs/heads/master
Commit: 700694bdea86deea7bb9e713b0ddf2a23f041d4f
Parents: 6683df7
Author: Tom Barber <to...@analytical-labs.com>
Authored: Sat Oct 10 07:44:15 2015 +0100
Committer: Tom Barber <to...@analytical-labs.com>
Committed: Sat Oct 10 07:44:15 2015 +0100

----------------------------------------------------------------------
 .../handlers/lightweight/LightweightProfileServerTest.java     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/oodt/blob/700694bd/profile/src/test/java/org/apache/oodt/profile/handlers/lightweight/LightweightProfileServerTest.java
----------------------------------------------------------------------
diff --git a/profile/src/test/java/org/apache/oodt/profile/handlers/lightweight/LightweightProfileServerTest.java b/profile/src/test/java/org/apache/oodt/profile/handlers/lightweight/LightweightProfileServerTest.java
index ea54ecf..8c7c134 100644
--- a/profile/src/test/java/org/apache/oodt/profile/handlers/lightweight/LightweightProfileServerTest.java
+++ b/profile/src/test/java/org/apache/oodt/profile/handlers/lightweight/LightweightProfileServerTest.java
@@ -22,7 +22,7 @@ import org.apache.oodt.profile.ProfileElement;
 import org.apache.oodt.profile.ProfileException;
 import org.apache.oodt.xmlquery.XMLQuery;
 
-import java.net.URL;
+import java.net.URI;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -41,8 +41,8 @@ public class LightweightProfileServerTest extends TestCase {
 	}
 
 	protected void setUp() throws Exception {
-	  URL url = getClass().getResource("lightweightTest.xml");
-		server = new LightweightProfileServer(url, "testing");
+	  URI uri = getClass().getResource("lightweightTest.xml").toURI();
+		server = new LightweightProfileServer(uri, "testing");
 	}
 	
 	/**


[03/10] oodt git commit: OODT-887 remove URL network dependency

Posted by ma...@apache.org.
OODT-887 remove URL network dependency


Project: http://git-wip-us.apache.org/repos/asf/oodt/repo
Commit: http://git-wip-us.apache.org/repos/asf/oodt/commit/5cad5670
Tree: http://git-wip-us.apache.org/repos/asf/oodt/tree/5cad5670
Diff: http://git-wip-us.apache.org/repos/asf/oodt/diff/5cad5670

Branch: refs/heads/master
Commit: 5cad567031145ebde0bba9348e409202ddf86c99
Parents: e03610d
Author: Tom Barber <to...@analytical-labs.com>
Authored: Fri Oct 9 17:01:50 2015 +0100
Committer: Tom Barber <to...@analytical-labs.com>
Committed: Fri Oct 9 17:01:50 2015 +0100

----------------------------------------------------------------------
 .../oodt/cas/pushpull/config/SiteInfo.java      | 28 ++++++++++++++------
 1 file changed, 20 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/oodt/blob/5cad5670/pushpull/src/main/java/org/apache/oodt/cas/pushpull/config/SiteInfo.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/config/SiteInfo.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/config/SiteInfo.java
index 487284b..d96ad09 100644
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/config/SiteInfo.java
+++ b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/config/SiteInfo.java
@@ -19,14 +19,18 @@
 package org.apache.oodt.cas.pushpull.config;
 
 //JDK imports
+import org.apache.oodt.cas.pushpull.protocol.RemoteSite;
+
+import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.HashMap;
 import java.util.LinkedList;
-import java.util.Set;
 import java.util.Map.Entry;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 //OODT imports
-import org.apache.oodt.cas.pushpull.protocol.RemoteSite;
 
 /**
  * 
@@ -39,6 +43,10 @@ import org.apache.oodt.cas.pushpull.protocol.RemoteSite;
  */
 public class SiteInfo {
 
+    /* our log stream */
+    private final static Logger LOG = Logger.getLogger(SiteInfo.class
+        .getName());
+
     private HashMap<String, RemoteSite> aliasAndRemoteSite;
 
     public SiteInfo() {
@@ -67,12 +75,16 @@ public class SiteInfo {
                     .entrySet();
             for (Entry<String, RemoteSite> entry : set) {
                 RemoteSite rs = entry.getValue();
-                if (rs.getURL().equals(url)
-                        && (username == null || rs.getUsername().equals(
-                                username))
-                        && (password == null || rs.getPassword().equals(
-                                password)))
-                    remoteSites.add(rs);
+                try {
+                    if (rs.getURL().toURI().equals(url.toURI())
+                            && (username == null || rs.getUsername().equals(
+                                    username))
+                            && (password == null || rs.getPassword().equals(
+                                    password)))
+                        remoteSites.add(rs);
+                } catch (URISyntaxException e) {
+                    LOG.log(Level.SEVERE, "Could not convert URL to URI Message: "+e.getMessage());
+                }
             }
             if (remoteSites.size() == 0) {
                 if (url != null && username != null && password != null)


[02/10] oodt git commit: OODT-887 remove URL network dependency

Posted by ma...@apache.org.
OODT-887 remove URL network dependency


Project: http://git-wip-us.apache.org/repos/asf/oodt/repo
Commit: http://git-wip-us.apache.org/repos/asf/oodt/commit/e03610df
Tree: http://git-wip-us.apache.org/repos/asf/oodt/tree/e03610df
Diff: http://git-wip-us.apache.org/repos/asf/oodt/diff/e03610df

Branch: refs/heads/master
Commit: e03610dfe6ede85a40148ecfe821ac3864c8954b
Parents: 95e04f9
Author: Tom Barber <to...@analytical-labs.com>
Authored: Fri Oct 9 17:00:19 2015 +0100
Committer: Tom Barber <to...@analytical-labs.com>
Committed: Fri Oct 9 17:00:19 2015 +0100

----------------------------------------------------------------------
 CHANGES.txt                                                 | 2 ++
 .../org/apache/oodt/cas/filemgr/ingest/StdIngester.java     | 9 +++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/oodt/blob/e03610df/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 968467f..3322d8b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -10,6 +10,8 @@ Release 0.11 - Current Development
 
 * OODT-882 Merge dependency update into master (magicaltrout)
 
+* OODT-887 Prevent DNS resolution on URL Lookup
+
 Release 0.10 - 08/30/2015
 
 * OODT-871 Issues with OODT 0.10 RC#1 (lewismc, mattmann)

http://git-wip-us.apache.org/repos/asf/oodt/blob/e03610df/filemgr/src/main/java/org/apache/oodt/cas/filemgr/ingest/StdIngester.java
----------------------------------------------------------------------
diff --git a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/ingest/StdIngester.java b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/ingest/StdIngester.java
index 132321e..adc9b69 100644
--- a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/ingest/StdIngester.java
+++ b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/ingest/StdIngester.java
@@ -34,6 +34,7 @@ import org.apache.oodt.cas.metadata.exceptions.MetExtractionException;
 
 //JDK imports
 import java.io.File;
+import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.Iterator;
 import java.util.List;
@@ -243,8 +244,12 @@ public class StdIngester implements Ingester, CoreMetKeys {
     private void checkOrSetFileManager(URL url) {
         if (this.fmClient != null && this.fmClient.getFileManagerUrl() != null) {
 
-            if (!this.fmClient.getFileManagerUrl().equals(url)) {
-                setFileManager(url);
+            try {
+                if (!this.fmClient.getFileManagerUrl().toURI().equals(url.toURI())) {
+                    setFileManager(url);
+                }
+            } catch (URISyntaxException e) {
+                LOG.log(Level.SEVERE, "Could not convert URL to URI, Message :" +e.getMessage());
             }
         } else {
             setFileManager(url);


[08/10] oodt git commit: OODT-887 change url to uri to prevent blocking and increase performance

Posted by ma...@apache.org.
OODT-887 change url to uri to prevent blocking and increase performance


Project: http://git-wip-us.apache.org/repos/asf/oodt/repo
Commit: http://git-wip-us.apache.org/repos/asf/oodt/commit/6683df7e
Tree: http://git-wip-us.apache.org/repos/asf/oodt/tree/6683df7e
Diff: http://git-wip-us.apache.org/repos/asf/oodt/diff/6683df7e

Branch: refs/heads/master
Commit: 6683df7ea88a19640a76c17446b853bff3aa6b3f
Parents: 9e2a057
Author: Tom Barber <to...@analytical-labs.com>
Authored: Sat Oct 10 07:25:58 2015 +0100
Committer: Tom Barber <to...@analytical-labs.com>
Committed: Sat Oct 10 07:25:58 2015 +0100

----------------------------------------------------------------------
 .../lightweight/LightweightProfileServer.java   | 24 +++++++-------------
 1 file changed, 8 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/oodt/blob/6683df7e/profile/src/main/java/org/apache/oodt/profile/handlers/lightweight/LightweightProfileServer.java
----------------------------------------------------------------------
diff --git a/profile/src/main/java/org/apache/oodt/profile/handlers/lightweight/LightweightProfileServer.java b/profile/src/main/java/org/apache/oodt/profile/handlers/lightweight/LightweightProfileServer.java
index a557724..dba1d80 100644
--- a/profile/src/main/java/org/apache/oodt/profile/handlers/lightweight/LightweightProfileServer.java
+++ b/profile/src/main/java/org/apache/oodt/profile/handlers/lightweight/LightweightProfileServer.java
@@ -34,8 +34,8 @@ import org.xml.sax.SAXParseException;
 
 import java.io.IOException;
 import java.net.MalformedURLException;
+import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URL;
 import java.util.*;
 
 /**
@@ -53,7 +53,7 @@ final public class LightweightProfileServer implements ProfileHandler {
 	 * @throws IOException If an I/O error occurs.
 	 * @throws SAXException If an error occurs parsing the profile file.
 	 */
-	public LightweightProfileServer() throws IOException, SAXException {
+	public LightweightProfileServer() throws IOException, SAXException, URISyntaxException {
 		this(System.getProperties());
 	}
 
@@ -70,8 +70,9 @@ final public class LightweightProfileServer implements ProfileHandler {
 	 * @throws SAXException If an error occurs parsing the profile file.
 	 * @throws MalformedURLException If the URL to the profile file is malformed.
 	 */
-	public LightweightProfileServer(Properties props) throws IOException, SAXException, MalformedURLException {
-		this(new URL(props.getProperty("org.apache.oodt.profile.handlers.LightweightProfileServer.profiles.url",
+	public LightweightProfileServer(Properties props)
+		throws IOException, SAXException, URISyntaxException {
+		this(new URI(props.getProperty("org.apache.oodt.profile.handlers.LightweightProfileServer.profiles.url",
                         props.getProperty("org.apache.oodt.profile.webServer.baseURL", "http://eda.jpl.nasa.gov")
                         + "/profiles.xml")),
 			props.getProperty("org.apache.oodt.profile.handlers.LightweightProfileServer.id", "lightweight"));
@@ -84,17 +85,12 @@ final public class LightweightProfileServer implements ProfileHandler {
 	 * @param id Identifier to report for when this handler is queried by name.
 	 * @throws IOException If an I/O error occurs.
 	 * @throws SAXException If an error occurs parsing the profile file.
-	 * @throws MalformedURLException If <var>url</var> is malformed.
 	 */
-	public LightweightProfileServer(URL url, String id) throws IOException, SAXException, MalformedURLException {
+	public LightweightProfileServer(URI url, String id) throws IOException, SAXException {
 		this.id = id;
 
 		// Get the list of profiles from the cache, if it's there.
-	  try {
-		profiles = (List) cache.get(url.toURI());
-	  } catch (URISyntaxException e) {
-		e.printStackTrace();
-	  }
+	  profiles = (List) cache.get(url);
 	  if (profiles != null) return;
 
 		// It wasn't in the cache, so create a parser to parse the file.  We only
@@ -126,11 +122,7 @@ final public class LightweightProfileServer implements ProfileHandler {
 		doc.normalize();
 		Element root = doc.getDocumentElement();
 		profiles = Profile.createProfiles(root, new SearchableObjectFactory());
-	  try {
-		cache.put(url.toURI(), profiles);
-	  } catch (URISyntaxException e) {
-		e.printStackTrace();
-	  }
+	  cache.put(url, profiles);
 
 	  System.err.println("LightweightProfileServer ready");
 	}