update author list in license for (JAL-826)
[jalview.git] / src / ext / vamsas / SeqSearchServiceLocator.java
1 /*\r
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)\r
3  * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle\r
4  * \r
5  * This file is part of Jalview.\r
6  * \r
7  * Jalview is free software: you can redistribute it and/or\r
8  * modify it under the terms of the GNU General Public License \r
9  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\r
10  * \r
11  * Jalview is distributed in the hope that it will be useful, but \r
12  * WITHOUT ANY WARRANTY; without even the implied warranty \r
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR \r
14  * PURPOSE.  See the GNU General Public License for more details.\r
15  * \r
16  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.\r
17  */\r
18 package ext.vamsas;\r
19 \r
20 public class SeqSearchServiceLocator extends org.apache.axis.client.Service\r
21         implements ext.vamsas.SeqSearchServiceService\r
22 {\r
23 \r
24   public SeqSearchServiceLocator()\r
25   {\r
26   }\r
27 \r
28   public SeqSearchServiceLocator(org.apache.axis.EngineConfiguration config)\r
29   {\r
30     super(config);\r
31   }\r
32 \r
33   // Use to get a proxy class for ScanPSService\r
34   private java.lang.String ScanPSService_address = "http://localhost:8080/TestJWS/services/ScanPSService";\r
35 \r
36   public java.lang.String getSeqSeachServiceAddress()\r
37   {\r
38     return ScanPSService_address;\r
39   }\r
40 \r
41   // The WSDD service name defaults to the port name.\r
42   private java.lang.String ScanPSServiceWSDDServiceName = "ScanPSService";\r
43 \r
44   public java.lang.String getScanPSServiceWSDDServiceName()\r
45   {\r
46     return ScanPSServiceWSDDServiceName;\r
47   }\r
48 \r
49   public void setScanPSServiceWSDDServiceName(java.lang.String name)\r
50   {\r
51     ScanPSServiceWSDDServiceName = name;\r
52   }\r
53 \r
54   public ext.vamsas.SeqSearchI getSeqSearchService()\r
55           throws javax.xml.rpc.ServiceException\r
56   {\r
57     java.net.URL endpoint;\r
58     try\r
59     {\r
60       endpoint = new java.net.URL(ScanPSService_address);\r
61     } catch (java.net.MalformedURLException e)\r
62     {\r
63       throw new javax.xml.rpc.ServiceException(e);\r
64     }\r
65     return getSeqSearchService(endpoint);\r
66   }\r
67 \r
68   public ext.vamsas.SeqSearchI getSeqSearchService(java.net.URL portAddress)\r
69           throws javax.xml.rpc.ServiceException\r
70   {\r
71     try\r
72     {\r
73       ext.vamsas.SeqSearchServiceSoapBindingStub _stub = new ext.vamsas.SeqSearchServiceSoapBindingStub(\r
74               portAddress, this);\r
75       _stub.setPortName(getScanPSServiceWSDDServiceName());\r
76       return _stub;\r
77     } catch (org.apache.axis.AxisFault e)\r
78     {\r
79       return null;\r
80     }\r
81   }\r
82 \r
83   public void setScanPSServiceEndpointAddress(java.lang.String address)\r
84   {\r
85     ScanPSService_address = address;\r
86   }\r
87 \r
88   /**\r
89    * For the given interface, get the stub implementation. If this service has\r
90    * no port for the given interface, then ServiceException is thrown.\r
91    */\r
92   public java.rmi.Remote getPort(Class serviceEndpointInterface)\r
93           throws javax.xml.rpc.ServiceException\r
94   {\r
95     try\r
96     {\r
97       if (ext.vamsas.SeqSearchI.class\r
98               .isAssignableFrom(serviceEndpointInterface))\r
99       {\r
100         ext.vamsas.SeqSearchServiceSoapBindingStub _stub = new ext.vamsas.SeqSearchServiceSoapBindingStub(\r
101                 new java.net.URL(ScanPSService_address), this);\r
102         _stub.setPortName(getScanPSServiceWSDDServiceName());\r
103         return _stub;\r
104       }\r
105     } catch (java.lang.Throwable t)\r
106     {\r
107       throw new javax.xml.rpc.ServiceException(t);\r
108     }\r
109     throw new javax.xml.rpc.ServiceException(\r
110             "There is no stub implementation for the interface:  "\r
111                     + (serviceEndpointInterface == null ? "null"\r
112                             : serviceEndpointInterface.getName()));\r
113   }\r
114 \r
115   /**\r
116    * For the given interface, get the stub implementation. If this service has\r
117    * no port for the given interface, then ServiceException is thrown.\r
118    */\r
119   public java.rmi.Remote getPort(javax.xml.namespace.QName portName,\r
120           Class serviceEndpointInterface)\r
121           throws javax.xml.rpc.ServiceException\r
122   {\r
123     if (portName == null)\r
124     {\r
125       return getPort(serviceEndpointInterface);\r
126     }\r
127     java.lang.String inputPortName = portName.getLocalPart();\r
128     if ("ScanPSService".equals(inputPortName))\r
129     {\r
130       return getSeqSearchService();\r
131     }\r
132     else\r
133     {\r
134       java.rmi.Remote _stub = getPort(serviceEndpointInterface);\r
135       ((org.apache.axis.client.Stub) _stub).setPortName(portName);\r
136       return _stub;\r
137     }\r
138   }\r
139 \r
140   public javax.xml.namespace.QName getServiceName()\r
141   {\r
142     return new javax.xml.namespace.QName("vamsas", "ScanPSServiceService");\r
143   }\r
144 \r
145   private java.util.HashSet ports = null;\r
146 \r
147   public java.util.Iterator getPorts()\r
148   {\r
149     if (ports == null)\r
150     {\r
151       ports = new java.util.HashSet();\r
152       ports.add(new javax.xml.namespace.QName("vamsas", "ScanPSService"));\r
153     }\r
154     return ports.iterator();\r
155   }\r
156 \r
157   /**\r
158    * Set the endpoint address for the specified port name.\r
159    */\r
160   public void setEndpointAddress(java.lang.String portName,\r
161           java.lang.String address) throws javax.xml.rpc.ServiceException\r
162   {\r
163     if ("ScanPSService".equals(portName))\r
164     {\r
165       setScanPSServiceEndpointAddress(address);\r
166     }\r
167     else\r
168     { // Unknown Port Name\r
169       throw new javax.xml.rpc.ServiceException(\r
170               " Cannot set Endpoint Address for Unknown Port" + portName);\r
171     }\r
172   }\r
173 \r
174   /**\r
175    * Set the endpoint address for the specified port name.\r
176    */\r
177   public void setEndpointAddress(javax.xml.namespace.QName portName,\r
178           java.lang.String address) throws javax.xml.rpc.ServiceException\r
179   {\r
180     setEndpointAddress(portName.getLocalPart(), address);\r
181   }\r
182 \r
183 }\r