update author list in license for (JAL-826)
[jalview.git] / src / ext / vamsas / MuscleWSServiceLocator.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3  * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, 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 ext.vamsas;
19
20 public class MuscleWSServiceLocator extends org.apache.axis.client.Service
21         implements ext.vamsas.MuscleWSService
22 {
23   // Use to get a proxy class for MuscleWS
24   private java.lang.String MuscleWS_address = "http://anaplog.compbio.dundee.ac.uk:8080/axis/services/MuscleWS";
25
26   // The WSDD service name defaults to the port name.
27   private java.lang.String MuscleWSWSDDServiceName = "MuscleWS";
28
29   private java.util.HashSet ports = null;
30
31   public MuscleWSServiceLocator()
32   {
33   }
34
35   public MuscleWSServiceLocator(org.apache.axis.EngineConfiguration config)
36   {
37     super(config);
38   }
39
40   public java.lang.String getMuscleWSAddress()
41   {
42     return MuscleWS_address;
43   }
44
45   public java.lang.String getMuscleWSWSDDServiceName()
46   {
47     return MuscleWSWSDDServiceName;
48   }
49
50   public void setMuscleWSWSDDServiceName(java.lang.String name)
51   {
52     MuscleWSWSDDServiceName = name;
53   }
54
55   public ext.vamsas.MuscleWS getMuscleWS()
56           throws javax.xml.rpc.ServiceException
57   {
58     java.net.URL endpoint;
59
60     try
61     {
62       endpoint = new java.net.URL(MuscleWS_address);
63     } catch (java.net.MalformedURLException e)
64     {
65       throw new javax.xml.rpc.ServiceException(e);
66     }
67
68     return getMuscleWS(endpoint);
69   }
70
71   public ext.vamsas.MuscleWS getMuscleWS(java.net.URL portAddress)
72           throws javax.xml.rpc.ServiceException
73   {
74     try
75     {
76       ext.vamsas.MuscleWSSoapBindingStub _stub = new ext.vamsas.MuscleWSSoapBindingStub(
77               portAddress, this);
78       _stub.setPortName(getMuscleWSWSDDServiceName());
79
80       return _stub;
81     } catch (org.apache.axis.AxisFault e)
82     {
83       return null;
84     }
85   }
86
87   public void setMuscleWSEndpointAddress(java.lang.String address)
88   {
89     MuscleWS_address = address;
90   }
91
92   /**
93    * For the given interface, get the stub implementation. If this service has
94    * no port for the given interface, then ServiceException is thrown.
95    */
96   public java.rmi.Remote getPort(Class serviceEndpointInterface)
97           throws javax.xml.rpc.ServiceException
98   {
99     try
100     {
101       if (ext.vamsas.MuscleWS.class
102               .isAssignableFrom(serviceEndpointInterface))
103       {
104         ext.vamsas.MuscleWSSoapBindingStub _stub = new ext.vamsas.MuscleWSSoapBindingStub(
105                 new java.net.URL(MuscleWS_address), this);
106         _stub.setPortName(getMuscleWSWSDDServiceName());
107
108         return _stub;
109       }
110     } catch (java.lang.Throwable t)
111     {
112       throw new javax.xml.rpc.ServiceException(t);
113     }
114
115     throw new javax.xml.rpc.ServiceException(
116             "There is no stub implementation for the interface:  "
117                     + ((serviceEndpointInterface == null) ? "null"
118                             : serviceEndpointInterface.getName()));
119   }
120
121   /**
122    * For the given interface, get the stub implementation. If this service has
123    * no port for the given interface, then ServiceException is thrown.
124    */
125   public java.rmi.Remote getPort(javax.xml.namespace.QName portName,
126           Class serviceEndpointInterface)
127           throws javax.xml.rpc.ServiceException
128   {
129     if (portName == null)
130     {
131       return getPort(serviceEndpointInterface);
132     }
133
134     java.lang.String inputPortName = portName.getLocalPart();
135
136     if ("MuscleWS".equals(inputPortName))
137     {
138       return getMuscleWS();
139     }
140     else
141     {
142       java.rmi.Remote _stub = getPort(serviceEndpointInterface);
143       ((org.apache.axis.client.Stub) _stub).setPortName(portName);
144
145       return _stub;
146     }
147   }
148
149   public javax.xml.namespace.QName getServiceName()
150   {
151     return new javax.xml.namespace.QName("vamsas", "MuscleWSService");
152   }
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("vamsas", "MuscleWS"));
160     }
161
162     return ports.iterator();
163   }
164
165   /**
166    * Set the endpoint address for the specified port name.
167    */
168   public void setEndpointAddress(java.lang.String portName,
169           java.lang.String address) throws javax.xml.rpc.ServiceException
170   {
171     if ("MuscleWS".equals(portName))
172     {
173       setMuscleWSEndpointAddress(address);
174     }
175     else
176     { // Unknown Port Name
177       throw new javax.xml.rpc.ServiceException(
178               " Cannot set Endpoint Address for Unknown Port" + portName);
179     }
180   }
181
182   /**
183    * Set the endpoint address for the specified port name.
184    */
185   public void setEndpointAddress(javax.xml.namespace.QName portName,
186           java.lang.String address) throws javax.xml.rpc.ServiceException
187   {
188     setEndpointAddress(portName.getLocalPart(), address);
189   }
190 }