applied copyright 2008
[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 implements ext.vamsas.SeqSearchServiceService {\r
22 \r
23     public SeqSearchServiceLocator() {\r
24     }\r
25 \r
26 \r
27     public SeqSearchServiceLocator(org.apache.axis.EngineConfiguration config) {\r
28         super(config);\r
29     }\r
30 \r
31     // Use to get a proxy class for ScanPSService\r
32     private java.lang.String ScanPSService_address = "http://localhost:8080/TestJWS/services/ScanPSService";\r
33 \r
34     public java.lang.String getSeqSeachServiceAddress() {\r
35         return ScanPSService_address;\r
36     }\r
37 \r
38     // The WSDD service name defaults to the port name.\r
39     private java.lang.String ScanPSServiceWSDDServiceName = "ScanPSService";\r
40 \r
41     public java.lang.String getScanPSServiceWSDDServiceName() {\r
42         return ScanPSServiceWSDDServiceName;\r
43     }\r
44 \r
45     public void setScanPSServiceWSDDServiceName(java.lang.String name) {\r
46         ScanPSServiceWSDDServiceName = name;\r
47     }\r
48 \r
49     public ext.vamsas.SeqSearchI getSeqSearchService() throws javax.xml.rpc.ServiceException {\r
50        java.net.URL endpoint;\r
51         try {\r
52             endpoint = new java.net.URL(ScanPSService_address);\r
53         }\r
54         catch (java.net.MalformedURLException e) {\r
55             throw new javax.xml.rpc.ServiceException(e);\r
56         }\r
57         return getSeqSearchService(endpoint);\r
58     }\r
59 \r
60     public ext.vamsas.SeqSearchI getSeqSearchService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException {\r
61         try {\r
62             ext.vamsas.SeqSearchServiceSoapBindingStub _stub = new ext.vamsas.SeqSearchServiceSoapBindingStub(portAddress, this);\r
63             _stub.setPortName(getScanPSServiceWSDDServiceName());\r
64             return _stub;\r
65         }\r
66         catch (org.apache.axis.AxisFault e) {\r
67             return null;\r
68         }\r
69     }\r
70 \r
71     public void setScanPSServiceEndpointAddress(java.lang.String address) {\r
72         ScanPSService_address = address;\r
73     }\r
74 \r
75     /**\r
76      * For the given interface, get the stub implementation.\r
77      * If this service has no port for the given interface,\r
78      * then ServiceException is thrown.\r
79      */\r
80     public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {\r
81         try {\r
82             if (ext.vamsas.SeqSearchI.class.isAssignableFrom(serviceEndpointInterface)) {\r
83                 ext.vamsas.SeqSearchServiceSoapBindingStub _stub = new ext.vamsas.SeqSearchServiceSoapBindingStub(new java.net.URL(ScanPSService_address), this);\r
84                 _stub.setPortName(getScanPSServiceWSDDServiceName());\r
85                 return _stub;\r
86             }\r
87         }\r
88         catch (java.lang.Throwable t) {\r
89             throw new javax.xml.rpc.ServiceException(t);\r
90         }\r
91         throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));\r
92     }\r
93 \r
94     /**\r
95      * For the given interface, get the stub implementation.\r
96      * If this service has no port for the given interface,\r
97      * then ServiceException is thrown.\r
98      */\r
99     public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {\r
100         if (portName == null) {\r
101             return getPort(serviceEndpointInterface);\r
102         }\r
103         java.lang.String inputPortName = portName.getLocalPart();\r
104         if ("ScanPSService".equals(inputPortName)) {\r
105             return getSeqSearchService();\r
106         }\r
107         else  {\r
108             java.rmi.Remote _stub = getPort(serviceEndpointInterface);\r
109             ((org.apache.axis.client.Stub) _stub).setPortName(portName);\r
110             return _stub;\r
111         }\r
112     }\r
113 \r
114     public javax.xml.namespace.QName getServiceName() {\r
115         return new javax.xml.namespace.QName("vamsas", "ScanPSServiceService");\r
116     }\r
117 \r
118     private java.util.HashSet ports = null;\r
119 \r
120     public java.util.Iterator getPorts() {\r
121         if (ports == null) {\r
122             ports = new java.util.HashSet();\r
123             ports.add(new javax.xml.namespace.QName("vamsas", "ScanPSService"));\r
124         }\r
125         return ports.iterator();\r
126     }\r
127 \r
128     /**\r
129     * Set the endpoint address for the specified port name.\r
130     */\r
131     public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\r
132         if ("ScanPSService".equals(portName)) {\r
133             setScanPSServiceEndpointAddress(address);\r
134         }\r
135         else { // Unknown Port Name\r
136             throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);\r
137         }\r
138     }\r
139 \r
140     /**\r
141     * Set the endpoint address for the specified port name.\r
142     */\r
143     public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException {\r
144         setEndpointAddress(portName.getLocalPart(), address);\r
145     }\r
146 \r
147 }\r