org.exolab.jms.tools.admin
Class AbstractAdminConnection

java.lang.Object
  |
  +--org.exolab.jms.tools.admin.AbstractAdminConnection
Direct Known Subclasses:
OfflineConnection, OnlineConnection

public abstract class AbstractAdminConnection
extends java.lang.Object

The abstract class all AbstractAdminConnection objects must inherit from. Currently there are only two object types. OfflineConnection, for objects that directly connect to and use the persistency mechanism, and OnlineConnection objects that connect to an OpenJMSServer for all their requests.

Version:
$Revision: 1.1 $ $Date: 2004/11/26 01:51:14 $
Author:
Jim Mourikis
See Also:
OfflineConnection, OnlineConnection

Field Summary
protected static AbstractAdminConnection _instance
           
 
Constructor Summary
AbstractAdminConnection()
           
 
Method Summary
abstract  boolean addDestination(java.lang.String destination, boolean isQueue)
          Add a specific destination with the specified name
abstract  boolean addDurableConsumer(java.lang.String topic, java.lang.String name)
          Add a durable consumer for the specified name the passed in name
abstract  boolean addUser(java.lang.String username, java.lang.String password)
          Adds a new User to the DB.
abstract  boolean changePassword(java.lang.String username, java.lang.String password)
          Change the password for this user
abstract  void close()
          Close the connection.
abstract  boolean durableConsumerExists(java.lang.String name)
          Check if the durable consumer exists.
abstract  java.util.Enumeration getAllDestinations()
          Return a list of all registered destinations.
abstract  java.util.Enumeration getAllUsers()
          List all users in the DB
abstract  int getDurableConsumerMessageCount(java.lang.String topic, java.lang.String name)
          Return the number of outstanding messages for a particular destination.
abstract  java.util.Enumeration getDurableConsumers(java.lang.String destination)
          Return the collection of durable consumer names for a particular topic destination.
abstract  int getQueueMessageCount(java.lang.String queue)
          Return the number of outstanding messages for a particular queue.
static AbstractAdminConnection instance()
          Returns the one and only instance of the connection object.
abstract  boolean isConnected(java.lang.String name)
          Check to see if the given consumer is currently connected to the OpenJMSServer.
abstract  int purgeMessages()
          Purge all processed messages from the database.
abstract  boolean removeDestination(java.lang.String name)
          Destroy the specified destination and all associated messsages and consumers.
abstract  boolean removeDurableConsumer(java.lang.String name)
          Remove the consumer with the specified name
abstract  boolean removeUser(java.lang.String username)
          Remove a user from the DB.
abstract  void stopServer()
          Terminate the JMS Server.
abstract  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
 

Field Detail

_instance

protected static AbstractAdminConnection _instance
Constructor Detail

AbstractAdminConnection

public AbstractAdminConnection()
Method Detail

instance

public static AbstractAdminConnection instance()
Returns the one and only instance of the connection object.
Returns:
AdminConnection The one and only instance.

getDurableConsumerMessageCount

public abstract int getDurableConsumerMessageCount(java.lang.String topic,
                                                   java.lang.String name)
Return the number of outstanding messages for a particular destination.
Parameters:
topic - name of the topic
name - durable consumer name
Returns:
int message count

getQueueMessageCount

public abstract int getQueueMessageCount(java.lang.String queue)
Return the number of outstanding messages for a particular queue.
Parameters:
queue - the queue name
Returns:
int message count

addDurableConsumer

public abstract 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 abstract boolean removeDurableConsumer(java.lang.String name)
Remove the consumer with the specified name
Parameters:
name - name of the consumer
Returns:
boolean true if successful

getDurableConsumers

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

durableConsumerExists

public abstract 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

unregisterConsumer

public abstract 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 abstract 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 abstract java.util.Enumeration getAllDestinations()
Return a list of all registered destinations.
Returns:
Enumeration collection of JmsDestination objects

addDestination

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

removeDestination

public abstract 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

stopServer

public abstract void stopServer()
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

purgeMessages

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

close

public abstract void close()
Close the connection.

addUser

public abstract boolean addUser(java.lang.String username,
                                java.lang.String password)
Adds a new User to the DB.
Parameters:
username - the users name
password - the users password
Returns:
true if the user is added otherwise false

changePassword

public abstract boolean changePassword(java.lang.String username,
                                       java.lang.String password)
Change the password for this user
Parameters:
username - the users name
password - the users password
Returns:
true if the password is changed otherwise false

removeUser

public abstract boolean removeUser(java.lang.String username)
Remove a user from the DB.
Parameters:
username - the users name
Returns:
true if the user is removed otherwise false

getAllUsers

public abstract java.util.Enumeration getAllUsers()
List all users in the DB
Returns:
Enumeration of users


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