JAL-4036 use the legacy endpoint (and report the FTS query when debug/trace enabled)
authorJim Procter <j.procter@dundee.ac.uk>
Thu, 30 Jun 2022 16:37:02 +0000 (17:37 +0100)
committerJim Procter <j.procter@dundee.ac.uk>
Thu, 30 Jun 2022 16:37:02 +0000 (17:37 +0100)
src/jalview/fts/service/uniprot/UniProtFTSRestClient.java

index 4fd12df..2606b62 100644 (file)
 
 package jalview.fts.service.uniprot;
 
-import jalview.bin.Cache;
-import jalview.fts.api.FTSData;
-import jalview.fts.api.FTSDataColumnI;
-import jalview.fts.api.FTSRestClientI;
-import jalview.fts.core.FTSRestClient;
-import jalview.fts.core.FTSRestRequest;
-import jalview.fts.core.FTSRestResponse;
-import jalview.util.MessageManager;
-import jalview.util.Platform;
-
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
@@ -43,9 +33,20 @@ import com.sun.jersey.api.client.ClientResponse;
 import com.sun.jersey.api.client.WebResource;
 import com.sun.jersey.api.client.config.DefaultClientConfig;
 
+import jalview.bin.Cache;
+import jalview.bin.Console;
+import jalview.fts.api.FTSData;
+import jalview.fts.api.FTSDataColumnI;
+import jalview.fts.api.FTSRestClientI;
+import jalview.fts.core.FTSRestClient;
+import jalview.fts.core.FTSRestRequest;
+import jalview.fts.core.FTSRestResponse;
+import jalview.util.MessageManager;
+import jalview.util.Platform;
+
 public class UniProtFTSRestClient extends FTSRestClient
 {
-  private static final String DEFAULT_UNIPROT_DOMAIN = "https://www.uniprot.org";
+  private static final String DEFAULT_UNIPROT_DOMAIN = "https://legacy.uniprot.org";
 
   static
   {
@@ -123,6 +124,10 @@ public class UniProtFTSRestClient extends FTSRestClient
               .queryParam("limit", String.valueOf(responseSize))
               .queryParam("offset", String.valueOf(offSet))
               .queryParam("sort", "score").queryParam("query", query);
+      if (Console.isDebugEnabled())
+      {
+        Console.debug("Uniprot FTS Request: " + webResource.toString());
+      }
       // Execute the REST request
       ClientResponse clientResponse = webResource
               .accept(MediaType.TEXT_PLAIN).get(clientResponseClass);