org.exolab.jms.server.rmi
Class RmiJmsAdminConnection

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--org.exolab.jms.server.rmi.RmiJmsAdminConnection
All Implemented Interfaces:
java.rmi.Remote, RemoteJmsAdminConnectionIfc, java.io.Serializable

public class RmiJmsAdminConnection
extends java.rmi.server.UnicastRemoteObject
implements RemoteJmsAdminConnectionIfc

This class implements the RemoteJmsAdminServerIfc and simply delegates all the request to the JmsAdmin singleton instance.

Version:
$Revision: 1.2 $ $Date: 2003/08/07 13:33:10 $
Author:
Jim Alateras
See Also:
Remote, Serialized Form

Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
RmiJmsAdminConnection(AdminConnection connection)
          The default constructor simply calls the base class' default constructor.
 
Method Summary
 boolean addDestination(java.lang.String destination, java.lang.Boolean queue)
          Add a specific destination with the specified name
 boolean addDurableConsumer(java.lang.String topic, java.lang.String name)
          Add a consumer for the specified topic
 boolean addUser(java.lang.String username, java.lang.String password)
          Add a user with the specified name
 boolean changePassword(java.lang.String username, java.lang.String password)
          Change password for the specified user
 boolean destinationExists(java.lang.String name)
          Determine whether the destination with the specified name exists
 boolean durableConsumerExists(java.lang.String name)
          Check if a durable consumer, with the specified name, already exists
 java.util.Vector getAllDestinations()
          Return a list of all registered destinations.
 java.util.Vector getAllUsers()
          Return a list of all registered users.
 int getDurableConsumerMessageCount(java.lang.String topic, java.lang.String name)
          Return the number of outstanding messages for a particular destination.
 java.util.Vector getDurableConsumers(java.lang.String topic)
          Return the collection of durable consumer names for a particular topic destination.
 int getQueueMessageCount(java.lang.String queue)
          Return the number of outstanding messages for a particular queue.
 boolean isConnected(java.lang.String name)
          Check to see if the given consumer is currently connected to the OpenJMSServer.
 int purgeMessages()
          Purge all processed messages from the database
 boolean removeDestination(java.lang.String name)
          Destroy the specified destination and all associated messsages and consumers.
 boolean removeDurableConsumer(java.lang.String name)
          Remove the consumer attached to the specified destination and with the passed in name
 boolean removeUser(java.lang.String username)
          Remove the specified user
 void stopServer()
          Terminate the JMS Server.
 boolean unregisterConsumer(java.lang.String name)
          De-Activate an active persistent consumer.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RmiJmsAdminConnection

public RmiJmsAdminConnection(AdminConnection connection)
                      throws java.rmi.RemoteException
The default constructor simply calls the base class' default constructor.
Parameters:
connection - delegate connection object
Throws:
java.rmi.RemoteException - if the connection cannot be created
Method Detail

addDurableConsumer

public boolean addDurableConsumer(java.lang.String topic,
                                  java.lang.String name)
                           throws java.rmi.RemoteException
Description copied from interface: RemoteJmsAdminConnectionIfc
Add a consumer for the specified topic
Specified by:
addDurableConsumer in interface RemoteJmsAdminConnectionIfc
Following copied from interface: org.exolab.jms.server.rmi.RemoteJmsAdminConnectionIfc
Parameters:
topic - name of the destination
name - name of the consumer
Returns:
boolean true if successful
Throws:
java.rmi.RemoteException - if the connection cannot be created

removeDurableConsumer

public boolean removeDurableConsumer(java.lang.String name)
                              throws java.rmi.RemoteException
Description copied from interface: RemoteJmsAdminConnectionIfc
Remove the consumer attached to the specified destination and with the passed in name
Specified by:
removeDurableConsumer in interface RemoteJmsAdminConnectionIfc
Following copied from interface: org.exolab.jms.server.rmi.RemoteJmsAdminConnectionIfc
Parameters:
name - name of the consumer
Returns:
boolean true if successful
Throws:
java.rmi.RemoteException - if the connection cannot be created

durableConsumerExists

public boolean durableConsumerExists(java.lang.String name)
                              throws java.rmi.RemoteException
Description copied from interface: RemoteJmsAdminConnectionIfc
Check if a durable consumer, with the specified name, already exists
Specified by:
durableConsumerExists in interface RemoteJmsAdminConnectionIfc
Following copied from interface: org.exolab.jms.server.rmi.RemoteJmsAdminConnectionIfc
Parameters:
name - name of the consumer
Returns:
boolean true if it exists
Throws:
java.rmi.RemoteException - if the connection cannot be created

unregisterConsumer

public boolean unregisterConsumer(java.lang.String name)
                           throws java.rmi.RemoteException
Description copied from interface: RemoteJmsAdminConnectionIfc
De-Activate an active persistent consumer.
Specified by:
unregisterConsumer in interface RemoteJmsAdminConnectionIfc
Following copied from interface: org.exolab.jms.server.rmi.RemoteJmsAdminConnectionIfc
Parameters:
name - name of the consumer
Returns:
boolean true if successful
Throws:
java.rmi.RemoteException - if the connection cannot be created

isConnected

public boolean isConnected(java.lang.String name)
                    throws java.rmi.RemoteException
Description copied from interface: RemoteJmsAdminConnectionIfc
Check to see if the given consumer is currently connected to the OpenJMSServer. This is only valid when in online mode.
Specified by:
isConnected in interface RemoteJmsAdminConnectionIfc
Following copied from interface: org.exolab.jms.server.rmi.RemoteJmsAdminConnectionIfc
Parameters:
name - The name of the onsumer.
Returns:
boolean True if the consumer is connected.
Throws:
java.rmi.RemoteException - if the connection cannot be created

getAllDestinations

public java.util.Vector getAllDestinations()
                                    throws java.rmi.RemoteException
Description copied from interface: RemoteJmsAdminConnectionIfc
Return a list of all registered destinations.
Specified by:
getAllDestinations in interface RemoteJmsAdminConnectionIfc
Following copied from interface: org.exolab.jms.server.rmi.RemoteJmsAdminConnectionIfc
Returns:
Vector collection of strings
Throws:
java.rmi.RemoteException - if the connection cannot be created

addDestination

public boolean addDestination(java.lang.String destination,
                              java.lang.Boolean queue)
                       throws java.rmi.RemoteException
Description copied from interface: RemoteJmsAdminConnectionIfc
Add a specific destination with the specified name
Specified by:
addDestination in interface RemoteJmsAdminConnectionIfc
Following copied from interface: org.exolab.jms.server.rmi.RemoteJmsAdminConnectionIfc
Parameters:
destination - destination name
queue - whether it is queue or a topic
Returns:
boolean true if successful
Throws:
java.rmi.RemoteException - if the connection cannot be created

getDurableConsumerMessageCount

public int getDurableConsumerMessageCount(java.lang.String topic,
                                          java.lang.String name)
                                   throws java.rmi.RemoteException
Description copied from interface: RemoteJmsAdminConnectionIfc
Return the number of outstanding messages for a particular destination.
Specified by:
getDurableConsumerMessageCount in interface RemoteJmsAdminConnectionIfc
Following copied from interface: org.exolab.jms.server.rmi.RemoteJmsAdminConnectionIfc
Parameters:
topic - name of the topic
name - durable consumer name
Returns:
int message count
Throws:
java.rmi.RemoteException - if the connection cannot be created

getQueueMessageCount

public int getQueueMessageCount(java.lang.String queue)
                         throws java.rmi.RemoteException
Description copied from interface: RemoteJmsAdminConnectionIfc
Return the number of outstanding messages for a particular queue.
Specified by:
getQueueMessageCount in interface RemoteJmsAdminConnectionIfc
Following copied from interface: org.exolab.jms.server.rmi.RemoteJmsAdminConnectionIfc
Parameters:
queue - the queue name
Returns:
int message count
Throws:
java.rmi.RemoteException - if the connection cannot be created

getDurableConsumers

public java.util.Vector getDurableConsumers(java.lang.String topic)
                                     throws java.rmi.RemoteException
Description copied from interface: RemoteJmsAdminConnectionIfc
Return the collection of durable consumer names for a particular topic destination.
Specified by:
getDurableConsumers in interface RemoteJmsAdminConnectionIfc
Following copied from interface: org.exolab.jms.server.rmi.RemoteJmsAdminConnectionIfc
Parameters:
destination - the destination name
Returns:
Vector collection of strings
Throws:
java.rmi.RemoteException - if the connection cannot be created

removeDestination

public boolean removeDestination(java.lang.String name)
                          throws java.rmi.RemoteException
Description copied from interface: RemoteJmsAdminConnectionIfc
Destroy the specified destination and all associated messsages and consumers. This is a very dangerous operation to execute while there are clients online
Specified by:
removeDestination in interface RemoteJmsAdminConnectionIfc
Following copied from interface: org.exolab.jms.server.rmi.RemoteJmsAdminConnectionIfc
Parameters:
name - destination to destroy
Returns:
boolean if the destination got destroyed
Throws:
java.rmi.RemoteException - if the connection cannot be created

destinationExists

public boolean destinationExists(java.lang.String name)
                          throws java.rmi.RemoteException
Description copied from interface: RemoteJmsAdminConnectionIfc
Determine whether the destination with the specified name exists
Specified by:
destinationExists in interface RemoteJmsAdminConnectionIfc
Following copied from interface: org.exolab.jms.server.rmi.RemoteJmsAdminConnectionIfc
Parameters:
name - - the destination to check
Returns:
boolean - if the destination exists
Throws:
java.rmi.RemoteException - if the connection cannot be created

purgeMessages

public int purgeMessages()
                  throws java.rmi.RemoteException
Description copied from interface: RemoteJmsAdminConnectionIfc
Purge all processed messages from the database
Specified by:
purgeMessages in interface RemoteJmsAdminConnectionIfc
Following copied from interface: org.exolab.jms.server.rmi.RemoteJmsAdminConnectionIfc
Returns:
int the number of purged messages
Throws:
java.rmi.RemoteException - if the connection cannot be created

stopServer

public void stopServer()
                throws java.rmi.RemoteException
Description copied from interface: RemoteJmsAdminConnectionIfc
Terminate the JMS Server. If it is running as a standalone application then exit the application. It is running as an embedded application then just terminate the thread
Specified by:
stopServer in interface RemoteJmsAdminConnectionIfc
Following copied from interface: org.exolab.jms.server.rmi.RemoteJmsAdminConnectionIfc
Throws:
java.rmi.RemoteException - if the connection cannot be created

addUser

public boolean addUser(java.lang.String username,
                       java.lang.String password)
                throws java.rmi.RemoteException
Description copied from interface: RemoteJmsAdminConnectionIfc
Add a user with the specified name
Specified by:
addUser in interface RemoteJmsAdminConnectionIfc
Following copied from interface: org.exolab.jms.server.rmi.RemoteJmsAdminConnectionIfc
Parameters:
username - the users name
password - the users password
Returns:
true if the user is added otherwise false
Throws:
java.rmi.RemoteException - if the connection cannot be created

changePassword

public boolean changePassword(java.lang.String username,
                              java.lang.String password)
                       throws java.rmi.RemoteException
Description copied from interface: RemoteJmsAdminConnectionIfc
Change password for the specified user
Specified by:
changePassword in interface RemoteJmsAdminConnectionIfc
Following copied from interface: org.exolab.jms.server.rmi.RemoteJmsAdminConnectionIfc
Parameters:
username - the users name
password - the users password
Returns:
true if the password is changed otherwise false
Throws:
java.rmi.RemoteException - if the connection cannot be created

removeUser

public boolean removeUser(java.lang.String username)
                   throws java.rmi.RemoteException
Description copied from interface: RemoteJmsAdminConnectionIfc
Remove the specified user
Specified by:
removeUser in interface RemoteJmsAdminConnectionIfc
Following copied from interface: org.exolab.jms.server.rmi.RemoteJmsAdminConnectionIfc
Parameters:
username - the users name
Returns:
true if the user is removed otherwise false
Throws:
java.rmi.RemoteException - if the connection cannot be created

getAllUsers

public java.util.Vector getAllUsers()
                             throws java.rmi.RemoteException
Description copied from interface: RemoteJmsAdminConnectionIfc
Return a list of all registered users.
Specified by:
getAllUsers in interface RemoteJmsAdminConnectionIfc
Following copied from interface: org.exolab.jms.server.rmi.RemoteJmsAdminConnectionIfc
Returns:
Vector of users
Throws:
java.rmi.RemoteException - if the connection cannot be created


Copyright © 1999-2004 The OpenJMS Group. All Rights Reserved.