org.exolab.jms.tools.admin
Class OnlineConnection

java.lang.Object
  |
  +--org.exolab.jms.tools.admin.AbstractAdminConnection
        |
        +--org.exolab.jms.tools.admin.OnlineConnection

public class OnlineConnection
extends AbstractAdminConnection

Connects to the OpenJMSServer for all updates and requests.

Note: The OpenJMSServer must be active and in a running state for this type of connection to succeed.

Version:
$Revision: 1.3 $ $Date: 2003/08/24 07:09:29 $
Author:
Jim Mourikis

Fields inherited from class org.exolab.jms.tools.admin.AbstractAdminConnection
_instance
 
Constructor Summary
OnlineConnection(java.awt.Component parent)
          Connect to the Admin Server
OnlineConnection(java.lang.String username, java.lang.String password)
          Connect to the Admin Server, special constructor to be able to stop the server
 
Method Summary
 boolean addDestination(java.lang.String destination, boolean isQueue)
          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)
          Adds a new User to the DB.
 boolean changePassword(java.lang.String username, java.lang.String password)
          Change the password for this user
 void close()
          Close the connection.
 boolean durableConsumerExists(java.lang.String name)
          Check if the durable consumer exists.
 java.util.Enumeration getAllDestinations()
          Return a list of all registered destinations.
 java.util.Enumeration getAllUsers()
          List all users in the DB
 int getDurableConsumerMessageCount(java.lang.String topic, java.lang.String name)
          Return the number of outstanding messages for a particular destination.
 java.util.Enumeration 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 destination)
          Destroy the specified destination and all associated messsages and consumers.
 boolean removeDurableConsumer(java.lang.String name)
          Remove the consumer with the specified name
 boolean removeUser(java.lang.String username)
          Remove a user from the DB.
 void stopServer()
          Terminate the JMS Server.
 boolean unregisterConsumer(java.lang.String name)
          De-Activate an active persistent consumer.
 
Methods inherited from class org.exolab.jms.tools.admin.AbstractAdminConnection
instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OnlineConnection

public OnlineConnection(java.awt.Component parent)
                 throws OnlineConnectionException
Connect to the Admin Server
Throws:
OnlineConnectionException - When online connection fails.

OnlineConnection

public OnlineConnection(java.lang.String username,
                        java.lang.String password)
                 throws OnlineConnectionException
Connect to the Admin Server, special constructor to be able to stop the server
Throws:
OnlineConnectionException - When online connection fails.
Method Detail

close

public void close()
Description copied from class: AbstractAdminConnection
Close the connection.
Overrides:
close in class AbstractAdminConnection

addDurableConsumer

public boolean addDurableConsumer(java.lang.String topic,
                                  java.lang.String name)
Description copied from class: AbstractAdminConnection
Add a durable consumer for the specified name the passed in name
Overrides:
addDurableConsumer in class AbstractAdminConnection
Following copied from class: org.exolab.jms.tools.admin.AbstractAdminConnection
Parameters:
topic - name of the destination
name - name of the consumer
Returns:
boolean true if successful

removeDurableConsumer

public boolean removeDurableConsumer(java.lang.String name)
Description copied from class: AbstractAdminConnection
Remove the consumer with the specified name
Overrides:
removeDurableConsumer in class AbstractAdminConnection
Following copied from class: org.exolab.jms.tools.admin.AbstractAdminConnection
Parameters:
name - name of the consumer
Returns:
boolean true if successful

unregisterConsumer

public boolean unregisterConsumer(java.lang.String name)
Description copied from class: AbstractAdminConnection
De-Activate an active persistent consumer.
Overrides:
unregisterConsumer in class AbstractAdminConnection
Following copied from class: org.exolab.jms.tools.admin.AbstractAdminConnection
Parameters:
name - name of the consumer
Returns:
boolean true if successful

isConnected

public boolean isConnected(java.lang.String name)
Description copied from class: AbstractAdminConnection
Check to see if the given consumer is currently connected to the OpenJMSServer. This is only valid when in online mode.
Overrides:
isConnected in class AbstractAdminConnection
Following copied from class: org.exolab.jms.tools.admin.AbstractAdminConnection
Parameters:
name - The name of the onsumer.
Returns:
boolean True if the consumer is connected.

getAllDestinations

public java.util.Enumeration getAllDestinations()
Description copied from class: AbstractAdminConnection
Return a list of all registered destinations.
Overrides:
getAllDestinations in class AbstractAdminConnection
Following copied from class: org.exolab.jms.tools.admin.AbstractAdminConnection
Returns:
Enumeration collection of JmsDestination objects

addDestination

public boolean addDestination(java.lang.String destination,
                              boolean isQueue)
Description copied from class: AbstractAdminConnection
Add a specific destination with the specified name
Overrides:
addDestination in class AbstractAdminConnection
Following copied from class: org.exolab.jms.tools.admin.AbstractAdminConnection
Parameters:
name - destination name
queue - whether it is queue or a topic
Returns:
boolean true if successful

getDurableConsumerMessageCount

public int getDurableConsumerMessageCount(java.lang.String topic,
                                          java.lang.String name)
Description copied from class: AbstractAdminConnection
Return the number of outstanding messages for a particular destination.
Overrides:
getDurableConsumerMessageCount in class AbstractAdminConnection
Following copied from class: org.exolab.jms.tools.admin.AbstractAdminConnection
Parameters:
topic - name of the topic
name - durable consumer name
Returns:
int message count

getQueueMessageCount

public int getQueueMessageCount(java.lang.String queue)
Description copied from class: AbstractAdminConnection
Return the number of outstanding messages for a particular queue.
Overrides:
getQueueMessageCount in class AbstractAdminConnection
Following copied from class: org.exolab.jms.tools.admin.AbstractAdminConnection
Parameters:
queue - the queue name
Returns:
int message count

durableConsumerExists

public boolean durableConsumerExists(java.lang.String name)
Description copied from class: AbstractAdminConnection
Check if the durable consumer exists.
Overrides:
durableConsumerExists in class AbstractAdminConnection
Following copied from class: org.exolab.jms.tools.admin.AbstractAdminConnection
Parameters:
name - name of the durable conusmer
Returns:
boolean true if it exists and false otherwise

getDurableConsumers

public java.util.Enumeration getDurableConsumers(java.lang.String topic)
Description copied from class: AbstractAdminConnection
Return the collection of durable consumer names for a particular topic destination.
Overrides:
getDurableConsumers in class AbstractAdminConnection
Following copied from class: org.exolab.jms.tools.admin.AbstractAdminConnection
Parameters:
topic - the topic name
Returns:
Vector collection of strings

removeDestination

public boolean removeDestination(java.lang.String destination)
Description copied from class: AbstractAdminConnection
Destroy the specified destination and all associated messsages and consumers. This is a very dangerous operation to execute while there are clients online
Overrides:
removeDestination in class AbstractAdminConnection
Following copied from class: org.exolab.jms.tools.admin.AbstractAdminConnection
Parameters:
destination - destination to destroy

purgeMessages

public int purgeMessages()
Description copied from class: AbstractAdminConnection
Purge all processed messages from the database.
Overrides:
purgeMessages in class AbstractAdminConnection
Following copied from class: org.exolab.jms.tools.admin.AbstractAdminConnection
Returns:
int the number of messages purged.

stopServer

public void stopServer()
Description copied from class: AbstractAdminConnection
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
Overrides:
stopServer in class AbstractAdminConnection

addUser

public boolean addUser(java.lang.String username,
                       java.lang.String password)
Description copied from class: AbstractAdminConnection
Adds a new User to the DB.
Overrides:
addUser in class AbstractAdminConnection
Following copied from class: org.exolab.jms.tools.admin.AbstractAdminConnection
Parameters:
username - the users name
password - the users password
Returns:
true if the user is added otherwise false

changePassword

public boolean changePassword(java.lang.String username,
                              java.lang.String password)
Description copied from class: AbstractAdminConnection
Change the password for this user
Overrides:
changePassword in class AbstractAdminConnection
Following copied from class: org.exolab.jms.tools.admin.AbstractAdminConnection
Parameters:
username - the users name
password - the users password
Returns:
true if the password is changed otherwise false

removeUser

public boolean removeUser(java.lang.String username)
Description copied from class: AbstractAdminConnection
Remove a user from the DB.
Overrides:
removeUser in class AbstractAdminConnection
Following copied from class: org.exolab.jms.tools.admin.AbstractAdminConnection
Parameters:
username - the users name
Returns:
true if the user is removed otherwise false

getAllUsers

public java.util.Enumeration getAllUsers()
Description copied from class: AbstractAdminConnection
List all users in the DB
Overrides:
getAllUsers in class AbstractAdminConnection
Following copied from class: org.exolab.jms.tools.admin.AbstractAdminConnection
Returns:
Enumeration of users


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