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