KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exolab > jms > administration > JmsAdminServerIfc


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.1 2004/11/26 01:50:38 tanderson Exp $
44  */

45 package org.exolab.jms.administration;
46
47 import java.util.Vector JavaDoc;
48
49 import javax.jms.JMSException JavaDoc;
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.1 $ $Date: 2004/11/26 01:50:38 $
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     int getDurableConsumerMessageCount(String JavaDoc topic, String JavaDoc name)
71         throws JMSException JavaDoc;
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     int getQueueMessageCount(String JavaDoc queue) throws JMSException JavaDoc;
81
82     /**
83      * Add a durable consumer for the specified name the passed in name
84      *
85      * @param topic name of the destination
86      * @param name name of the consumer
87      * @return boolean true if successful
88      * @exception JMSException
89      */

90     boolean addDurableConsumer(String JavaDoc topic, String JavaDoc name) throws JMSException JavaDoc;
91
92     /**
93      * Remove the the specified durable consumer
94      *
95      * @param name name of the consumer
96      * @return boolean true if successful
97      * @exception JMSException
98      */

99     boolean removeDurableConsumer(String JavaDoc name) throws JMSException JavaDoc;
100
101     /**
102      * Check if the specified durable consumer exists
103      *
104      * @param name durable consumer to query
105      * @return boolean true if it exists
106      * @exception JMSException
107      */

108     boolean durableConsumerExists(String JavaDoc name) throws JMSException JavaDoc;
109
110     /**
111      * Return the collection of durable consumer names for a particular
112      * topic destination.
113      *
114      * @param topic the topic name
115      * @return Vector collection of strings
116      * @exception JMSException
117      */

118     Vector JavaDoc getDurableConsumers(String JavaDoc destination) throws JMSException JavaDoc;
119
120     /**
121      * De-Activate an active persistent consumer.
122      *
123      * @param name name of the consumer
124      * @return boolean true if successful
125      * @exception JMSException
126      */

127     boolean unregisterConsumer(String JavaDoc name) throws JMSException JavaDoc;
128
129     /**
130      * Check to see if the given consumer is currently connected to the
131      * OpenJMSServer. This is only valid when in online mode.
132      *
133      * @param name The name of the onsumer.
134      * @return boolean True if the consumer is connected.
135      * @exception JMSException
136      *
137      */

138     boolean isConnected(String JavaDoc name) throws JMSException JavaDoc;
139
140     /**
141      * Return a list of all registered destinations.
142      *
143      * @return a collection of <code>javax.jms.Destination</code> instances
144      * @exception JMSException
145      */

146     Vector JavaDoc getAllDestinations() throws JMSException JavaDoc;
147
148     /**
149      * Add a specific destination with the specified name
150      *
151      * @param name destination name
152      * @param queue whether it is queue or a topic
153      * @return boolean true if successful
154      * @exception JMSException
155      */

156     boolean addDestination(String JavaDoc destination, Boolean JavaDoc queue)
157         throws JMSException JavaDoc;
158
159     /**
160      * Destroy the specified destination and all associated messsages and
161      * consumers. This is a very dangerous operation to execute while there
162      * are clients online
163      *
164      * @param destination destination to destroy
165      * @exception JMSException
166      */

167     boolean removeDestination(String JavaDoc name) throws JMSException JavaDoc;
168
169     /**
170      * Determine if the specified destination exists
171      *
172      * @param name - the destination to check
173      * @return boolean - true if it exists
174      * @throws JMSException
175      */

176     boolean destinationExists(String JavaDoc name) throws JMSException JavaDoc;
177
178     /**
179      * Terminate the JMS Server. If it is running as a standalone application
180      * then exit the application. It is running as an embedded application then
181      * just terminate the thread
182      */

183     void stopServer() throws JMSException JavaDoc;
184
185     /**
186      * Purge all processed messages from the database
187      *
188      * @return int number of purged messages
189      * @exception JMSException
190      */

191     int purgeMessages() throws JMSException JavaDoc;
192
193     /**
194      * Close the connection.
195      */

196     void close();
197
198     /**
199      * Add a user with the specified name
200      *
201      * @param username the users name
202      * @param password the users password
203      * @return <code>true</code> if the user is added
204      * otherwise <code>false</code>
205      */

206     boolean addUser(String JavaDoc username, String JavaDoc password) throws JMSException JavaDoc;
207
208     /**
209      * Change password for the specified user
210      *
211      * @param username the users name
212      * @param password the users password
213      * @return <code>true</code> if the password is changed
214      * otherwise <code>false</code>
215      */

216     boolean changePassword(String JavaDoc username, String JavaDoc password)
217         throws JMSException JavaDoc;
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      */

226     boolean removeUser(String JavaDoc username) throws JMSException JavaDoc;
227
228     /**
229      * Return a list of all registered users.
230      *
231      * @return Vector of users
232      * @exception JMSException
233      */

234     Vector JavaDoc getAllUsers() throws JMSException JavaDoc;
235 }
236
Popular Tags