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