KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > petals > jbi > registry > Registry


1 /**
2  * PETALS - PETALS Services Platform.
3  * Copyright (c) 2005 Fossil E-Commerce, http://www.fossilec.com/
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * -------------------------------------------------------------------------
19  * $Id: Registry.java 597 2006-06-13 09:57:29Z alouis $
20  * -------------------------------------------------------------------------
21  */

22 package org.objectweb.petals.jbi.registry;
23
24 import java.util.List JavaDoc;
25
26 import javax.jbi.servicedesc.ServiceEndpoint;
27 import javax.naming.Context JavaDoc;
28 import javax.xml.namespace.QName JavaDoc;
29
30 /**
31  * The registry is used to manage the endpoint storage
32  *
33  * @version $Rev: 597 $ $Date: 2006-06-13 11:57:29 +0200 (mar., 13 juin 2006) $
34  * @since Petals 1.0
35  * @author alouis,Rafael Marins, ddesjardins
36  */

37 public interface Registry {
38
39     /**
40      * Clean the new endpoints context
41      *
42      * @throws RegistryException
43      * if a problem occurs
44      */

45     void cleanNewEndpoints() throws RegistryException;
46
47     /**
48      * Unregister a connection
49      *
50      * @param connection
51      * connection to unregistered; must be non null
52      * @throws RegistryException
53      * if the connection was not previously registered
54      */

55     void deregisterConnection(LinkedEndpoint connection)
56         throws RegistryException;
57
58     /**
59      * Deregister the given external endpoint.
60      *
61      * @param externalEndpoint
62      * the external endpoint to be deregistered; must be non-null
63      * @throws RegistryException
64      * if the endpoint was not previously registered
65      */

66     void deregisterExternalEndpoint(ServiceEndpoint externalEndpoint)
67         throws RegistryException;
68
69     /**
70      * Deactivates the given endpoint
71      *
72      * @param endpoint
73      * the endpoint to be deactivated; must be non null
74      * @throws RegistryException
75      * if the endpoint was not previously registered
76      */

77     void deregisterInternalEndpoint(AbstractEndpoint endpoint)
78         throws RegistryException;
79
80     /**
81      * Get the external service endpoint for the named activated endpoint, if
82      * any
83      *
84      * @param service
85      * qualified name of the endpoint's service; must be non null
86      * @param name
87      * name of the endpoint; must be non null
88      * @return the named external endpoint, or null if the named endpoint is not
89      * activated
90      */

91     AbstractEndpoint getExternalEndpoint(QName JavaDoc service, String JavaDoc name)
92         throws RegistryException;
93
94     /**
95      * Queries for external endpoints that implements the given interface
96      *
97      * @param interfaceName
98      * qualified name of the interface that contains the endpoints
99      * @return Array of external endpoints
100      *
101      * Array of external endpoints that implements the qualified interface, if
102      * the interface name is non null
103      *
104      * Array of all the external endpoints, if the interface name is null
105      *
106      * @throws RegistryException
107      * if a problem occurs
108      */

109     AbstractEndpoint[] getExternalEndpointsForInterface(QName JavaDoc interfaceName)
110         throws RegistryException;
111
112     /**
113      * Queries for external endpoints that are part of the given service
114      *
115      * @param serviceName
116      * qualified name of the service that contains the endpoints;
117      * must be non null
118      *
119      * @return array of available external endpoints for the specified service
120      * name; must be non null; may be empty
121      *
122      */

123     AbstractEndpoint[] getExternalEndpointsForService(QName JavaDoc serviceName);
124
125     /**
126      * Get the internal service endpoint for the named activated endpoint, if
127      * any. if the endpoint is a link, resolve it and return the real endpoint
128      *
129      * @param service
130      * qualified name of the endpoint's service; must be non null
131      * @param name
132      * name of the endpoint; must be non null
133      * @return the named internal endpoint, or null if the named endpoint is not
134      * activated
135      */

136     AbstractEndpoint getInternalEndpoint(QName JavaDoc service, String JavaDoc name)
137         throws RegistryException;
138
139     /**
140      * Get the internal service endpoint for the named activated endpoint, if
141      * any
142      *
143      * @param service
144      * qualified name of the endpoint's service; must be non null
145      * @param name
146      * name of the endpoint; must be non null
147      * @param resolveLink
148      * if the Endpoint is a link, resolve it (true) or return the
149      * link (false)
150      * @return the named internal endpoint, or null if the named endpoint is not
151      * activated
152      */

153     AbstractEndpoint getInternalEndpoint(QName JavaDoc service, String JavaDoc name,
154             boolean resolveLink) throws RegistryException;
155
156     /**
157      * Queries for internal endpoints that implements the given interface
158      *
159      * @param interfaceName
160      * qualified name of the interface that contains the endpoints
161      * @return Array of internal endpoints
162      *
163      * Array of internal endpoints that implements the qualified interface, if
164      * the interface name is non null
165      *
166      * Array of all the external endpoints, if the interface name is null
167      *
168      * @throws RegistryException
169      * if a problem occurs
170      */

171     AbstractEndpoint[] getInternalEndpointsForInterface(QName JavaDoc interfaceName)
172         throws RegistryException;
173
174     /**
175      * Queries for internal endpoints that are part of the given service
176      *
177      * @param serviceName
178      * qualified name of the service that contains the endpoints;
179      * must be non null
180      *
181      * @return array of available internal endpoints for the specified service
182      * name; must be non null; may be empty
183      *
184      */

185     AbstractEndpoint[] getInternalEndpointsForService(QName JavaDoc serviceName);
186
187     /**
188      * Retrieve the users context that is used by components
189      *
190      * @return the users JNDI context
191      */

192     Context JavaDoc getUsersContext();
193
194     /**
195      * Register a connection
196      *
197      * @param connection
198      * connection to registered; must be non null
199      * @throws RegistryException
200      * if the connection has already been registered or if a problem
201      * occurs
202      */

203     void registerConnection(LinkedEndpoint connection) throws RegistryException;
204
205     /**
206      * Register the given external endpoint
207      *
208      * @param externalEndpoint
209      * the external endpoint to be registered; must be non null
210      * @throws RegistryException
211      * if an external endpoint with the same name is already
212      * registered
213      */

214     void registerExternalEndpoint(ServiceEndpoint externalEndpoint)
215         throws RegistryException;
216
217     /**
218      * Register the given external endpoint
219      *
220      * @param externalEndpoint
221      * the external endpoint to be registered; must be non null
222      * @throws RegistryException
223      * if an external endpoint with the same name is already
224      * registered
225      */

226     void registerInternalEndpoint(AbstractEndpoint endpoint)
227         throws RegistryException;
228
229     /**
230      * Retreive the list of all the new endpoints
231      *
232      * @return list of new endpoints
233      * @throws RegistryException
234      * if a problem occurs
235      */

236     List JavaDoc<AbstractEndpoint> retrieveNewEndpoints() throws RegistryException;
237
238     /**
239      * Update the endpoint, remove it from the new-endpoint context and update
240      * the interfaces context
241      *
242      * @param endpoint
243      * endpoint to validate; must be non null
244      * @throws RegistryException
245      * if a problem occurs
246      */

247     void validateEndpoint(AbstractEndpoint endpoint) throws RegistryException;
248
249 }
250
Popular Tags