org.exolab.jms.administration.intravm
Class IntravmJmsAdminConnection

java.lang.Object
  extended by org.exolab.jms.administration.intravm.IntravmJmsAdminConnection
All Implemented Interfaces:
AdminConnection, JmsAdminServerIfc

public class IntravmJmsAdminConnection
extends java.lang.Object
implements JmsAdminServerIfc, AdminConnection

This class is repsonsible for an admin connection to the intravm server

Version:
$Revision: 1.11 $ $Date: 2003/08/17 01:32:21 $
Author:
Constructor Summary
IntravmJmsAdminConnection(java.lang.String username, java.lang.String password)
          Construct a new IntravmJmsAdminConnection
 
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 durable consumer for the specified name
 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
 void close()
          Close the connection.
 boolean destinationExists(java.lang.String name)
          Determine if the specified destination exists
 boolean durableConsumerExists(java.lang.String name)
          Check if the specified durable consumer 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
 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 specified durable consumer
 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.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntravmJmsAdminConnection

public IntravmJmsAdminConnection(java.lang.String username,
                                 java.lang.String password)
                          throws javax.jms.JMSException
Construct a new IntravmJmsAdminConnection

Parameters:
username - the admin user name
password - the admin password
Throws:
JMSEXception - if the client cannot be authenticated
javax.jms.JMSException
Method Detail

addDurableConsumer

public boolean addDurableConsumer(java.lang.String topic,
                                  java.lang.String name)
                           throws javax.jms.JMSException
Description copied from interface: AdminConnection
Add a durable consumer for the specified name

Specified by:
addDurableConsumer in interface AdminConnection
Specified by:
addDurableConsumer in interface JmsAdminServerIfc
Parameters:
topic - name of the destination
name - name of the consumer
Returns:
boolean true if successful
Throws:
javax.jms.JMSException

removeDurableConsumer

public boolean removeDurableConsumer(java.lang.String name)
                              throws javax.jms.JMSException
Description copied from interface: AdminConnection
Remove the specified durable consumer

Specified by:
removeDurableConsumer in interface AdminConnection
Specified by:
removeDurableConsumer in interface JmsAdminServerIfc
Parameters:
name - name of the consumer
Returns:
boolean true if successful
Throws:
javax.jms.JMSException

durableConsumerExists

public boolean durableConsumerExists(java.lang.String name)
                              throws javax.jms.JMSException
Description copied from interface: AdminConnection
Check if the specified durable consumer exists

Specified by:
durableConsumerExists in interface AdminConnection
Specified by:
durableConsumerExists in interface JmsAdminServerIfc
Parameters:
name - durable consumer to query
Returns:
boolean true if it exists
Throws:
javax.jms.JMSException

getDurableConsumers

public java.util.Vector getDurableConsumers(java.lang.String topic)
                                     throws javax.jms.JMSException
Description copied from interface: AdminConnection
Return the collection of durable consumer names for a particular topic destination.

Specified by:
getDurableConsumers in interface AdminConnection
Specified by:
getDurableConsumers in interface JmsAdminServerIfc
Parameters:
topic - the destination name
Returns:
Vector collection of strings
Throws:
javax.jms.JMSException - on error

unregisterConsumer

public boolean unregisterConsumer(java.lang.String name)
                           throws javax.jms.JMSException
Description copied from interface: AdminConnection
De-activate an active persistent consumer.

Specified by:
unregisterConsumer in interface AdminConnection
Specified by:
unregisterConsumer in interface JmsAdminServerIfc
Parameters:
name - name of the consumer
Returns:
boolean true if successful
Throws:
javax.jms.JMSException

isConnected

public boolean isConnected(java.lang.String name)
                    throws javax.jms.JMSException
Description copied from interface: AdminConnection
Check to see if the given consumer is currently connected

Specified by:
isConnected in interface AdminConnection
Specified by:
isConnected in interface JmsAdminServerIfc
Parameters:
name - the name of the onsumer.
Returns:
true if the consumer is connected
Throws:
javax.jms.JMSException

addDestination

public boolean addDestination(java.lang.String destination,
                              java.lang.Boolean queue)
                       throws javax.jms.JMSException
Description copied from interface: AdminConnection
Add a specific destination with the specified name

Specified by:
addDestination in interface AdminConnection
Specified by:
addDestination in interface JmsAdminServerIfc
queue - whether it is queue or a topic
Returns:
boolean true if successful
Throws:
javax.jms.JMSException

removeDestination

public boolean removeDestination(java.lang.String name)
                          throws javax.jms.JMSException
Description copied from interface: AdminConnection
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 AdminConnection
Specified by:
removeDestination in interface JmsAdminServerIfc
Throws:
javax.jms.JMSException

destinationExists

public boolean destinationExists(java.lang.String name)
                          throws javax.jms.JMSException
Description copied from interface: AdminConnection
Determine if the specified destination exists

Specified by:
destinationExists in interface AdminConnection
Specified by:
destinationExists in interface JmsAdminServerIfc
Parameters:
name - - the destination to check
Returns:
boolean - true if it exists
Throws:
javax.jms.JMSException

getAllDestinations

public java.util.Vector getAllDestinations()
                                    throws javax.jms.JMSException
Description copied from interface: AdminConnection
Return a list of all registered destinations.

Specified by:
getAllDestinations in interface AdminConnection
Specified by:
getAllDestinations in interface JmsAdminServerIfc
Returns:
Vector collection of strings
Throws:
javax.jms.JMSException - on error

getDurableConsumerMessageCount

public int getDurableConsumerMessageCount(java.lang.String topic,
                                          java.lang.String name)
                                   throws javax.jms.JMSException
Description copied from interface: AdminConnection
Return the number of outstanding messages for a particular destination.

Specified by:
getDurableConsumerMessageCount in interface AdminConnection
Specified by:
getDurableConsumerMessageCount in interface JmsAdminServerIfc
Parameters:
topic - name of the topic
name - durable consumer name
Returns:
int message count
Throws:
javax.jms.JMSException - on error

getQueueMessageCount

public int getQueueMessageCount(java.lang.String queue)
                         throws javax.jms.JMSException
Description copied from interface: AdminConnection
Return the number of outstanding messages for a particular queue.

Specified by:
getQueueMessageCount in interface AdminConnection
Specified by:
getQueueMessageCount in interface JmsAdminServerIfc
Parameters:
queue - the queue name
Returns:
int message count
Throws:
javax.jms.JMSException - on error

purgeMessages

public int purgeMessages()
                  throws javax.jms.JMSException
Description copied from interface: AdminConnection
Purge all processed messages from the database

Specified by:
purgeMessages in interface AdminConnection
Specified by:
purgeMessages in interface JmsAdminServerIfc
Returns:
the number of purged messages
Throws:
javax.jms.JMSException

stopServer

public void stopServer()
                throws javax.jms.JMSException
Description copied from interface: AdminConnection
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 AdminConnection
Specified by:
stopServer in interface JmsAdminServerIfc
Throws:
javax.jms.JMSException

close

public void close()
Description copied from interface: JmsAdminServerIfc
Close the connection.

Specified by:
close in interface JmsAdminServerIfc

addUser

public boolean addUser(java.lang.String username,
                       java.lang.String password)
                throws javax.jms.JMSException
Description copied from interface: AdminConnection
Add a user with the specified name

Specified by:
addUser in interface AdminConnection
Specified by:
addUser in interface JmsAdminServerIfc
Parameters:
username - the users name
password - the users password
Returns:
true if the user is added otherwise false
Throws:
javax.jms.JMSException

getAllUsers

public java.util.Vector getAllUsers()
                             throws javax.jms.JMSException
Description copied from interface: AdminConnection
Return a list of all registered users.

Specified by:
getAllUsers in interface AdminConnection
Specified by:
getAllUsers in interface JmsAdminServerIfc
Returns:
Vector of users
Throws:
javax.jms.JMSException - on error

removeUser

public boolean removeUser(java.lang.String username)
                   throws javax.jms.JMSException
Description copied from interface: AdminConnection
Remove the specified user

Specified by:
removeUser in interface AdminConnection
Specified by:
removeUser in interface JmsAdminServerIfc
Parameters:
username - the users name
Returns:
true if the user is removed otherwise false
Throws:
javax.jms.JMSException

changePassword

public boolean changePassword(java.lang.String username,
                              java.lang.String password)
                       throws javax.jms.JMSException
Description copied from interface: AdminConnection
Change password for the specified user

Specified by:
changePassword in interface AdminConnection
Specified by:
changePassword in interface JmsAdminServerIfc
Parameters:
username - the users name
password - the users password
Returns:
true if the password is changed otherwise false
Throws:
javax.jms.JMSException


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