2 * Copyright (C) 2009 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.api
.service
.lsid
;
12 import java
.util
.Date
;
13 import java
.util
.Enumeration
;
16 import javax
.wsdl
.Binding
;
17 import javax
.wsdl
.Definition
;
18 import javax
.wsdl
.Port
;
19 import javax
.wsdl
.WSDLException
;
20 import javax
.xml
.transform
.Source
;
22 import com
.ibm
.lsid
.LSIDException
;
23 import com
.ibm
.lsid
.wsdl
.LSIDAuthorityPort
;
24 import com
.ibm
.lsid
.wsdl
.LSIDDataPort
;
25 import com
.ibm
.lsid
.wsdl
.LSIDMetadataPort
;
26 import com
.ibm
.lsid
.wsdl
.LSIDPort
;
27 import com
.ibm
.lsid
.wsdl
.LSIDStandardPort
;
29 * An interface extracted from com.ibm.lsid.wsdl.LSIDWSDLWrapper which allows
30 * different implementations of LSIDWSDLWrapper
32 * @author Ben Szekely (<a href="mailto:bhszekel@us.ibm.com">bhszekel@us.ibm.com</a>)
35 * @see com.ibm.lsid.wsdl.LSIDWSDLWrapper
37 public interface LSIDWSDLWrapper
{
39 * Get the WSDL Definition
40 * @return the WSDL Definition as a javax.xml.transform.Source object
41 * @throws WSDLException
43 public Source
getWSDLSource() throws WSDLException
;
47 * @return String get the String representation of the WSDL
49 public String
getWSDL();
53 * @return String the String representation of the WSDL
55 public String
toString();
58 * Get the Defintion built by wsdl4j.
59 * @return javax.wsdl.Definition the WSDL Definition
61 public Definition
getDefinition();
64 * Returns the expiration.
65 * @return Date null value
67 public Date
getExpiration();
70 * Sets the expiration.
71 * @param expiration The expiration to set
73 public void setExpiration(Date expiration
);
76 * Get the names of the services. All metadata ports in a given service must be the same.
77 * the client may assume that all the authorative metadata may be obtained by requesting
78 * one port from each service.
79 * @return Enumeration the service names
81 public Enumeration
<String
> getServiceNames();
84 * Get the keys of all the metadata ports
85 * @return Enumeration an Enumeration of Strings of the form "serviceName:portName"
87 public Enumeration
<String
> getMetadataPortNames();
90 * Get the keys of all the metadata ports in the given service
91 * @param String the service
92 * @return LSIDMetadataPort the port
94 public Enumeration
<String
> getMetadataPortNamesForService(String servicename
);
97 * Get the keys of all the metadata ports for the given protocol
98 * @param String the protocol
99 * @return Enumeration an Enumeration of Strings of the form "serviceName:portName"
101 public Enumeration
<String
> getMetadataPortNamesForProtocol(String protocol
);
104 * Get an arbitrary metadata port if one exists.
105 * @return LSIDMetadataPort a metadata port if one exits, null otherwise. Uses protocol preference order: HTTP, FTP, ANY
107 public LSIDMetadataPort
getMetadataPort();
110 * Get the metadata port with the given key
111 * @param String the key of the port, of the form "serviceName:portName"
112 * @return LSIDMetadataPort, the metadata port
114 public LSIDMetadataPort
getMetadataPort(String name
);
117 * Get an arbitray metadata port for the given protocol
118 * @param String the protocol
119 * @return LSIDMetadataPort, the metadata port if one exists, null otherwise.
121 public LSIDMetadataPort
getMetadataPortForProtocol(String protocol
);
124 * Get the keys of all the metadata ports
125 * @return Enumeration an Enumeration of Strings of the form "serviceName:portName"
127 public Enumeration
<String
> getDataPortNames();
130 * Get the keys of all the ports for the given protocol
131 * @param String the protocol
132 * @return Enumeration an Enumeration of Strings of the form "serviceName:portName"
134 public Enumeration
<String
> getDataPortNamesForProtocol(String protocol
);
137 * Get an arbitrary data port if one exists.
138 * @return LSIDDataPort a data port if one exits, null otherwise. Uses protocol preference order: HTTP, FTP, ANY
140 public LSIDDataPort
getDataPort();
143 * Get the data port with the given key
144 * @param String the key of the port, of the form "serviceName:portName"
145 * @return LSIDDataPort, the data port
147 public LSIDDataPort
getDataPort(String name
);
150 * Get an arbitray data port for the given protocol
151 * @param String the protocol
152 * @return LSIDDataPort, the data port if one exists, null otherwise.
154 public LSIDDataPort
getDataPortForProtocol(String protocol
);
157 * Get the keys of all the authority ports
158 * @return Enumeration an Enumeration of Strings of the form "serviceName:portName"
160 public Enumeration
<String
> getAuthorityPortNames();
163 * Get the keys of all the authority ports for the given protocol
164 * @param String the protocol
165 * @return Enumeration an Enumeration of Strings of the form "serviceName:portName"
167 public Enumeration
<String
> getAuthorityPortNamesForProtocol(String protocol
);
170 * Get an arbitrary authority port if one exists.
171 * @return LSIDAuthorityPort an authority port if one exits, null otherwise. Uses protocol preference order: HTTP, SOAP
173 public LSIDAuthorityPort
getAuthorityPort();
176 * Get the authority port with the given key
177 * @param String the key of the port, of the form "serviceName:portName"
178 * @return LSIDAuthorityPort, the authority port
180 public LSIDAuthorityPort
getAuthorityPort(String name
);
183 * Get an arbitray authority port for the given protocol
184 * @param String the protocol
185 * @return LSIDAuthorityPort, the authority port if one exists, null otherwise.
187 public LSIDAuthorityPort
getAuthorityPortForProtocol(String protocol
);
190 * Get all the names of extension port names
191 * @return Enumeration an enum of strings, each string can be used as a key for <code>getExtensionPort()</code>
193 public Enumeration
<String
> getExtensionPortNames();
196 * Get all the names of extension ports for a given LSIDPort implementation
197 * @param Class a specific implementation of LSIDPort for which we would like all the ports
198 * @return Enumeration an enum of strings, each string can be used as a key for <code>getExtensionPort()</code>
200 public Enumeration
<String
> getExtensionPortNamesByClass(Class portClass
);
203 * Get the given extension port
204 * @param String the key of the port, of the form "serviceName:portName"
205 * @return LSIDPort the port
207 public LSIDPort
getExtensionPort(String name
);
210 * Set the authority location.
211 * @param LSIDAuthorityPort the the location of the metadata to set
213 void setAuthorityLocation(LSIDAuthorityPort lsidAuthorityPort
) throws LSIDException
;
216 * Set the location at which data may be retrieved
217 * @param LSIDDataPort the the location of the data to set
219 void setDataLocation(LSIDDataPort lsidDataPort
) throws LSIDException
;
222 * Set the location at which metadata may be retrieved and queried
223 * @param LSIDMetadataPort the the location of the metadata to set
225 void setMetadataLocation(LSIDMetadataPort lsidMetadataPort
) throws LSIDException
;
228 * Updates the string representation of the WSDL. This should be called if the WSDL Definition changes
230 public Map
<String
, LSIDPort
> getWSDLExtensionPorts();
233 * get the name of a key for a port
235 public String
getPortKey(LSIDPort port
);
238 * Create a port for the given binding, protocol, hostname, port and name.
239 * In the case of some protocols, the hostname might be the entire endpoing, (for SOAP this is the case).
240 * If the portname is null, then a default name for the given protocol is chosen.
242 public Port
createPort(Binding binding
, LSIDStandardPort port
);