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