JAL-3438 spotless for 2.11.2.0
[jalview.git] / src / uk / ac / ebi / www / picr / AccessionMappingService / AccessionMapperBindingStub.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $$Year-Rel$$ 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 AccessionMapperBindingStub extends org.apache.axis.client.Stub
24         implements
25         uk.ac.ebi.www.picr.AccessionMappingService.AccessionMapperInterface
26 {
27   private java.util.Vector cachedSerClasses = new java.util.Vector();
28
29   private java.util.Vector cachedSerQNames = new java.util.Vector();
30
31   private java.util.Vector cachedSerFactories = new java.util.Vector();
32
33   private java.util.Vector cachedDeserFactories = new java.util.Vector();
34
35   static org.apache.axis.description.OperationDesc[] _operations;
36
37   static
38   {
39     _operations = new org.apache.axis.description.OperationDesc[3];
40     _initOperationDesc1();
41   }
42
43   private static void _initOperationDesc1()
44   {
45     org.apache.axis.description.OperationDesc oper;
46     oper = new org.apache.axis.description.OperationDesc();
47     oper.setName("getUPIForSequence");
48     oper.addParameter(
49             new javax.xml.namespace.QName(
50                     "http://www.ebi.ac.uk/picr/AccessionMappingService",
51                     "sequence"),
52             new javax.xml.namespace.QName(
53                     "http://www.w3.org/2001/XMLSchema", "string"),
54             java.lang.String.class,
55             org.apache.axis.description.ParameterDesc.IN, false, false);
56     oper.addParameter(
57             new javax.xml.namespace.QName(
58                     "http://www.ebi.ac.uk/picr/AccessionMappingService",
59                     "searchDatabases"),
60             new javax.xml.namespace.QName(
61                     "http://www.w3.org/2001/XMLSchema", "string"),
62             java.lang.String[].class,
63             org.apache.axis.description.ParameterDesc.IN, false, false);
64     oper.addParameter(new javax.xml.namespace.QName(
65             "http://www.ebi.ac.uk/picr/AccessionMappingService", "taxonId"),
66             new javax.xml.namespace.QName(
67                     "http://www.w3.org/2001/XMLSchema", "string"),
68             java.lang.String.class,
69             org.apache.axis.description.ParameterDesc.IN, false, false);
70     oper.addParameter(
71             new javax.xml.namespace.QName(
72                     "http://www.ebi.ac.uk/picr/AccessionMappingService",
73                     "onlyActive"),
74             new javax.xml.namespace.QName(
75                     "http://www.w3.org/2001/XMLSchema", "boolean"),
76             boolean.class, org.apache.axis.description.ParameterDesc.IN,
77             false, false);
78     oper.setReturnType(new javax.xml.namespace.QName(
79             "http://model.picr.ebi.ac.uk", "UPEntry"));
80     oper.setReturnClass(uk.ac.ebi.picr.model.UPEntry.class);
81     oper.setReturnQName(new javax.xml.namespace.QName(
82             "http://www.ebi.ac.uk/picr/AccessionMappingService",
83             "getUPIForSequenceReturn"));
84     oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
85     oper.setUse(org.apache.axis.constants.Use.LITERAL);
86     _operations[0] = oper;
87
88     oper = new org.apache.axis.description.OperationDesc();
89     oper.setName("getUPIForAccession");
90     oper.addParameter(
91             new javax.xml.namespace.QName(
92                     "http://www.ebi.ac.uk/picr/AccessionMappingService",
93                     "accession"),
94             new javax.xml.namespace.QName(
95                     "http://www.w3.org/2001/XMLSchema", "string"),
96             java.lang.String.class,
97             org.apache.axis.description.ParameterDesc.IN, false, false);
98     oper.addParameter(
99             new javax.xml.namespace.QName(
100                     "http://www.ebi.ac.uk/picr/AccessionMappingService",
101                     "ac_version"),
102             new javax.xml.namespace.QName(
103                     "http://www.w3.org/2001/XMLSchema", "string"),
104             java.lang.String.class,
105             org.apache.axis.description.ParameterDesc.IN, false, false);
106     oper.addParameter(
107             new javax.xml.namespace.QName(
108                     "http://www.ebi.ac.uk/picr/AccessionMappingService",
109                     "searchDatabases"),
110             new javax.xml.namespace.QName(
111                     "http://www.w3.org/2001/XMLSchema", "string"),
112             java.lang.String[].class,
113             org.apache.axis.description.ParameterDesc.IN, false, false);
114     oper.addParameter(new javax.xml.namespace.QName(
115             "http://www.ebi.ac.uk/picr/AccessionMappingService", "taxonId"),
116             new javax.xml.namespace.QName(
117                     "http://www.w3.org/2001/XMLSchema", "string"),
118             java.lang.String.class,
119             org.apache.axis.description.ParameterDesc.IN, false, false);
120     oper.addParameter(
121             new javax.xml.namespace.QName(
122                     "http://www.ebi.ac.uk/picr/AccessionMappingService",
123                     "onlyActive"),
124             new javax.xml.namespace.QName(
125                     "http://www.w3.org/2001/XMLSchema", "boolean"),
126             boolean.class, org.apache.axis.description.ParameterDesc.IN,
127             false, false);
128     oper.setReturnType(new javax.xml.namespace.QName(
129             "http://model.picr.ebi.ac.uk", "UPEntry"));
130     oper.setReturnClass(uk.ac.ebi.picr.model.UPEntry[].class);
131     oper.setReturnQName(new javax.xml.namespace.QName(
132             "http://www.ebi.ac.uk/picr/AccessionMappingService",
133             "getUPIForAccessionReturn"));
134     oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
135     oper.setUse(org.apache.axis.constants.Use.LITERAL);
136     _operations[1] = oper;
137
138     oper = new org.apache.axis.description.OperationDesc();
139     oper.setName("getMappedDatabaseNames");
140     oper.setReturnType(new javax.xml.namespace.QName(
141             "http://www.w3.org/2001/XMLSchema", "string"));
142     oper.setReturnClass(java.lang.String[].class);
143     oper.setReturnQName(new javax.xml.namespace.QName(
144             "http://www.ebi.ac.uk/picr/AccessionMappingService",
145             "mappedDatabases"));
146     oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
147     oper.setUse(org.apache.axis.constants.Use.LITERAL);
148     _operations[2] = oper;
149
150   }
151
152   public AccessionMapperBindingStub() throws org.apache.axis.AxisFault
153   {
154     this(null);
155   }
156
157   public AccessionMapperBindingStub(java.net.URL endpointURL,
158           javax.xml.rpc.Service service) throws org.apache.axis.AxisFault
159   {
160     this(service);
161     super.cachedEndpoint = endpointURL;
162   }
163
164   public AccessionMapperBindingStub(javax.xml.rpc.Service service)
165           throws org.apache.axis.AxisFault
166   {
167     if (service == null)
168     {
169       super.service = new org.apache.axis.client.Service();
170     }
171     else
172     {
173       super.service = service;
174     }
175     java.lang.Class cls;
176     javax.xml.namespace.QName qName;
177     java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
178     java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
179     java.lang.Class enumsf = org.apache.axis.encoding.ser.EnumSerializerFactory.class;
180     java.lang.Class enumdf = org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
181     java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class;
182     java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
183     java.lang.Class simplesf = org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
184     java.lang.Class simpledf = org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
185     java.lang.Class simplelistsf = org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
186     java.lang.Class simplelistdf = org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
187     qName = new javax.xml.namespace.QName("http://model.picr.ebi.ac.uk",
188             "UPEntry");
189     cachedSerQNames.add(qName);
190     cls = uk.ac.ebi.picr.model.UPEntry.class;
191     cachedSerClasses.add(cls);
192     cachedSerFactories.add(beansf);
193     cachedDeserFactories.add(beandf);
194
195     qName = new javax.xml.namespace.QName("http://model.picr.ebi.ac.uk",
196             "CrossReference");
197     cachedSerQNames.add(qName);
198     cls = uk.ac.ebi.picr.model.CrossReference.class;
199     cachedSerClasses.add(cls);
200     cachedSerFactories.add(beansf);
201     cachedDeserFactories.add(beandf);
202
203   }
204
205   protected org.apache.axis.client.Call createCall()
206           throws java.rmi.RemoteException
207   {
208     try
209     {
210       org.apache.axis.client.Call _call = (org.apache.axis.client.Call) super.service
211               .createCall();
212       if (super.maintainSessionSet)
213       {
214         _call.setMaintainSession(super.maintainSession);
215       }
216       if (super.cachedUsername != null)
217       {
218         _call.setUsername(super.cachedUsername);
219       }
220       if (super.cachedPassword != null)
221       {
222         _call.setPassword(super.cachedPassword);
223       }
224       if (super.cachedEndpoint != null)
225       {
226         _call.setTargetEndpointAddress(super.cachedEndpoint);
227       }
228       if (super.cachedTimeout != null)
229       {
230         _call.setTimeout(super.cachedTimeout);
231       }
232       if (super.cachedPortName != null)
233       {
234         _call.setPortName(super.cachedPortName);
235       }
236       java.util.Enumeration keys = super.cachedProperties.keys();
237       while (keys.hasMoreElements())
238       {
239         java.lang.String key = (java.lang.String) keys.nextElement();
240         _call.setProperty(key, super.cachedProperties.get(key));
241       }
242       // All the type mapping information is registered
243       // when the first call is made.
244       // The type mapping information is actually registered in
245       // the TypeMappingRegistry of the service, which
246       // is the reason why registration is only needed for the first call.
247       synchronized (this)
248       {
249         if (firstCall())
250         {
251           // must set encoding style before registering serializers
252           _call.setEncodingStyle(null);
253           for (int i = 0; i < cachedSerFactories.size(); ++i)
254           {
255             java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
256             javax.xml.namespace.QName qName = (javax.xml.namespace.QName) cachedSerQNames
257                     .get(i);
258             java.lang.Class sf = (java.lang.Class) cachedSerFactories
259                     .get(i);
260             java.lang.Class df = (java.lang.Class) cachedDeserFactories
261                     .get(i);
262             _call.registerTypeMapping(cls, qName, sf, df, false);
263           }
264         }
265       }
266       return _call;
267     } catch (java.lang.Throwable _t)
268     {
269       throw new org.apache.axis.AxisFault(
270               "Failure trying to get the Call object", _t);
271     }
272   }
273
274   public uk.ac.ebi.picr.model.UPEntry getUPIForSequence(
275           java.lang.String sequence, java.lang.String[] searchDatabases,
276           java.lang.String taxonId, boolean onlyActive)
277           throws java.rmi.RemoteException
278   {
279     if (super.cachedEndpoint == null)
280     {
281       throw new org.apache.axis.NoEndPointException();
282     }
283     org.apache.axis.client.Call _call = createCall();
284     _call.setOperation(_operations[0]);
285     _call.setUseSOAPAction(true);
286     _call.setSOAPActionURI("getUPIForSequence");
287     _call.setEncodingStyle(null);
288     _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR,
289             Boolean.FALSE);
290     _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS,
291             Boolean.FALSE);
292     _call.setSOAPVersion(
293             org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
294     _call.setOperationName(new javax.xml.namespace.QName(
295             "http://www.ebi.ac.uk/picr/AccessionMappingService",
296             "getUPIForSequence"));
297
298     setRequestHeaders(_call);
299     setAttachments(_call);
300     java.lang.Object _resp = _call
301             .invoke(new java.lang.Object[]
302             { sequence, searchDatabases, taxonId,
303                 java.lang.Boolean.valueOf(onlyActive) });
304
305     if (_resp instanceof java.rmi.RemoteException)
306     {
307       throw (java.rmi.RemoteException) _resp;
308     }
309     else
310     {
311       extractAttachments(_call);
312       try
313       {
314         return (uk.ac.ebi.picr.model.UPEntry) _resp;
315       } catch (java.lang.Exception _exception)
316       {
317         return (uk.ac.ebi.picr.model.UPEntry) org.apache.axis.utils.JavaUtils
318                 .convert(_resp, uk.ac.ebi.picr.model.UPEntry.class);
319       }
320     }
321   }
322
323   public uk.ac.ebi.picr.model.UPEntry[] getUPIForAccession(
324           java.lang.String accession, java.lang.String ac_version,
325           java.lang.String[] searchDatabases, java.lang.String taxonId,
326           boolean onlyActive) throws java.rmi.RemoteException
327   {
328     if (super.cachedEndpoint == null)
329     {
330       throw new org.apache.axis.NoEndPointException();
331     }
332     org.apache.axis.client.Call _call = createCall();
333     _call.setOperation(_operations[1]);
334     _call.setUseSOAPAction(true);
335     _call.setSOAPActionURI("getUPIForAccession");
336     _call.setEncodingStyle(null);
337     _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR,
338             Boolean.FALSE);
339     _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS,
340             Boolean.FALSE);
341     _call.setSOAPVersion(
342             org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
343     _call.setOperationName(new javax.xml.namespace.QName(
344             "http://www.ebi.ac.uk/picr/AccessionMappingService",
345             "getUPIForAccession"));
346
347     setRequestHeaders(_call);
348     setAttachments(_call);
349     java.lang.Object _resp = _call
350             .invoke(new java.lang.Object[]
351             { accession, ac_version, searchDatabases, taxonId,
352                 java.lang.Boolean.valueOf(onlyActive) });
353
354     if (_resp instanceof java.rmi.RemoteException)
355     {
356       throw (java.rmi.RemoteException) _resp;
357     }
358     else
359     {
360       extractAttachments(_call);
361       try
362       {
363         return (uk.ac.ebi.picr.model.UPEntry[]) _resp;
364       } catch (java.lang.Exception _exception)
365       {
366         return (uk.ac.ebi.picr.model.UPEntry[]) org.apache.axis.utils.JavaUtils
367                 .convert(_resp, uk.ac.ebi.picr.model.UPEntry[].class);
368       }
369     }
370   }
371
372   public java.lang.String[] getMappedDatabaseNames()
373           throws java.rmi.RemoteException
374   {
375     if (super.cachedEndpoint == null)
376     {
377       throw new org.apache.axis.NoEndPointException();
378     }
379     org.apache.axis.client.Call _call = createCall();
380     _call.setOperation(_operations[2]);
381     _call.setUseSOAPAction(true);
382     _call.setSOAPActionURI("getMappedDatabaseNames");
383     _call.setEncodingStyle(null);
384     _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR,
385             Boolean.FALSE);
386     _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS,
387             Boolean.FALSE);
388     _call.setSOAPVersion(
389             org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
390     _call.setOperationName(new javax.xml.namespace.QName(
391             "http://www.ebi.ac.uk/picr/AccessionMappingService",
392             "getMappedDatabaseNames"));
393
394     setRequestHeaders(_call);
395     setAttachments(_call);
396     java.lang.Object _resp = _call.invoke(new java.lang.Object[] {});
397
398     if (_resp instanceof java.rmi.RemoteException)
399     {
400       throw (java.rmi.RemoteException) _resp;
401     }
402     else
403     {
404       extractAttachments(_call);
405       try
406       {
407         return (java.lang.String[]) _resp;
408       } catch (java.lang.Exception _exception)
409       {
410         return (java.lang.String[]) org.apache.axis.utils.JavaUtils
411                 .convert(_resp, java.lang.String[].class);
412       }
413     }
414   }
415
416 }