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