org.exolab.jms.administration.net
Class JmsAdminConnectionImpl

java.lang.Object
  |
  +--org.exolab.jms.administration.net.JmsAdminConnectionImpl
All Implemented Interfaces:
AdminConnection, JmsAdminServerIfc

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

This class is repsonsible for an admin connection to the server

Version:
$Revision: 1.4 $ $Date: 2006/05/24 07:59:19 $
Author:
Jim Mourikis
See Also:
AdminConnectionFactory

Constructor Summary
JmsAdminConnectionImpl(java.lang.String url, java.lang.String username, java.lang.String password)
          Construct a new JmsAdminConnectionImpl
 
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 the passed in 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 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 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

JmsAdminConnectionImpl

public JmsAdminConnectionImpl(java.lang.String url,
                              java.lang.String username,
                              java.lang.String password)
                       throws javax.jms.JMSException
Construct a new JmsAdminConnectionImpl
Parameters:
url - the server URI
username - the client's username
password - the client's password
Method Detail

addDurableConsumer

public boolean addDurableConsumer(java.lang.String topic,
                                  java.lang.String name)
                           throws javax.jms.JMSException
Description copied from interface: JmsAdminServerIfc
Add a durable consumer for the specified name the passed in name
Specified by:
addDurableConsumer in interface JmsAdminServerIfc
Following copied from interface: org.exolab.jms.administration.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: JmsAdminServerIfc
Remove the the specified durable consumer
Specified by:
removeDurableConsumer in interface JmsAdminServerIfc
Following copied from interface: org.exolab.jms.administration.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: JmsAdminServerIfc
Check if the specified durable consumer exists
Specified by:
durableConsumerExists in interface JmsAdminServerIfc
Following copied from interface: org.exolab.jms.administration.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: JmsAdminServerIfc
Return the collection of durable consumer names for a particular topic destination.
Specified by:
getDurableConsumers in interface JmsAdminServerIfc
Following copied from interface: org.exolab.jms.administration.JmsAdminServerIfc
Parameters:
topic - the topic name
Returns:
Vector collection of strings
Throws:
javax.jms.JMSException -  

unregisterConsumer

public boolean unregisterConsumer(java.lang.String name)
                           throws javax.jms.JMSException
Description copied from interface: JmsAdminServerIfc
De-Activate an active persistent consumer.
Specified by:
unregisterConsumer in interface JmsAdminServerIfc
Following copied from interface: org.exolab.jms.administration.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: JmsAdminServerIfc
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 JmsAdminServerIfc
Following copied from interface: org.exolab.jms.administration.JmsAdminServerIfc
Parameters:
name - The name of the onsumer.
Returns:
boolean 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: JmsAdminServerIfc
Add a specific destination with the specified name
Specified by:
addDestination in interface JmsAdminServerIfc
Following copied from interface: org.exolab.jms.administration.JmsAdminServerIfc
Parameters:
name - destination name
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: JmsAdminServerIfc
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 JmsAdminServerIfc
Following copied from interface: org.exolab.jms.administration.JmsAdminServerIfc
Parameters:
destination - destination to destroy
Throws:
javax.jms.JMSException -  

destinationExists

public boolean destinationExists(java.lang.String name)
                          throws javax.jms.JMSException
Description copied from interface: JmsAdminServerIfc
Determine if the specified destination exists
Specified by:
destinationExists in interface JmsAdminServerIfc
Following copied from interface: org.exolab.jms.administration.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: JmsAdminServerIfc
Return a list of all registered destinations.
Specified by:
getAllDestinations in interface JmsAdminServerIfc
Following copied from interface: org.exolab.jms.administration.JmsAdminServerIfc
Returns:
a collection of javax.jms.Destination instances
Throws:
javax.jms.JMSException -  

getDurableConsumerMessageCount

public int getDurableConsumerMessageCount(java.lang.String topic,
                                          java.lang.String name)
                                   throws javax.jms.JMSException
Description copied from interface: JmsAdminServerIfc
Return the number of outstanding messages for a particular destination.
Specified by:
getDurableConsumerMessageCount in interface JmsAdminServerIfc
Following copied from interface: org.exolab.jms.administration.JmsAdminServerIfc
Parameters:
topic - name of the topic
name - durable consumer name
Returns:
int message count
Throws:
javax.jms.JMSException -  

getQueueMessageCount

public int getQueueMessageCount(java.lang.String queue)
                         throws javax.jms.JMSException
Description copied from interface: JmsAdminServerIfc
Return the number of outstanding messages for a particular queue.
Specified by:
getQueueMessageCount in interface JmsAdminServerIfc
Following copied from interface: org.exolab.jms.administration.JmsAdminServerIfc
Parameters:
queue - the queue name
Returns:
int message count
Throws:
javax.jms.JMSException -  

purgeMessages

public int purgeMessages()
                  throws javax.jms.JMSException
Description copied from interface: JmsAdminServerIfc
Purge all processed messages from the database
Specified by:
purgeMessages in interface JmsAdminServerIfc
Following copied from interface: org.exolab.jms.administration.JmsAdminServerIfc
Returns:
int number of purged messages
Throws:
javax.jms.JMSException -  

stopServer

public void stopServer()
                throws javax.jms.JMSException
Description copied from interface: JmsAdminServerIfc
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 JmsAdminServerIfc
Following copied from interface: org.exolab.jms.administration.AdminConnection
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: JmsAdminServerIfc
Add a user with the specified name
Specified by:
addUser in interface JmsAdminServerIfc
Following copied from interface: org.exolab.jms.administration.JmsAdminServerIfc
Parameters:
username - the users name
password - the users password
Returns:
true if the user is added otherwise false

getAllUsers

public java.util.Vector getAllUsers()
                             throws javax.jms.JMSException
Description copied from interface: JmsAdminServerIfc
Return a list of all registered users.
Specified by:
getAllUsers in interface JmsAdminServerIfc
Following copied from interface: org.exolab.jms.administration.JmsAdminServerIfc
Returns:
Vector of users
Throws:
javax.jms.JMSException -  

removeUser

public boolean removeUser(java.lang.String username)
                   throws javax.jms.JMSException
Description copied from interface: JmsAdminServerIfc
Remove the specified user
Specified by:
removeUser in interface JmsAdminServerIfc
Following copied from interface: org.exolab.jms.administration.JmsAdminServerIfc
Parameters:
username - the users name
Returns:
true if the user is removed otherwise false

changePassword

public boolean changePassword(java.lang.String username,
                              java.lang.String password)
                       throws javax.jms.JMSException
Description copied from interface: JmsAdminServerIfc
Change password for the specified user
Specified by:
changePassword in interface JmsAdminServerIfc
Following copied from interface: org.exolab.jms.administration.JmsAdminServerIfc
Parameters:
username - the users name
password - the users password
Returns:
true if the password is changed otherwise false


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