From 8879d902c46cd33cfe201fcbd96e87d33b89259f Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 30 Jun 2022 17:37:02 +0100 Subject: [PATCH] JAL-4036 use the legacy endpoint (and report the FTS query when debug/trace enabled) --- .../fts/service/uniprot/UniProtFTSRestClient.java | 27 ++++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java b/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java index 4fd12df..2606b62 100644 --- a/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java +++ b/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java @@ -21,16 +21,6 @@ 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); -- 1.7.10.2