JAL-2523 basic sleep and retry (3 times) on 429 response code with
[jalview.git] / src / jalview / ext / ensembl / EnsemblSymbol.java
index 0d79864..e2e38b5 100644 (file)
@@ -62,8 +62,7 @@ public class EnsemblSymbol extends EnsemblXref
    * @return
    * @throws IOException
    */
-  protected String parseSymbolResponse(BufferedReader br)
-          throws IOException
+  protected String parseSymbolResponse(BufferedReader br) throws IOException
   {
     JSONParser jp = new JSONParser();
     String result = null;
@@ -120,19 +119,19 @@ public class EnsemblSymbol extends EnsemblXref
     {
       for (String query : queries)
       {
-        for (Species taxon : Species.values())
+        for (Species taxon : Species.getModelOrganisms())
         {
-          if (taxon.isModelOrganism())
+          URL url = getUrl(query, taxon);
+          if (url != null)
           {
-            URL url = getUrl(query, taxon);
-            if (url != null)
+            br = getHttpResponse(url, ids);
+            if (br != null)
             {
-              br = getHttpResponse(url, ids);
-            }
-            String geneId = parseSymbolResponse(br);
-            if (geneId != null)
-            {
-              result.add(geneId);
+              String geneId = parseSymbolResponse(br);
+              if (geneId != null)
+              {
+                result.add(geneId);
+              }
             }
           }
         }