JAL-1379 JAL-1378 exclusion list property to ignore services not fully integrated...
authorJim Procter <jprocter@compbio.dundee.ac.uk>
Sat, 5 Oct 2013 12:59:40 +0000 (13:59 +0100)
committerJim Procter <jprocter@compbio.dundee.ac.uk>
Sat, 5 Oct 2013 12:59:40 +0000 (13:59 +0100)
src/jalview/ws/jws2/Jws2Discoverer.java

index 32e9ad5..8f56e2f 100644 (file)
@@ -38,6 +38,7 @@ import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.StringTokenizer;
 import java.util.Vector;
 
@@ -105,6 +106,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
 
   public void run()
   {
+
     if (running && oldthread != null && oldthread.isAlive())
     {
       if (!aborted)
@@ -127,6 +129,13 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
     }
     running = true;
     
+    // first set up exclusion list if needed
+    final Set<String> ignoredServices = new HashSet<String>();
+    for (String ignored:jalview.bin.Cache.getDefault("IGNORED_JABAWS_SERVICETYPES", Services.JpredWS.toString()).split("\\|"))
+    {
+      ignoredServices.add(ignored);
+    }
+
     
     changeSupport.firePropertyChange("services", services, new Vector());
     oldthread = Thread.currentThread();
@@ -171,7 +180,10 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
         // for all possible services
         for (Services sv : squery.JABAWS2SERVERS)
         {
-          svctypes.add(sv.toString());
+          if (!ignoredServices.contains(sv.toString()))
+          {
+            svctypes.add(sv.toString());
+          }
         }
 
       }
@@ -226,7 +238,10 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
         services = new Vector<Jws2Instance>();
         for (Jws2Instance svc : svcs)
         {
-          services.add(svc);
+          if (!ignoredServices.contains(svc.serviceType))
+          {
+            services.add(svc);
+          }
         }
       }
     }