1 /**
2 * Copyright 2005-2006 the original author or authors.
3 *
4 * Licensed under the Gnu General Pubic License, Version 2.0 (the
5 * "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/gpl-license.php
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the Gnu General Public License for more details.
14 */
15 package org.figure8.join.services.remoting;
16
17 import org.figure8.join.core.InfrastructureException;
18 import org.figure8.join.core.DuplicateEntityException;
19 import org.figure8.join.core.InvalidParameterException;
20 import org.figure8.join.services.remoting.beans.RemoteJMSConsumerBeanInfo;
21
22 import java.rmi.RemoteException;
23 /**
24 * Remote service interface definition. This service allows to interact
25 * with server-side JMS consumers : retrieving them, saving them (thus
26 * activation / deactivation) and removing them. All this services require
27 * authentication through the usage of the <code>login()</code> method.
28 * The security token returned by this method should then be used as a
29 * parameter of every service call.
30 *
31 * @author <a href="mailto:laurent.broudoux@free.fr">Laurent Broudoux</a>
32 * @version $Revision: 1.1 $
33 */
34 public interface MessagingService extends AuthenticatedService{
35
36
37
38 /**
39 * Save a JMSConsumerBean infos within datastore. This method should also
40 * control the status of eventually existing consumers, depending on <b>active</b>
41 * attribute of the info bean.
42 * @param token Authentication token provided earlier by login() method
43 * @param info The info on a JMSConsumerBean to save
44 * @throws InvalidSessionException if user has no valid session on server-side
45 * @throws InvalidParameterException if consumer bean java class is not valid
46 * @throws DuplicateEntityException if another consumer with same name already exists.
47 * @throws InfrastructureException if wrapped JCA container cannot activate consumer.
48 * @throws RemoteException if an exception occurs during the remote conversation
49 */
50 public abstract void saveConsumerBeanInfo(String token, RemoteJMSConsumerBeanInfo info) throws InvalidSessionException,
51 InvalidParameterException, DuplicateEntityException, InfrastructureException, RemoteException;
52
53 /**
54 * Remove a JMSConsumerBean infos from datastore. This method should also
55 * stop existing consumer instances before removing the related informations.
56 * @param token Authentication token provided earlier by login() method
57 * @param name The name of the JMSConsumerBean to remove
58 * @throws InvalidSessionException if user has no valid session on server-side
59 * @throws RemoteException if an exception occurs during the remote conversation
60 */
61 public abstract void removeConsumerBeanInfo(String token, String name) throws InvalidSessionException, RemoteException;
62
63 /**
64 * Retrieve the info object having the specified name (or null if none).
65 * @param token Authentication token provided earlier by login() method
66 * @param name The name of consumer bean information to retrieve
67 * @throws InvalidSessionException if user has no valid session on server-side
68 * @throws RemoteException if an exception occurs during the remote conversation
69 * @return The corresponding {@link RemoteJMSConsumerBeanInfo} object, or null if none
70 */
71 public abstract RemoteJMSConsumerBeanInfo getConsumerBeanInfo(String token, String name) throws InvalidSessionException, RemoteException;
72
73 /**
74 * Retrieve the info object corresponding to available <code>JMSConsumerBeans</code>.
75 * @param token Authentication token provided earlier by login() method
76 * @throws InvalidSessionException if user has no valid session on server-side
77 * @throws RemoteException if an exception occurs during the remote conversation
78 * @return An array of {@link RemoteJMSConsumerBeanInfo} objects.
79 */
80 public abstract RemoteJMSConsumerBeanInfo[] getConsumerBeanInfos(String token) throws InvalidSessionException, RemoteException;
81 }