Websphere MQ Everyplace

examples.administration.commandline
Class QueueDelete

java.lang.Object
  |
  +--examples.administration.commandline.MQeAbstractCmdLineAdminTool
        |
        +--examples.administration.commandline.QueueDelete

public class QueueDelete
extends MQeAbstractCmdLineAdminTool

A command-line tool to allow someone to delete a queue without programming anything in Java. This version uses the admin messages to send the request to either a local or a remote queue manager. It can be called from the command line or from a Java program. The tool can be used to delete all types of queue.

Syntax

java examples.administration.commandline.QueueDelete <queueName> <destinationQMgrOfQueue> <qMgr> <ini_file>

queue_name
the name of the queue to delete.
destinationQMgrOfQueue
is the name of the queue manager that hosts the queue. For local queues the local queue definition is hosted on the same queue manager as the local queue. For remote queues, the remote queue definition is normally hosted on a different queue manager to the destination queue.
qMgr
the name of the queue manager where the delete request will be sent. This is the queue manager where the delete action will be performed.
iniFile
The fully qualified path of the .ini file used by this tool to instantiate a queue manager, send the admin message, and wait for the reply. Works with MQe 1.x style .ini files.

Examples

Assume two queue manangers: 1) ClientQM 2) ServerQM. ServerQM has a local queue called OrderQ and ClientQM has a remote queue called OrderQ on ServerQM. If the delete requests are issued from ClientQM and ClientQM startup parameters are provided in ini file ClientQM.ini, the following invocations could be made:

To delete the remote queue definition on ClientQM from ClientQM issue
QueueDelete OrderQ ServerQM ClientQM C:\MQe\...\ClientQM.ini
To delete the local queue definition on ServerQM from ClientQM issue
QueueDelete OrderQ ServerQM ServerQM C:\MQe\...\ClientQM.ini


Field Summary
static short[] version
           
 
Fields inherited from class examples.administration.commandline.MQeAbstractCmdLineAdminTool
ADMIN_Q_NAME, REPLY_TO_Q, TIMEOUT_MILLISECS
 
Constructor Summary
QueueDelete()
           
 
Method Summary
 void activate(java.lang.String[] args)
          Gathers command-line parameters into variables, and calls the method which inquires on the queue.
static MQeFields deleteQueue(java.lang.String queueName, java.lang.String queueQMgrName, java.lang.String targetQMgr, MQeQueueManager myQMgr)
          Creates an admin message which will delete a queue and then it sends it to a queue manager.
static void main(java.lang.String[] args)
          Entry point from the command line.
 
Methods inherited from class examples.administration.commandline.MQeAbstractCmdLineAdminTool
checkAdminReply, primeAdminMsg, processAdminMsg, sendWaitMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static short[] version
Constructor Detail

QueueDelete

public QueueDelete()
Method Detail

main

public static void main(java.lang.String[] args)
Entry point from the command line.

Parameters:
args - Command-line arguments being passed in.

activate

public void activate(java.lang.String[] args)
              throws java.lang.Exception
Gathers command-line parameters into variables, and calls the method which inquires on the queue.

Parameters:
args -
Returns:
void
Throws:
java.lang.Exception

deleteQueue

public static MQeFields deleteQueue(java.lang.String queueName,
                                    java.lang.String queueQMgrName,
                                    java.lang.String targetQMgr,
                                    MQeQueueManager myQMgr)
                             throws java.lang.Exception
Creates an admin message which will delete a queue and then it sends it to a queue manager.

Parameters:
queueName - The name of the queue
queueQMgrName - The name of the queue manager that hosts the queue. For local queues the local queue definition is hosted on the same queue manager as the local queue. For remote queues, the remote queue definition is normally hosted on a different queue manager to the destination queue.
targetQMgr - The name of the queue manager to which the admin message will be sent.
myQMgr - The reference to an active MQe queue manager object, which will be used to send the admin message, and receive the reply.
Returns:
MQeFields contaning result
Throws:
java.lang.Exception

Websphere MQ Everyplace