1 /* Copyright (c) 2009 Peter Troshin
\r
3 * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0
\r
5 * This library is free software; you can redistribute it and/or modify it under the terms of the
\r
6 * Apache License version 2 as published by the Apache Software Foundation
\r
8 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
\r
9 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Apache
\r
10 * License for more details.
\r
12 * A copy of the license is in apache_license.txt. It is also available here:
\r
13 * @see: http://www.apache.org/licenses/LICENSE-2.0.txt
\r
15 * Any republication or derived work distributed in source code form
\r
16 * must include this copyright and license notice.
\r
19 package compbio.ws.client;
\r
21 import java.net.URL;
\r
23 import javax.xml.namespace.QName;
\r
24 import javax.xml.ws.Service;
\r
26 import compbio.data.msa.Annotation;
\r
27 import compbio.data.msa.JABAService;
\r
28 import compbio.data.msa.MsaWS;
\r
31 * List of web services currently supported by JABAWS version 2
\r
34 public enum Services {
\r
35 MafftWS, MuscleWS, ClustalWS, TcoffeeWS, ProbconsWS, AAConWS;
\r
37 public static Services getService(String servName) {
\r
38 servName = servName.trim().toLowerCase();
\r
39 if (servName.equalsIgnoreCase(MafftWS.toString())) {
\r
42 if (servName.equalsIgnoreCase(ClustalWS.toString())) {
\r
45 if (servName.equalsIgnoreCase(TcoffeeWS.toString())) {
\r
48 if (servName.equalsIgnoreCase(MuscleWS.toString())) {
\r
51 if (servName.equalsIgnoreCase(ProbconsWS.toString())) {
\r
54 if (servName.equalsIgnoreCase(AAConWS.toString())) {
\r
60 Service getService(URL url, String sqname) {
\r
61 QName qname = new QName(sqname, this.toString());
\r
62 return Service.create(url, qname);
\r
65 JABAService getInterface(Service service) {
\r
66 assert service != null;
\r
68 QName portName = new QName(service.getServiceName().getNamespaceURI(),
\r
69 this.toString() + "Port");
\r
74 return service.getPort(portName, Annotation.class);
\r
76 // deliberate leaking
\r
83 System.out.println("Qname from serv: " + portName);
\r
85 return service.getPort(portName, MsaWS.class);
\r
88 throw new RuntimeException("Should never happened!");
\r