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