From: Sasha Sherstnev Date: Tue, 10 Sep 2013 15:05:08 +0000 (+0100) Subject: Fix problem with unknown services ("forward" compatibility) X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=811c3d0faf8c9c9ed2d493e1627db6bb94260e47;hp=033ac3315fb3c8fa3173145863294774c8b46898;p=jabaws.git Fix problem with unknown services ("forward" compatibility) --- diff --git a/webservices/compbio/ws/client/CmdHelper.java b/webservices/compbio/ws/client/CmdHelper.java index 1175230..c82f193 100644 --- a/webservices/compbio/ws/client/CmdHelper.java +++ b/webservices/compbio/ws/client/CmdHelper.java @@ -19,6 +19,7 @@ package compbio.ws.client; import static compbio.ws.client.Constraints.hostkey; import static compbio.ws.client.Constraints.limitList; import static compbio.ws.client.Constraints.listServices; +import static compbio.ws.client.Constraints.listServicesOld; import static compbio.ws.client.Constraints.paramList; import static compbio.ws.client.Constraints.presetList; import static compbio.ws.client.Constraints.presetkey; @@ -56,7 +57,7 @@ class CmdHelper { * @return */ static boolean listServices(String[] cmd) { - return keyFound(cmd, listServices); + return (keyFound(cmd, listServices) || keyFound(cmd, listServicesOld)); } /** diff --git a/webservices/compbio/ws/client/Constraints.java b/webservices/compbio/ws/client/Constraints.java index 1c4283d..2454424 100644 --- a/webservices/compbio/ws/client/Constraints.java +++ b/webservices/compbio/ws/client/Constraints.java @@ -26,6 +26,7 @@ class Constraints { final static String servicekey = "-s"; final static String listServices = "-list"; + final static String listServicesOld = "-list_services"; final static String testKey = "-test"; // Actions diff --git a/webservices/compbio/ws/client/Jws2Client.java b/webservices/compbio/ws/client/Jws2Client.java index 96343db..0aa02c5 100644 --- a/webservices/compbio/ws/client/Jws2Client.java +++ b/webservices/compbio/ws/client/Jws2Client.java @@ -67,7 +67,7 @@ import compbio.util.FileUtil; */ public class Jws2Client { - /* + /** * Use java.util.Logger instead of log4j logger to reduce the size of the client package */ private static final Logger log = Logger.getLogger(Jws2Client.class.getCanonicalName()); @@ -300,11 +300,13 @@ public class Jws2Client { return; } if (!func_services.isEmpty()) { - String mess = "\n\rAvailable services: "; + System.out.println("There are " + func_services.size() + " services at " + hostname + ":"); + String mess = "\n\rThe list:\n"; System.out.println(mess + Services.toString(func_services)); } if (!nonfunc_services.isEmpty()) { - String mess = "Non-available services (internal tests failed): "; + System.out.println("There are " + nonfunc_services.size() + " non-available services at " + hostname + ":"); + String mess = "The list (internal tests failed): "; System.out.println(mess + Services.toString(nonfunc_services)); } } diff --git a/webservices/compbio/ws/client/Services.java b/webservices/compbio/ws/client/Services.java index a4e101d..741f6d5 100644 --- a/webservices/compbio/ws/client/Services.java +++ b/webservices/compbio/ws/client/Services.java @@ -58,14 +58,16 @@ public enum Services { public static String toString(Set services) { if (services == null || services.isEmpty()) { - return ""; + return "No known services...\n"; } String value = ""; - String delim = ", "; for (Services serv : services) { - value += serv.toString() + delim; + if (null != serv) { + value += serv + "\n"; + } else { + value += "Unknown Service\n"; + } } - value = value.substring(0, value.length() - delim.length()); return value; }