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