X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=webservices%2Fcompbio%2Fws%2Fclient%2FServices.java;h=a0c1f56ae3f61ad4feef1369b009e0b11ae64eb9;hb=3644426ec0e9e9ceb798bd426085d8d9dd8dbb56;hp=95a0a891678c6c22e332f2461d092a5fc18158c0;hpb=6e1c873d0879f462b1fb1a1efa444cf993a9e76a;p=jabaws.git diff --git a/webservices/compbio/ws/client/Services.java b/webservices/compbio/ws/client/Services.java index 95a0a89..a0c1f56 100644 --- a/webservices/compbio/ws/client/Services.java +++ b/webservices/compbio/ws/client/Services.java @@ -23,16 +23,16 @@ import java.net.URL; import javax.xml.namespace.QName; import javax.xml.ws.Service; -import compbio.data.msa.Annotation; import compbio.data.msa.JABAService; import compbio.data.msa.MsaWS; +import compbio.data.msa.SequenceAnnotation; /** * List of web services currently supported by JABAWS version 2 * */ public enum Services { - MafftWS, MuscleWS, ClustalWS, TcoffeeWS, ProbconsWS, AAConWS; + MafftWS, MuscleWS, ClustalWS, TcoffeeWS, ProbconsWS, AAConWS, JronnWS, DisemblWS, GlobPlotWS; public static Services getService(String servName) { servName = servName.trim().toLowerCase(); @@ -54,6 +54,15 @@ public enum Services { 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; } @@ -62,16 +71,15 @@ public enum Services { return Service.create(url, qname); } - JABAService getInterface(Service service) { - assert service != null; - - QName portName = new QName(service.getServiceName().getNamespaceURI(), - this.toString() + "Port"); - + Class getServiceType() { switch (this) { + // deliberate leaking case AAConWS : + case JronnWS : + case DisemblWS : + case GlobPlotWS : - return service.getPort(portName, Annotation.class); + return SequenceAnnotation.class; // deliberate leaking case ClustalWS : @@ -79,13 +87,19 @@ public enum Services { case MuscleWS : case ProbconsWS : case TcoffeeWS : - // TODO remove - System.out.println("Qname from serv: " + portName); - - return service.getPort(portName, MsaWS.class); + return MsaWS.class; default : - throw new RuntimeException("Should never happened!"); + throw new RuntimeException("Unrecognised Web Service Type " + + this + " - Should never happened!"); } } + + JABAService getInterface(Service service) { + assert service != null; + + QName portName = new QName(service.getServiceName().getNamespaceURI(), + this.toString() + "Port"); + return service.getPort(portName, this.getServiceType()); + } } \ No newline at end of file