X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=webservices%2Fcompbio%2Fws%2Fclient%2FServices.java;h=893117fab5aa29bf9d7114c9a739a2897bd5dabd;hb=0fe28c8386f1c1d7c7cd09c927693c465f5f1ab2;hp=7f06da7a31e1b47a91b99a5f2d1e43cd3e5deec7;hpb=451b60b868fc003d2b02a6f453461f365eb83f62;p=jabaws.git diff --git a/webservices/compbio/ws/client/Services.java b/webservices/compbio/ws/client/Services.java index 7f06da7..893117f 100644 --- a/webservices/compbio/ws/client/Services.java +++ b/webservices/compbio/ws/client/Services.java @@ -1,6 +1,6 @@ -/* Copyright (c) 2009 Peter Troshin +/* Copyright (c) 2011 Peter Troshin * - * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0 + * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 * * This library is free software; you can redistribute it and/or modify it under the terms of the * Apache License version 2 as published by the Apache Software Foundation @@ -19,6 +19,7 @@ package compbio.ws.client; import java.net.URL; +import java.util.Set; import javax.xml.namespace.QName; import javax.xml.ws.Service; @@ -26,14 +27,17 @@ 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 * */ public enum Services { - MafftWS, MuscleWS, ClustalWS, TcoffeeWS, ProbconsWS, AAConWS, JronnWS, DisemblWS, GlobPlotWS; + /* + * Make sure this class has NO references to runners or engines as it is a + * part of minimal client package. Such things should go into ServicesUtil + */ + MafftWS, MuscleWS, ClustalWS, ClustalOWS, TcoffeeWS, ProbconsWS, AAConWS, JronnWS, DisemblWS, GlobPlotWS, IUPredWS; public static Services getService(String servName) { servName = servName.trim().toLowerCase(); @@ -45,22 +49,24 @@ public enum Services { 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; - } - Service getService(URL url, String sqname) { QName qname = new QName(sqname, this.toString()); return Service.create(url, qname); } + public static String toString(Set services) { + if (services == null || services.isEmpty()) { + return ""; + } + String value = ""; + String delim = ", "; + for (Services serv : services) { + value += serv.toString() + delim; + } + value = value.substring(0, value.length() - delim.length()); + return value; + } + Class getServiceType() { switch (this) { // deliberate leaking @@ -68,11 +74,12 @@ public enum Services { case JronnWS : case DisemblWS : case GlobPlotWS : - + case IUPredWS : return SequenceAnnotation.class; // deliberate leaking case ClustalWS : + case ClustalOWS : case MafftWS : case MuscleWS : case ProbconsWS :