From dac9672dba85c9bb2d7b7313e015d7561f252fe1 Mon Sep 17 00:00:00 2001 From: James Procter Date: Mon, 11 May 2015 07:16:20 +0100 Subject: [PATCH] JAL-1727 patch to make EBI mirror the default server --- .../dbsources/das/datamodel/DasSourceRegistry.java | 27 ++++++++++++-------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java b/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java index 88d9db1..9c12665 100644 --- a/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java +++ b/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java @@ -20,6 +20,10 @@ */ package jalview.ws.dbsources.das.datamodel; +import jalview.bin.Cache; +import jalview.ws.dbsources.das.api.DasSourceRegistryI; +import jalview.ws.dbsources.das.api.jalviewSourceI; + import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; @@ -39,10 +43,6 @@ import org.biodas.jdas.schema.sources.SOURCE; import org.biodas.jdas.schema.sources.SOURCES; import org.biodas.jdas.schema.sources.VERSION; -import jalview.bin.Cache; -import jalview.ws.dbsources.das.api.DasSourceRegistryI; -import jalview.ws.dbsources.das.api.jalviewSourceI; - /** * */ @@ -56,8 +56,11 @@ public class DasSourceRegistry implements DasSourceRegistryI, private Hashtable localSources = null; - public static String DEFAULT_REGISTRY = "http://www.dasregistry.org/das/"; + // This is the EBI DAS registry archive - temporary fix + public static String DEFAULT_REGISTRY = "http://www.ebi.ac.uk/das-srv/registry/das"; + private static String[] blackList = new String[] + { "http://www.dasregistry.org", "sanger.ac.uk/registry/das1/sources/" }; /** * true if thread is running and we are talking to DAS registry service */ @@ -72,12 +75,16 @@ public class DasSourceRegistry implements DasSourceRegistryI, { String registry = jalview.bin.Cache.getDefault("DAS_REGISTRY_URL", DEFAULT_REGISTRY); - - if (registry.indexOf("/registry/das1/sources/") > -1) + // replace and update old entries + for (String blacklisted : blackList) { - jalview.bin.Cache.setProperty(jalview.bin.Cache.DAS_REGISTRY_URL, - DEFAULT_REGISTRY); - registry = DEFAULT_REGISTRY; + if (registry.indexOf(blacklisted) > -1) + { + jalview.bin.Cache.setProperty(jalview.bin.Cache.DAS_REGISTRY_URL, + DEFAULT_REGISTRY); + registry = DEFAULT_REGISTRY; + break; + } } if (registry.lastIndexOf("sources.xml") == registry.length() - 11) { -- 1.7.10.2