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 1999 (C) Exoffice Technologies Inc. All Rights Reserved.
42   *
43   * $Id: RmiJmsAdminConnection.java,v 1.2 2003/08/07 13:33:10 tanderson Exp $
44   *
45   * Date         Author  Changes
46   * 05/10/2000   jima    Created
47   */
48  package org.exolab.jms.server.rmi;
49  
50  import java.rmi.RemoteException;
51  import java.rmi.server.UnicastRemoteObject;
52  import java.util.Vector;
53  
54  import org.exolab.jms.server.AdminConnection;
55  
56  
57  /***
58   * This class implements the RemoteJmsAdminServerIfc and simply delegates all
59   * the request to the JmsAdmin singleton instance.
60   *
61   * @version     $Revision: 1.2 $ $Date: 2003/08/07 13:33:10 $
62   * @author      <a href="mailto:jima@exoffice.com">Jim Alateras</a>
63   * @see         java.rmi.Remote
64   **/
65  public class RmiJmsAdminConnection extends UnicastRemoteObject
66      implements RemoteJmsAdminConnectionIfc {
67  
68      /***
69       * This is the object that the RMI connection object delegates to. It must
70       * be non-null and assigned during object construction
71       */
72      private AdminConnection _delegate = null;
73  
74      /***
75       * The default constructor simply calls the base class' default constructor.
76       *
77       * @param connection delegate connection object
78       * @throws RemoteException if the connection cannot be created
79       */
80      public RmiJmsAdminConnection(AdminConnection connection)
81          throws RemoteException {
82  
83          if (connection == null) {
84              throw new IllegalArgumentException("Argument connection is null");
85          }
86  
87          _delegate = connection;
88      }
89  
90      // implementation of RemoteJmsAdminServerIfc.removeDurableConsumer
91      public boolean addDurableConsumer(String topic, String name)
92          throws RemoteException {
93          return _delegate.addDurableConsumer(topic, name);
94      }
95  
96      // implementation of RemoteJmsAdminServerIfc.removeDurableConsumer
97      public boolean removeDurableConsumer(String name)
98          throws RemoteException {
99          return _delegate.removeDurableConsumer(name);
100     }
101 
102     // implementation of RemoteJmsAdminServerIfc.durableConsumerExists
103     public boolean durableConsumerExists(String name)
104         throws RemoteException {
105         return _delegate.durableConsumerExists(name);
106     }
107 
108 
109     // implementation of RemoteJmsAdminServerIfc.removeDurableConsumer
110     public boolean unregisterConsumer(String name)
111         throws RemoteException {
112         return _delegate.unregisterConsumer(name);
113     }
114 
115     // implementation of RemoteJmsAdminServerIfc.isConnected
116     public boolean isConnected(String name)
117         throws RemoteException {
118         return _delegate.isConnected(name);
119     }
120 
121     // implementation of RemoteJmsAdminServerIfc.getAllDestinations
122     public Vector getAllDestinations()
123         throws RemoteException {
124         return _delegate.getAllDestinations();
125     }
126 
127     // implementation of RemoteJmsAdminServerIfc.addDestination
128     public boolean addDestination(String destination, Boolean queue)
129         throws RemoteException {
130         return _delegate.addDestination(destination, queue);
131     }
132 
133     // implementation of RemoteJmsAdminServerIfc.getDurableConsumerMessageCount
134     public int getDurableConsumerMessageCount(String topic, String name)
135         throws RemoteException {
136         return _delegate.getDurableConsumerMessageCount(topic, name);
137     }
138 
139     // implementation of RemoteJmsAdminServerIfc.getDurableConsumerMessageCount
140     public int getQueueMessageCount(String queue)
141         throws RemoteException {
142         return _delegate.getQueueMessageCount(queue);
143     }
144 
145     // implementation of RemoteJmsAdminServerIfc.getDurableConsumers
146     public Vector getDurableConsumers(String topic)
147         throws RemoteException {
148         return _delegate.getDurableConsumers(topic);
149     }
150 
151     // implementation of RemoteJmsAdminServerIfc.removeDestination
152     public boolean removeDestination(String name)
153         throws RemoteException {
154         return _delegate.removeDestination(name);
155     }
156 
157     // implementation of RemoteJmsAdminServerIfc.removeDestination
158     public boolean destinationExists(String name)
159         throws RemoteException {
160         return _delegate.destinationExists(name);
161     }
162 
163     // implementation of RemoteJmsAdminServerIfc.purgeMessages
164     public int purgeMessages()
165         throws RemoteException {
166         return _delegate.purgeMessages();
167     }
168 
169     // implementation of RemoteJmsAdminServerIfc.stopServer
170     public void stopServer()
171         throws RemoteException {
172         _delegate.stopServer();
173     }
174 
175     // implementation of RemoteJmsAdminServerIfc.addUser
176     public boolean addUser(String username, String password)
177         throws RemoteException {
178         return _delegate.addUser(username, password);
179     }
180 
181     // implementation of RemoteJmsAdminServerIfc.changePassword
182     public boolean changePassword(String username, String password)
183         throws RemoteException {
184         return _delegate.changePassword(username, password);
185     }
186 
187     // implementation of RemoteJmsAdminServerIfc.removeUser
188     public boolean removeUser(String username) throws RemoteException {
189         return _delegate.removeUser(username);
190     }
191 
192     // implementation of RemoteJmsAdminServerIfc.getAllUsers
193     public Vector getAllUsers() throws RemoteException {
194         return _delegate.getAllUsers();
195     }
196 
197 }
198 
199 
200