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: JmsAdminServerIfc.java,v 1.9.2.1 2004/05/04 01:26:48 tanderson Exp $
44 */
45 package org.exolab.jms.administration;
46
47 import java.util.Vector;
48
49 import javax.jms.JMSException;
50
51
52 /***
53 * This specifies all the administration methods that can be used to control
54 * the JMS server through an RMI connector. The control logic is all at the
55 * org.exolab.jms.server package level
56 * .
57 * @version $Revision: 1.9.2.1 $ $Date: 2004/05/04 01:26:48 $
58 * @author <a href="mailto:jima@exoffice.com">Jim Alateras</a>
59 */
60 public interface JmsAdminServerIfc {
61
62 /***
63 * Return the number of outstanding messages for a particular destination.
64 *
65 * @param topic name of the topic
66 * @param name durable consumer name
67 * @return int message count
68 * @exception JMSException
69 */
70 public int getDurableConsumerMessageCount(String topic, String name)
71 throws JMSException;
72
73 /***
74 * Return the number of outstanding messages for a particular queue.
75 *
76 * @param queue the queue name
77 * @return int message count
78 * @exception JMSException
79 */
80 public int getQueueMessageCount(String queue)
81 throws JMSException;
82
83 /***
84 * Add a durable consumer for the specified name the passed in name
85 *
86 * @param topic name of the destination
87 * @param name name of the consumer
88 * @return boolean true if successful
89 * @exception JMSException
90 */
91 public boolean addDurableConsumer(String topic, String name)
92 throws JMSException;
93
94 /***
95 * Remove the the specified durable consumer
96 *
97 * @param name name of the consumer
98 * @return boolean true if successful
99 * @exception JMSException
100 */
101 public boolean removeDurableConsumer(String name)
102 throws JMSException;
103
104 /***
105 * Check if the specified durable consumer exists
106 *
107 * @param name durable consumer to query
108 * @return boolean true if it exists
109 * @exception JMSException
110 */
111 public boolean durableConsumerExists(String name)
112 throws JMSException;
113
114 /***
115 * Return the collection of durable consumer names for a particular
116 * topic destination.
117 *
118 * @param topic the topic name
119 * @return Vector collection of strings
120 * @exception JMSException
121 */
122 public Vector getDurableConsumers(String destination)
123 throws JMSException;
124
125 /***
126 * De-Activate an active persistent consumer.
127 *
128 * @param name name of the consumer
129 * @return boolean true if successful
130 * @exception JMSException
131 */
132 public boolean unregisterConsumer(String name)
133 throws JMSException;
134
135 /***
136 * Check to see if the given consumer is currently connected to the
137 * OpenJMSServer. This is only valid when in online mode.
138 *
139 * @param name The name of the onsumer.
140 * @return boolean True if the consumer is connected.
141 * @exception JMSException
142 *
143 */
144 public boolean isConnected(String name)
145 throws JMSException;
146
147 /***
148 * Return a list of all registered destinations.
149 *
150 * @return a collection of <code>javax.jms.Destination</code> instances
151 * @exception JMSException
152 */
153 public Vector getAllDestinations()
154 throws JMSException;
155
156 /***
157 * Add a specific destination with the specified name
158 *
159 * @param name destination name
160 * @param queue whether it is queue or a topic
161 * @return boolean true if successful
162 * @exception JMSException
163 */
164 public boolean addDestination(String destination, Boolean queue)
165 throws JMSException;
166
167 /***
168 * Destroy the specified destination and all associated messsages and
169 * consumers. This is a very dangerous operation to execute while there
170 * are clients online
171 *
172 * @param destination destination to destroy
173 * @exception JMSException
174 */
175 public boolean removeDestination(String name)
176 throws JMSException;
177
178 /***
179 * Determine if the specified destination exists
180 *
181 * @param name - the destination to check
182 * @return boolean - true if it exists
183 * @throws JMSException
184 */
185 public boolean destinationExists(String name)
186 throws JMSException;
187
188 /***
189 * Terminate the JMS Server. If it is running as a standalone application
190 * then exit the application. It is running as an embedded application then
191 * just terminate the thread
192 */
193 public void stopServer()
194 throws JMSException;
195
196 /***
197 * Purge all processed messages from the database
198 *
199 * @return int number of purged messages
200 * @exception JMSException
201 * @deprecated no replacement
202 */
203 public int purgeMessages()
204 throws JMSException;
205
206 /***
207 * Close the connection.
208 */
209 public void close();
210
211 /***
212 * Add a user with the specified name
213 *
214 * @param username the users name
215 * @param password the users password
216 * @return <code>true</code> if the user is added
217 * otherwise <code>false</code>
218 */
219 public boolean addUser(String username, String password)
220 throws JMSException;
221
222 /***
223 * Change password for the specified user
224 *
225 * @param username the users name
226 * @param password the users password
227 * @return <code>true</code> if the password is changed
228 * otherwise <code>false</code>
229 */
230 public boolean changePassword(String username, String password)
231 throws JMSException;
232
233 /***
234 * Remove the specified user
235 *
236 * @param username the users name
237 * @return <code>true</code> if the user is removed
238 * otherwise <code>false</code>
239 */
240 public boolean removeUser(String username)
241 throws JMSException;
242
243 /***
244 * Return a list of all registered users.
245 *
246 * @return Vector of users
247 * @exception JMSException
248 */
249 public Vector getAllUsers()
250 throws JMSException;
251 }