jrun.jms.core.server
Class JmsAdmin

java.lang.Object
  |
  +--jrun.jms.core.server.JmsAdmin

public class JmsAdmin
extends java.lang.Object

This class contains the logic to perform administrative functions on the JMS server. It is a singleton and accessible through the JmsAdmin.instance class method.

No state is maintained by class instances

Version:
$Revision: 1.15 $ $Date: 2001/09/26 01:36:43 $
Author:
Jim Alateras, Tim Anderson
See Also:
Remote

Method Summary
 boolean addDestination(java.lang.String name, java.lang.Boolean queue)
          Add an administered 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 durableConsumerExists(java.lang.String name)
          Check if the durable consumer exists.
 java.util.Vector getAllDestinations()
          Return a list of all registered destinations.
 int getDurableConsumerMessageCount(java.lang.String topic, java.lang.String name)
          Return the number of messages for a durable consumer.
 java.util.Vector getDurableConsumers(java.lang.String topic)
          Return the collection of durable consumer names for a particular topic destination.
protected  Logger getLogger()
          Return a reference to the logger
protected  PersistentAdapter getPersistentAdapter()
          Return a reference to the PersistentAdapter instance
 int getQueueMessageCount(java.lang.String queue)
          Return the number of messages for a queue
static JmsAdmin instance()
          Class method which returns the singleton instance of the JmsAdmin class
 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 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
 

Method Detail

instance

public static JmsAdmin instance()
Class method which returns the singleton instance of the JmsAdmin class
Returns:
JmsAdmin singleton instance

getDurableConsumerMessageCount

public int getDurableConsumerMessageCount(java.lang.String topic,
                                          java.lang.String name)
Return the number of messages for a durable consumer.
Parameters:
topic - name of the topic
name - consumer name
Returns:
int number of unsent or unacked messages
Throws:
java.rmi.RemoteException -  

getQueueMessageCount

public int getQueueMessageCount(java.lang.String queue)
Return the number of messages for a queue
Parameters:
queue - name of the queue
Returns:
int number of unsent or unacked messages
Throws:
java.rmi.RemoteException -  

addDurableConsumer

public boolean addDurableConsumer(java.lang.String topic,
                                  java.lang.String name)
Add a durable consumer for the specified name the passed in name
Parameters:
topic - name of the destination
name - name of the consumer
Returns:
boolean true if successful

removeDurableConsumer

public boolean removeDurableConsumer(java.lang.String name)
Remove the consumer attached to the specified destination and with the passed in name
Parameters:
topic - name of the destination
name - name of the consumer
Returns:
boolean true if successful

durableConsumerExists

public boolean durableConsumerExists(java.lang.String name)
Check if the durable consumer exists.
Parameters:
name - name of the durable conusmer
Returns:
boolean true if it exists and false otherwise

getDurableConsumers

public java.util.Vector getDurableConsumers(java.lang.String topic)
Return the collection of durable consumer names for a particular topic destination.
Parameters:
topic - the topic name
Returns:
Vector collection of strings

unregisterConsumer

public boolean unregisterConsumer(java.lang.String name)
De-Activate an active persistent consumer.
Parameters:
name - name of the consumer
Returns:
boolean true if successful

isConnected

public boolean isConnected(java.lang.String name)
Check to see if the given consumer is currently connected to the OpenJMSServer. This is only valid when in online mode.
Parameters:
name - The name of the onsumer.
Returns:
boolean True if the consumer is connected.

getAllDestinations

public java.util.Vector getAllDestinations()
Return a list of all registered destinations.
Returns:
Vector collection of strings

addDestination

public boolean addDestination(java.lang.String name,
                              java.lang.Boolean queue)
Add an administered destination with the specified name
Parameters:
name - destination name
queue - whether it is queue or a topic
Returns:
boolean true if successful

removeDestination

public boolean removeDestination(java.lang.String name)
Destroy the specified destination and all associated messsages and consumers. This is a very dangerous operation to execute while there are clients online
Parameters:
destination - destination to destroy

purgeMessages

public int purgeMessages()
Purge all processed messages from the database
Returns:
int number of messages purged

getLogger

protected Logger getLogger()
Return a reference to the logger
Returns:
Logger

getPersistentAdapter

protected PersistentAdapter getPersistentAdapter()
Return a reference to the PersistentAdapter instance
Returns:
PersistentAdapter


Copyright � 2002 Macromedia Corporation. All Rights Reserved.