ref #10222 add agentlink to taxonNodeAgentRelDto
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / lsid / LSIDWSDLWrapper.java
1 /**
2 * Copyright (C) 2009 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
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.
8 */
9
10 package eu.etaxonomy.cdm.api.service.lsid;
11
12 import java.util.Date;
13 import java.util.Enumeration;
14 import java.util.Map;
15
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;
21
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;
28 /**
29 * An interface extracted from com.ibm.lsid.wsdl.LSIDWSDLWrapper which allows
30 * different implementations of LSIDWSDLWrapper
31 *
32 * @author Ben Szekely (<a href="mailto:bhszekel@us.ibm.com">bhszekel@us.ibm.com</a>)
33 * @author ben
34 *
35 * @see com.ibm.lsid.wsdl.LSIDWSDLWrapper
36 */
37 public interface LSIDWSDLWrapper {
38 /**
39 * Get the WSDL Definition
40 * @return the WSDL Definition as a javax.xml.transform.Source object
41 * @throws WSDLException
42 */
43 public Source getWSDLSource() throws WSDLException;
44
45 /**
46 * Get the WSDL String
47 * @return String get the String representation of the WSDL
48 */
49 public String getWSDL();
50
51 /**
52 * Get the WSDL String
53 * @return String the String representation of the WSDL
54 */
55 public String toString();
56
57 /**
58 * Get the Defintion built by wsdl4j.
59 * @return javax.wsdl.Definition the WSDL Definition
60 */
61 public Definition getDefinition();
62
63 /**
64 * Returns the expiration.
65 * @return Date null value
66 */
67 public Date getExpiration();
68
69 /**
70 * Sets the expiration.
71 * @param expiration The expiration to set
72 */
73 public void setExpiration(Date expiration);
74
75 /**
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
80 */
81 public Enumeration<String> getServiceNames();
82
83 /**
84 * Get the keys of all the metadata ports
85 * @return Enumeration an Enumeration of Strings of the form "serviceName:portName"
86 */
87 public Enumeration<String> getMetadataPortNames();
88
89 /**
90 * Get the keys of all the metadata ports in the given service
91 * @param String the service
92 * @return LSIDMetadataPort the port
93 */
94 public Enumeration<String> getMetadataPortNamesForService(String servicename);
95
96 /**
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"
100 */
101 public Enumeration<String> getMetadataPortNamesForProtocol(String protocol);
102
103 /**
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
106 */
107 public LSIDMetadataPort getMetadataPort();
108
109 /**
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
113 */
114 public LSIDMetadataPort getMetadataPort(String name);
115
116 /**
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.
120 */
121 public LSIDMetadataPort getMetadataPortForProtocol(String protocol);
122
123 /**
124 * Get the keys of all the metadata ports
125 * @return Enumeration an Enumeration of Strings of the form "serviceName:portName"
126 */
127 public Enumeration<String> getDataPortNames();
128
129 /**
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"
133 */
134 public Enumeration<String> getDataPortNamesForProtocol(String protocol);
135
136 /**
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
139 */
140 public LSIDDataPort getDataPort();
141
142 /**
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
146 */
147 public LSIDDataPort getDataPort(String name);
148
149 /**
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.
153 */
154 public LSIDDataPort getDataPortForProtocol(String protocol);
155
156 /**
157 * Get the keys of all the authority ports
158 * @return Enumeration an Enumeration of Strings of the form "serviceName:portName"
159 */
160 public Enumeration<String> getAuthorityPortNames();
161
162 /**
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"
166 */
167 public Enumeration<String> getAuthorityPortNamesForProtocol(String protocol);
168
169 /**
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
172 */
173 public LSIDAuthorityPort getAuthorityPort();
174
175 /**
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
179 */
180 public LSIDAuthorityPort getAuthorityPort(String name);
181
182 /**
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.
186 */
187 public LSIDAuthorityPort getAuthorityPortForProtocol(String protocol);
188
189 /**
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>
192 */
193 public Enumeration<String> getExtensionPortNames();
194
195 /**
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>
199 */
200 public Enumeration<String> getExtensionPortNamesByClass(Class portClass);
201
202 /**
203 * Get the given extension port
204 * @param String the key of the port, of the form "serviceName:portName"
205 * @return LSIDPort the port
206 */
207 public LSIDPort getExtensionPort(String name);
208
209 /**
210 * Set the authority location.
211 * @param LSIDAuthorityPort the the location of the metadata to set
212 */
213 void setAuthorityLocation(LSIDAuthorityPort lsidAuthorityPort) throws LSIDException;
214
215 /**
216 * Set the location at which data may be retrieved
217 * @param LSIDDataPort the the location of the data to set
218 */
219 void setDataLocation(LSIDDataPort lsidDataPort) throws LSIDException;
220
221 /**
222 * Set the location at which metadata may be retrieved and queried
223 * @param LSIDMetadataPort the the location of the metadata to set
224 */
225 void setMetadataLocation(LSIDMetadataPort lsidMetadataPort) throws LSIDException;
226
227 /**
228 * Updates the string representation of the WSDL. This should be called if the WSDL Definition changes
229 */
230 public Map<String, LSIDPort> getWSDLExtensionPorts();
231
232 /**
233 * get the name of a key for a port
234 */
235 public String getPortKey(LSIDPort port);
236
237 /**
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.
241 */
242 public Port createPort(Binding binding, LSIDStandardPort port);
243 }