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