X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=webservices%2Fcompbio%2Fws%2Fclient%2FServices.java;h=7f06da7a31e1b47a91b99a5f2d1e43cd3e5deec7;hb=243b5d0278c06196854f7312d4c2d933deb89061;hp=a0c1f56ae3f61ad4feef1369b009e0b11ae64eb9;hpb=a79900255139dc7bcab23320de2a3630f6531107;p=jabaws.git diff --git a/webservices/compbio/ws/client/Services.java b/webservices/compbio/ws/client/Services.java index a0c1f56..7f06da7 100644 --- a/webservices/compbio/ws/client/Services.java +++ b/webservices/compbio/ws/client/Services.java @@ -26,6 +26,7 @@ import javax.xml.ws.Service; import compbio.data.msa.JABAService; import compbio.data.msa.MsaWS; import compbio.data.msa.SequenceAnnotation; +import compbio.engine.client.Executable; /** * List of web services currently supported by JABAWS version 2 @@ -36,32 +37,21 @@ public enum Services { public static Services getService(String servName) { servName = servName.trim().toLowerCase(); - if (servName.equalsIgnoreCase(MafftWS.toString())) { - return MafftWS; + for (Services service : Services.values()) { + if (service.toString().equalsIgnoreCase(servName)) { + return service; + } } - if (servName.equalsIgnoreCase(ClustalWS.toString())) { - return ClustalWS; - } - if (servName.equalsIgnoreCase(TcoffeeWS.toString())) { - return TcoffeeWS; - } - if (servName.equalsIgnoreCase(MuscleWS.toString())) { - return MuscleWS; - } - if (servName.equalsIgnoreCase(ProbconsWS.toString())) { - return ProbconsWS; - } - if (servName.equalsIgnoreCase(AAConWS.toString())) { - return AAConWS; - } - if (servName.equalsIgnoreCase(JronnWS.toString())) { - return JronnWS; - } - if (servName.equalsIgnoreCase(DisemblWS.toString())) { - return DisemblWS; - } - if (servName.equalsIgnoreCase(GlobPlotWS.toString())) { - return GlobPlotWS; + return null; + } + + public static Services getService(Class> runnerClassName) { + assert runnerClassName != null; + String sname = runnerClassName.getSimpleName().toLowerCase(); + for (Services service : Services.values()) { + if (service.toString().toLowerCase().contains(sname)) { + return service; + } } return null; }