KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > petals > jbi > management > service > EndpointService


1 /**
2  * PETALS - PETALS Services Platform.
3  * Copyright (c) 2005 EBM Websourcing, http://www.ebmwebsourcing.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: EndpointService.java 11:27:27 ddesjardins $
20  * -------------------------------------------------------------------------
21  */

22 package org.objectweb.petals.jbi.management.service;
23
24 import javax.jbi.JBIException;
25 import javax.jbi.messaging.MessageExchange;
26 import javax.jbi.servicedesc.ServiceEndpoint;
27 import javax.xml.namespace.QName JavaDoc;
28
29 import org.objectweb.petals.jbi.registry.AbstractEndpoint;
30 import org.objectweb.petals.jbi.registry.ConsumerEndpoint;
31 import org.objectweb.petals.jbi.registry.InternalEndpoint;
32 import org.w3c.dom.Document JavaDoc;
33
34 /**
35  * This class is used to manage everything that deals with endpoint in the
36  * distributed environment
37  *
38  * @author ddesjardins - eBMWebsourcing
39  */

40 public interface EndpointService {
41
42     /**
43      * Activates the named entpoint
44      *
45      * @param serviceName
46      * qualified name of the service endpoint; must be non null
47      * @param endpointName
48      * the name of the endpoint to be activated; must be non null
49      * @param address
50      * the consumer endpoint; must be non null
51      * @return internal endpoint
52      * @throws JBIException
53      * if a problem occurs in the registry
54      */

55     InternalEndpoint activateEndpoint(QName JavaDoc serviceName, String JavaDoc endpointName,
56         ConsumerEndpoint address) throws JBIException;
57
58     /**
59      * Register a connection
60      *
61      * @param consInterface
62      * consumer interface name; must be non null
63      * @param provService
64      * provider service name; must be non null
65      * @param provEndpoint
66      * provider endpoint name; must be non null
67      * @throws JBIException
68      * if a problem occurs in the registry
69      */

70     void createConnection(QName JavaDoc consInterface, QName JavaDoc provService,
71         String JavaDoc provEndpoint) throws JBIException;
72
73     /**
74      * Register a connection
75      *
76      * @param consService
77      * consumer service name; must be non null
78      * @param consEndpoint
79      * consumer endpoint name; must be non null
80      * @param provService
81      * provider service name; must be non null
82      * @param provEndpoint
83      * provider endpoint name; must be non null
84      * @throws JBIException
85      * if a problem occurs in the registry
86      */

87     void createConnection(QName JavaDoc consService, String JavaDoc consEndpoint,
88         QName JavaDoc provService, String JavaDoc provEndpoint) throws JBIException;
89
90     /**
91      * Deactivates the given endpoint
92      *
93      * @param endpoint
94      * endpoint to be deactivated; must be non null
95      * @throws JBIException
96      * if the endpoint cannot be deactivated
97      */

98     void deactivateEndpoint(ServiceEndpoint endpoint) throws JBIException;
99
100     /**
101      * Delete a connection
102      *
103      * @param consInterface
104      * consumer interface name; must be non null
105      * @param provService
106      * provider service name; must be non null
107      * @param provEndpoint
108      * provider endpoint name; must be non null
109      * @throws JBIException
110      * if the connection can not be deleted
111      */

112     void deleteConnection(QName JavaDoc consInterface, QName JavaDoc provService,
113         String JavaDoc provEndpoint) throws JBIException;
114
115     /**
116      * Delete a connection
117      *
118      * @param consService
119      * consumer service name; must be non null
120      * @param consEndpoint
121      * consumer endpoint name; must be non null
122      *
123      * @param provService
124      * provider service name; must be non null
125      * @param provEndpoint
126      * provider endpoint name; must be non null
127      * @throws JBIException
128      * if the connection can not be deleted
129      */

130     void deleteConnection(QName JavaDoc consService, String JavaDoc consEndpoint,
131         QName JavaDoc provService, String JavaDoc provEndpoint) throws JBIException;
132
133     /**
134      * Deregister external endpoint
135      *
136      * @param endpoint
137      * external to be deregistered; must be non null
138      * @throws JBIException
139      * if the endpoint cannot be deregistered
140      */

141     void deregisterExternalEndpoint(ServiceEndpoint endpoint)
142         throws JBIException;
143
144     /**
145      * Get the service endpoint for the named activated endpoint, if any.
146      * if the endpoint is a link, resolve it and return the real endpoint
147      * @param service
148      * qualified name of the endpoint's service; must be non null
149      * @param name
150      * name of the endpoint; must be non null
151      * @return the named endpoint, or null if the named endpoint is not
152      * activated
153      */

154     ServiceEndpoint getEndpoint(QName JavaDoc service, String JavaDoc name);
155
156     /**
157      * Get the service endpoint for the named activated endpoint, if any
158      *
159      * @param service
160      * qualified name of the endpoint's service; must be non null
161      * @param name
162      * name of the endpoint; must be non null
163      * @param resolveLink
164      * if the Endpoint is a link, resolve it (true) or return the link (false)
165      * @return the named endpoint, or null if the named endpoint is not
166      * activated
167      */

168     ServiceEndpoint getEndpoint(QName JavaDoc service, String JavaDoc name,boolean resolveLink);
169
170     /**
171      * Return the descriptor for a specified endpoint
172      *
173      * @param endpoint
174      * endpoint on which we want to retrieve the descriptor; must be
175      * non null
176      * @return Document metadata describing the endpoint, or null if metadata is
177      * unavailable
178      */

179     Document JavaDoc getEndpointDescriptorForEndpoint(ServiceEndpoint endpoint)
180         throws JBIException;
181
182     /**
183      * Queries the registry for external endpoints that implements the given
184      * interface name
185      *
186      * @param interfaceName
187      * qualified name of interface implemented by the endpoints; must
188      * be non null
189      * @return an array of availabe endpoints for the specified interface name;
190      * must be non null, may be empy
191      */

192     ServiceEndpoint[] getExternalEndpointsForInterface(QName JavaDoc interfaceName);
193
194     /**
195      * Queries the registry for external endpoints that are part of the given
196      * service name
197      *
198      * @param serviceName
199      * qualified name of service that contains endpoints; must be non
200      * null
201      * @return an array of availabe endpoints for the specified service name;
202      * must be non null, may be empy
203      */

204     ServiceEndpoint[] getExternalEndpointsForService(QName JavaDoc serviceName);
205
206     /**
207      * Return the interfaces for the specified endpoint
208      *
209      * @param endpoint
210      * endpoint on which we want to retrieve the interface names;
211      * must be non null
212      * @return Array of interfaces QName
213      */

214     QName JavaDoc[] getInterfacesForEndpoint(AbstractEndpoint endpoint);
215
216     /**
217      * Queries the registry for active endpoints that implements the given
218      * interface
219      *
220      * @param interfaceName
221      * qualified interface/portType that is implementsed by the
222      * endpoints; if null then all activated endpoints in the JBI
223      * environement must be returned
224      * @return an array of available endpoints for the specified interface name;
225      * must be non null, may be empty
226      */

227     ServiceEndpoint[] getInternalEndpointsForInterface(QName JavaDoc interfaceName);
228
229     /**
230      * Queries the registry for active endpoints belonging to the given service
231      *
232      * @param serviceName
233      * qualified name of the service that the endpoints are part of;
234      * must be non null
235      * @return an array of available endpoints for the specified service name;
236      * must be non null, may be empty
237      */

238     ServiceEndpoint[] getInternalEndpointsForService(QName JavaDoc serviceName);
239
240     /**
241      * Query a component to check if it is ready to accept the exchange as a
242      * consumer
243      *
244      * @param internalEndpoint
245      * the endpoint to be used by the consumer; must be non null
246      * @param exchange
247      * the proposed message exchange to be perfomed; must be non null
248      * @return true if the provider component can perform the given exchange
249      * with the described consumer
250      */

251     boolean isExchangeWithConsumerOkayForComponent(
252         InternalEndpoint internalEndpoint, MessageExchange exchange);
253
254     /**
255      * Query a component to check if it is ready to accept the exchange as a
256      * provider
257      *
258      * @param internalEndpoint
259      * the endpoint to be used by the provider; must be non null
260      * @param exchange
261      * the message exchange that is to be performed
262      * @return true if this consumer component can interact with the described
263      * provider to perform the given exchange
264      */

265     boolean isExchangeWithProviderOkayForComponent(
266         InternalEndpoint internalEndpoint, MessageExchange exchange);
267
268     /**
269      * Register this given external endpoint
270      *
271      * @param externalEndpoint
272      * the external endpoint to be registered; must be non null
273      * @throws JBIException
274      * if an external endpoint wit the same name is already
275      * registered
276      */

277     void registerExternalEndpoint(ServiceEndpoint externalEndpoint)
278         throws JBIException;
279
280     /**
281      * Check if the container where the endpoint is registered is started
282      *
283      * @param endpoint
284      * target endpoint; must be non null
285      * @return true if the container where the endpoint is registered is
286      * started; false if the container is stopped or if a problem occurs
287      */

288     boolean isContainerStarted(AbstractEndpoint endpoint);
289
290 }
291
Popular Tags