apply jalview code style
[jalview.git] / src / ext / vamsas / MuscleWSSoapBindingStub.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
3  * Copyright (C) 2010 J Procter, AM Waterhouse, 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 /*
19  * Jalview - A Sequence Alignment Editor and Viewer
20  * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
21  *
22  * This program is free software; you can redistribute it and/or
23  * modify it under the terms of the GNU General Public License
24  * as published by the Free Software Foundation; either version 2
25  * of the License, or (at your option) any later version.
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30  * GNU General Public License for more details.
31  *
32  * You should have received a copy of the GNU General Public License
33  * along with this program; if not, write to the Free Software
34  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
35  */
36 package ext.vamsas;
37
38 public class MuscleWSSoapBindingStub extends org.apache.axis.client.Stub
39         implements ext.vamsas.MuscleWS
40 {
41   static org.apache.axis.description.OperationDesc[] _operations;
42
43   static
44   {
45     _operations = new org.apache.axis.description.OperationDesc[4];
46     _initOperationDesc1();
47   }
48
49   private java.util.Vector cachedSerClasses = new java.util.Vector();
50
51   private java.util.Vector cachedSerQNames = new java.util.Vector();
52
53   private java.util.Vector cachedSerFactories = new java.util.Vector();
54
55   private java.util.Vector cachedDeserFactories = new java.util.Vector();
56
57   public MuscleWSSoapBindingStub() throws org.apache.axis.AxisFault
58   {
59     this(null);
60   }
61
62   public MuscleWSSoapBindingStub(java.net.URL endpointURL,
63           javax.xml.rpc.Service service) throws org.apache.axis.AxisFault
64   {
65     this(service);
66     super.cachedEndpoint = endpointURL;
67   }
68
69   public MuscleWSSoapBindingStub(javax.xml.rpc.Service service)
70           throws org.apache.axis.AxisFault
71   {
72     if (service == null)
73     {
74       super.service = new org.apache.axis.client.Service();
75     }
76     else
77     {
78       super.service = service;
79     }
80
81     java.lang.Class cls;
82     javax.xml.namespace.QName qName;
83     java.lang.Class beansf = org.apache.axis.encoding.ser.BeanSerializerFactory.class;
84     java.lang.Class beandf = org.apache.axis.encoding.ser.BeanDeserializerFactory.class;
85     // java.lang.Class enumsf =
86     // org.apache.axis.encoding.ser.EnumSerializerFactory.class;
87     // java.lang.Class enumdf =
88     // org.apache.axis.encoding.ser.EnumDeserializerFactory.class;
89     java.lang.Class arraysf = org.apache.axis.encoding.ser.ArraySerializerFactory.class;
90     java.lang.Class arraydf = org.apache.axis.encoding.ser.ArrayDeserializerFactory.class;
91     // java.lang.Class simplesf =
92     // org.apache.axis.encoding.ser.SimpleSerializerFactory.class;
93     // java.lang.Class simpledf =
94     // org.apache.axis.encoding.ser.SimpleDeserializerFactory.class;
95     // java.lang.Class simplelistsf =
96     // org.apache.axis.encoding.ser.SimpleListSerializerFactory.class;
97     // java.lang.Class simplelistdf =
98     // org.apache.axis.encoding.ser.SimpleListDeserializerFactory.class;
99     qName = new javax.xml.namespace.QName("simple.objects.vamsas",
100             "Sequence");
101     cachedSerQNames.add(qName);
102     cls = vamsas.objects.simple.Sequence.class;
103     cachedSerClasses.add(cls);
104     cachedSerFactories.add(beansf);
105     cachedDeserFactories.add(beandf);
106
107     qName = new javax.xml.namespace.QName("vamsas", "ArrayOf_tns1_Sequence");
108     cachedSerQNames.add(qName);
109     cls = vamsas.objects.simple.Sequence[].class;
110     cachedSerClasses.add(cls);
111     cachedSerFactories.add(arraysf);
112     cachedDeserFactories.add(arraydf);
113
114     qName = new javax.xml.namespace.QName("simple.objects.vamsas",
115             "MsaResult");
116     cachedSerQNames.add(qName);
117     cls = vamsas.objects.simple.MsaResult.class;
118     cachedSerClasses.add(cls);
119     cachedSerFactories.add(beansf);
120     cachedDeserFactories.add(beandf);
121
122     qName = new javax.xml.namespace.QName("simple.objects.vamsas",
123             "SequenceSet");
124     cachedSerQNames.add(qName);
125     cls = vamsas.objects.simple.SequenceSet.class;
126     cachedSerClasses.add(cls);
127     cachedSerFactories.add(beansf);
128     cachedDeserFactories.add(beandf);
129
130     qName = new javax.xml.namespace.QName("http://simple.objects.vamsas",
131             "Object");
132     cachedSerQNames.add(qName);
133     cls = vamsas.objects.simple.Object.class;
134     cachedSerClasses.add(cls);
135     cachedSerFactories.add(beansf);
136     cachedDeserFactories.add(beandf);
137
138     qName = new javax.xml.namespace.QName("simple.objects.vamsas",
139             "Alignment");
140     cachedSerQNames.add(qName);
141     cls = vamsas.objects.simple.Alignment.class;
142     cachedSerClasses.add(cls);
143     cachedSerFactories.add(beansf);
144     cachedDeserFactories.add(beandf);
145
146     qName = new javax.xml.namespace.QName("simple.objects.vamsas",
147             "WsJobId");
148     cachedSerQNames.add(qName);
149     cls = vamsas.objects.simple.WsJobId.class;
150     cachedSerClasses.add(cls);
151     cachedSerFactories.add(beansf);
152     cachedDeserFactories.add(beandf);
153
154     qName = new javax.xml.namespace.QName("vamsas", "ArrayOf_xsd_string");
155     cachedSerQNames.add(qName);
156     cls = java.lang.String[].class;
157     cachedSerClasses.add(cls);
158     cachedSerFactories.add(arraysf);
159     cachedDeserFactories.add(arraydf);
160
161     qName = new javax.xml.namespace.QName("simple.objects.vamsas", "Result");
162     cachedSerQNames.add(qName);
163     cls = vamsas.objects.simple.Result.class;
164     cachedSerClasses.add(cls);
165     cachedSerFactories.add(beansf);
166     cachedDeserFactories.add(beandf);
167   }
168
169   private static void _initOperationDesc1()
170   {
171     org.apache.axis.description.OperationDesc oper;
172     oper = new org.apache.axis.description.OperationDesc();
173     oper.setName("align");
174     oper.addParameter(new javax.xml.namespace.QName("", "seqSet"),
175             new javax.xml.namespace.QName("simple.objects.vamsas",
176                     "SequenceSet"),
177             vamsas.objects.simple.SequenceSet.class,
178             org.apache.axis.description.ParameterDesc.IN, false, false);
179     oper.setReturnType(new javax.xml.namespace.QName(
180             "simple.objects.vamsas", "WsJobId"));
181     oper.setReturnClass(vamsas.objects.simple.WsJobId.class);
182     oper.setReturnQName(new javax.xml.namespace.QName("", "alignReturn"));
183     oper.setStyle(org.apache.axis.constants.Style.RPC);
184     oper.setUse(org.apache.axis.constants.Use.ENCODED);
185     _operations[0] = oper;
186
187     oper = new org.apache.axis.description.OperationDesc();
188     oper.setName("getalign");
189     oper.addParameter(new javax.xml.namespace.QName("", "job_id"),
190             new javax.xml.namespace.QName(
191                     "http://www.w3.org/2001/XMLSchema", "string"),
192             java.lang.String.class,
193             org.apache.axis.description.ParameterDesc.IN, false, false);
194     oper.setReturnType(new javax.xml.namespace.QName(
195             "simple.objects.vamsas", "Alignment"));
196     oper.setReturnClass(vamsas.objects.simple.Alignment.class);
197     oper.setReturnQName(new javax.xml.namespace.QName("", "getalignReturn"));
198     oper.setStyle(org.apache.axis.constants.Style.RPC);
199     oper.setUse(org.apache.axis.constants.Use.ENCODED);
200     _operations[1] = oper;
201
202     oper = new org.apache.axis.description.OperationDesc();
203     oper.setName("getResult");
204     oper.addParameter(new javax.xml.namespace.QName("", "job_id"),
205             new javax.xml.namespace.QName(
206                     "http://www.w3.org/2001/XMLSchema", "string"),
207             java.lang.String.class,
208             org.apache.axis.description.ParameterDesc.IN, false, false);
209     oper.setReturnType(new javax.xml.namespace.QName(
210             "simple.objects.vamsas", "MsaResult"));
211     oper.setReturnClass(vamsas.objects.simple.MsaResult.class);
212     oper.setReturnQName(new javax.xml.namespace.QName("", "getResultReturn"));
213     oper.setStyle(org.apache.axis.constants.Style.RPC);
214     oper.setUse(org.apache.axis.constants.Use.ENCODED);
215     _operations[2] = oper;
216
217     oper = new org.apache.axis.description.OperationDesc();
218     oper.setName("cancel");
219     oper.addParameter(new javax.xml.namespace.QName("", "jobId"),
220             new javax.xml.namespace.QName(
221                     "http://www.w3.org/2001/XMLSchema", "string"),
222             java.lang.String.class,
223             org.apache.axis.description.ParameterDesc.IN, false, false);
224     oper.setReturnType(new javax.xml.namespace.QName(
225             "simple.objects.vamsas", "WsJobId"));
226     oper.setReturnClass(vamsas.objects.simple.WsJobId.class);
227     oper.setReturnQName(new javax.xml.namespace.QName("", "cancelReturn"));
228     oper.setStyle(org.apache.axis.constants.Style.RPC);
229     oper.setUse(org.apache.axis.constants.Use.ENCODED);
230     _operations[3] = oper;
231   }
232
233   protected org.apache.axis.client.Call createCall()
234           throws java.rmi.RemoteException
235   {
236     try
237     {
238       org.apache.axis.client.Call _call = (org.apache.axis.client.Call) super.service
239               .createCall();
240
241       if (super.maintainSessionSet)
242       {
243         _call.setMaintainSession(super.maintainSession);
244       }
245
246       if (super.cachedUsername != null)
247       {
248         _call.setUsername(super.cachedUsername);
249       }
250
251       if (super.cachedPassword != null)
252       {
253         _call.setPassword(super.cachedPassword);
254       }
255
256       if (super.cachedEndpoint != null)
257       {
258         _call.setTargetEndpointAddress(super.cachedEndpoint);
259       }
260
261       if (super.cachedTimeout != null)
262       {
263         _call.setTimeout(super.cachedTimeout);
264       }
265
266       if (super.cachedPortName != null)
267       {
268         _call.setPortName(super.cachedPortName);
269       }
270
271       java.util.Enumeration keys = super.cachedProperties.keys();
272
273       while (keys.hasMoreElements())
274       {
275         java.lang.String key = (java.lang.String) keys.nextElement();
276         _call.setProperty(key, super.cachedProperties.get(key));
277       }
278
279       // All the type mapping information is registered
280       // when the first call is made.
281       // The type mapping information is actually registered in
282       // the TypeMappingRegistry of the service, which
283       // is the reason why registration is only needed for the first call.
284       synchronized (this)
285       {
286         if (firstCall())
287         {
288           // must set encoding style before registering serializers
289           _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
290           _call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC);
291
292           for (int i = 0; i < cachedSerFactories.size(); ++i)
293           {
294             java.lang.Class cls = (java.lang.Class) cachedSerClasses.get(i);
295             javax.xml.namespace.QName qName = (javax.xml.namespace.QName) cachedSerQNames
296                     .get(i);
297             java.lang.Class sf = (java.lang.Class) cachedSerFactories
298                     .get(i);
299             java.lang.Class df = (java.lang.Class) cachedDeserFactories
300                     .get(i);
301             _call.registerTypeMapping(cls, qName, sf, df, false);
302           }
303         }
304       }
305
306       return _call;
307     } catch (java.lang.Throwable _t)
308     {
309       throw new org.apache.axis.AxisFault(
310               "Failure trying to get the Call object", _t);
311     }
312   }
313
314   public vamsas.objects.simple.WsJobId align(
315           vamsas.objects.simple.SequenceSet seqSet)
316           throws java.rmi.RemoteException
317   {
318     if (super.cachedEndpoint == null)
319     {
320       throw new org.apache.axis.NoEndPointException();
321     }
322
323     org.apache.axis.client.Call _call = createCall();
324     _call.setOperation(_operations[0]);
325     _call.setUseSOAPAction(true);
326     _call.setSOAPActionURI("");
327     _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
328     _call.setOperationName(new javax.xml.namespace.QName("vamsas", "align"));
329
330     setRequestHeaders(_call);
331     setAttachments(_call);
332
333     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
334     { seqSet });
335
336     if (_resp instanceof java.rmi.RemoteException)
337     {
338       throw (java.rmi.RemoteException) _resp;
339     }
340     else
341     {
342       extractAttachments(_call);
343
344       try
345       {
346         return (vamsas.objects.simple.WsJobId) _resp;
347       } catch (java.lang.Exception _exception)
348       {
349         return (vamsas.objects.simple.WsJobId) org.apache.axis.utils.JavaUtils
350                 .convert(_resp, vamsas.objects.simple.WsJobId.class);
351       }
352     }
353   }
354
355   public vamsas.objects.simple.Alignment getalign(java.lang.String job_id)
356           throws java.rmi.RemoteException
357   {
358     if (super.cachedEndpoint == null)
359     {
360       throw new org.apache.axis.NoEndPointException();
361     }
362
363     org.apache.axis.client.Call _call = createCall();
364     _call.setOperation(_operations[1]);
365     _call.setUseSOAPAction(true);
366     _call.setSOAPActionURI("");
367     _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
368     _call.setOperationName(new javax.xml.namespace.QName("vamsas",
369             "getalign"));
370
371     setRequestHeaders(_call);
372     setAttachments(_call);
373
374     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
375     { job_id });
376
377     if (_resp instanceof java.rmi.RemoteException)
378     {
379       throw (java.rmi.RemoteException) _resp;
380     }
381     else
382     {
383       extractAttachments(_call);
384
385       try
386       {
387         return (vamsas.objects.simple.Alignment) _resp;
388       } catch (java.lang.Exception _exception)
389       {
390         return (vamsas.objects.simple.Alignment) org.apache.axis.utils.JavaUtils
391                 .convert(_resp, vamsas.objects.simple.Alignment.class);
392       }
393     }
394   }
395
396   public vamsas.objects.simple.MsaResult getResult(java.lang.String job_id)
397           throws java.rmi.RemoteException
398   {
399     if (super.cachedEndpoint == null)
400     {
401       throw new org.apache.axis.NoEndPointException();
402     }
403
404     org.apache.axis.client.Call _call = createCall();
405     _call.setOperation(_operations[2]);
406     _call.setUseSOAPAction(true);
407     _call.setSOAPActionURI("");
408     _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
409     _call.setOperationName(new javax.xml.namespace.QName("vamsas",
410             "getResult"));
411
412     setRequestHeaders(_call);
413     setAttachments(_call);
414
415     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
416     { job_id });
417
418     if (_resp instanceof java.rmi.RemoteException)
419     {
420       throw (java.rmi.RemoteException) _resp;
421     }
422     else
423     {
424       extractAttachments(_call);
425
426       try
427       {
428         return (vamsas.objects.simple.MsaResult) _resp;
429       } catch (java.lang.Exception _exception)
430       {
431         return (vamsas.objects.simple.MsaResult) org.apache.axis.utils.JavaUtils
432                 .convert(_resp, vamsas.objects.simple.MsaResult.class);
433       }
434     }
435   }
436
437   public vamsas.objects.simple.WsJobId cancel(java.lang.String jobId)
438           throws java.rmi.RemoteException
439   {
440     if (super.cachedEndpoint == null)
441     {
442       throw new org.apache.axis.NoEndPointException();
443     }
444
445     org.apache.axis.client.Call _call = createCall();
446     _call.setOperation(_operations[3]);
447     _call.setUseSOAPAction(true);
448     _call.setSOAPActionURI("");
449     _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
450     _call.setOperationName(new javax.xml.namespace.QName("vamsas", "cancel"));
451
452     setRequestHeaders(_call);
453     setAttachments(_call);
454
455     java.lang.Object _resp = _call.invoke(new java.lang.Object[]
456     { jobId });
457
458     if (_resp instanceof java.rmi.RemoteException)
459     {
460       throw (java.rmi.RemoteException) _resp;
461     }
462     else
463     {
464       extractAttachments(_call);
465
466       try
467       {
468         return (vamsas.objects.simple.WsJobId) _resp;
469       } catch (java.lang.Exception _exception)
470       {
471         return (vamsas.objects.simple.WsJobId) org.apache.axis.utils.JavaUtils
472                 .convert(_resp, vamsas.objects.simple.WsJobId.class);
473       }
474     }
475   }
476 }