View Javadoc

1   /***
2    * Redistribution and use of this software and associated documentation
3    * ("Software"), with or without modification, are permitted provided
4    * that the following conditions are met:
5    *
6    * 1. Redistributions of source code must retain copyright
7    *    statements and notices.  Redistributions must also contain a
8    *    copy of this document.
9    *
10   * 2. Redistributions in binary form must reproduce the
11   *    above copyright notice, this list of conditions and the
12   *    following disclaimer in the documentation and/or other
13   *    materials provided with the distribution.
14   *
15   * 3. The name "Exolab" must not be used to endorse or promote
16   *    products derived from this Software without prior written
17   *    permission of Exoffice Technologies.  For written permission,
18   *    please contact info@exolab.org.
19   *
20   * 4. Products derived from this Software may not be called "Exolab"
21   *    nor may "Exolab" appear in their names without prior written
22   *    permission of Exoffice Technologies. Exolab is a registered
23   *    trademark of Exoffice Technologies.
24   *
25   * 5. Due credit should be given to the Exolab Project
26   *    (http://www.exolab.org/).
27   *
28   * THIS SOFTWARE IS PROVIDED BY EXOFFICE TECHNOLOGIES AND CONTRIBUTORS
29   * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
30   * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
31   * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
32   * EXOFFICE TECHNOLOGIES OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
33   * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
35   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
37   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
38   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
39   * OF THE POSSIBILITY OF SUCH DAMAGE.
40   *
41   * Copyright 2000-2004 (C) Exoffice Technologies Inc. All Rights Reserved.
42   *
43   * $Id: RemoteJmsAdminConnectionIfc.java,v 1.1 2004/11/26 01:51:01 tanderson Exp $
44   */
45  package org.exolab.jms.server.net;
46  
47  import java.rmi.RemoteException;
48  import java.util.Vector;
49  
50  
51  /***
52   * This specifies all the administration methods that can be used to control
53   * the JMS server through an RMI connector. The control logic is all at the
54   * org.exolab.jms.server package level
55   *
56   * @version     $Revision: 1.1 $ $Date: 2004/11/26 01:51:01 $
57   * @author      <a href="mailto:jima@comware.com.au">Jim Alateras</a>
58   */
59  public interface RemoteJmsAdminConnectionIfc {
60  
61      /***
62       * Add a consumer for the specified topic
63       *
64       * @param       topic               name of the destination
65       * @param       name                name of the consumer
66       * @return      boolean             true if successful
67       * @throws RemoteException if the connection cannot be created
68       */
69      boolean addDurableConsumer(String topic, String name)
70          throws RemoteException;
71  
72      /***
73       * Remove the consumer attached to the specified destination and with
74       * the passed in name
75       *
76       * @param       name                name of the consumer
77       * @return      boolean             true if successful
78       * @throws RemoteException if the connection cannot be created
79       */
80      boolean removeDurableConsumer(String name) throws RemoteException;
81  
82      /***
83       * Check if a durable consumer, with the specified name, already exists
84       *
85       * @param       name                name of the consumer
86       * @return      boolean             true if it exists
87       * @throws RemoteException if the connection cannot be created
88       */
89      boolean durableConsumerExists(String name) throws RemoteException;
90  
91      /***
92       * Return the collection of durable consumer names for a particular
93       * topic destination.
94       *
95       * @param       destination          the destination name
96       * @return      Vector              collection of strings
97       * @throws RemoteException if the connection cannot be created
98       */
99      Vector getDurableConsumers(String destination) throws RemoteException;
100 
101     /***
102      * Deactivate an active persistent consumer.
103      *
104      * @param       name                name of the consumer
105      * @return      boolean             true if successful
106      * @throws RemoteException if the consumer cannot be unregistered
107      */
108     boolean unregisterConsumer(String name) throws RemoteException;
109 
110     /***
111      * Check to see if the given consumer is currently connected to the
112      * OpenJMSServer. This is only valid when in online mode.
113      *
114      * @param name The name of the onsumer.
115      * @return boolean True if the consumer is connected.
116      * @throws RemoteException if the connection cannot be created
117      */
118     boolean isConnected(String name) throws RemoteException;
119 
120     /***
121      * Add a specific destination with the specified name
122      *
123      * @param       destination                destination name
124      * @param       queue               whether it is queue or a topic
125      * @return      boolean             true if successful
126      * @throws RemoteException if the connection cannot be created
127      */
128     boolean addDestination(String destination, Boolean queue)
129         throws RemoteException;
130 
131     /***
132      * Destroy the specified destination and all associated messsages and
133      * consumers. This is a very dangerous operation to execute while there
134      * are clients online
135      *
136      * @param       name         destination to destroy
137      * @return boolean           if the destination got destroyed
138      * @throws RemoteException if the connection cannot be created
139      */
140     boolean removeDestination(String name) throws RemoteException;
141 
142     /***
143      * Determine whether the destination with the specified name exists
144      *
145      * @param  name - the destination to check
146      * @return boolean - if the destination exists
147      * @throws RemoteException if the connection cannot be created
148      */
149     boolean destinationExists(String name) throws RemoteException;
150 
151     /***
152      * Return a list of all registered destinations.
153      *
154      * @return      Vector              collection of strings
155      * @throws RemoteException if the connection cannot be created
156      */
157     Vector getAllDestinations() throws RemoteException;
158 
159     /***
160      * Return the number of outstanding messages for a particular destination.
161      *
162      * @param       topic                name of the topic
163      * @param       name                durable consumer name
164      * @return      int                 message count
165      * @throws RemoteException if the connection cannot be created
166      */
167     int getDurableConsumerMessageCount(String topic, String name)
168         throws RemoteException;
169 
170     /***
171      * Return the number of outstanding messages for a particular queue.
172      *
173      * @param       queue               the queue name
174      * @return      int                 message count
175      * @throws RemoteException if the connection cannot be created
176      */
177     int getQueueMessageCount(String queue) throws RemoteException;
178 
179     /***
180      * Purge all processed messages from the database
181      *
182      * @return      int                 the number of purged messages
183      * @throws RemoteException if the connection cannot be created
184      */
185     int purgeMessages() throws RemoteException;
186 
187     /***
188      * Terminate the JMS Server. If it is running as a standalone application
189      * then exit the application. It is running as an embedded application then
190      * just terminate the thread
191      * @throws RemoteException if the connection cannot be created
192      */
193     void stopServer() throws RemoteException;
194 
195 
196     /***
197      * Add a user with the specified name
198      *
199      * @param username    the users name
200      * @param password    the users password
201      * @return <code>true</code> if the user is added
202      * otherwise <code>false</code>
203      * @throws RemoteException if the connection cannot be created
204      */
205     boolean addUser(String username, String password) throws RemoteException;
206 
207     /***
208      * Change password for the specified user
209      *
210      * @param username    the users name
211      * @param password    the users password
212      * @return <code>true</code> if the password is changed
213      * otherwise <code>false</code>
214      * @throws RemoteException if the connection cannot be created
215      */
216     boolean changePassword(String username, String password)
217         throws RemoteException;
218 
219     /***
220      * Remove the specified user
221      *
222      * @param username    the users name
223      * @return <code>true</code> if the user is removed
224      * otherwise <code>false</code>
225      * @throws RemoteException if the connection cannot be created
226      */
227     boolean removeUser(String username) throws RemoteException;
228 
229     /***
230      * Return a list of all registered users.
231      *
232      * @return Vector of users
233      * @throws RemoteException if the connection cannot be created
234      */
235     Vector getAllUsers() throws RemoteException;
236 
237 }