Websphere MQ Everyplace

examples.administration.commandline
Class MQeAbstractCmdLineAdminTool

java.lang.Object
  |
  +--examples.administration.commandline.MQeAbstractCmdLineAdminTool
Direct Known Subclasses:
ConnectionCreator, HomeServerQueueCreator, IniFileCreator, IsQueueManagerBridgeCapable, ListenerCreate, ListenerDelete, ListenerInquire, ListenerSetMaxChannels, ListenerStart, ListenerStop, LocalQueueCreator, MQBridgeCreator, MQBridgeQueueCreator, MQConnectionCreator, MQListenerCreator, MQQMgrProxyCreator, QueueDelete, QueueInquire, QueueManagerUpdater, RemoteQueueCreator, SendTestMessage, SendTestMessage, StoreAndForwardQueueCreator, StoreAndForwardQueueQMgrAdder

public class MQeAbstractCmdLineAdminTool
extends java.lang.Object

A concrete super-class of all the MQe command-line admin tools.

Some common methods and utility functions are implemented in this class

Command-line MQe administration tools inherit from this class


Field Summary
static java.lang.String ADMIN_Q_NAME
          The queue to which the admin message is sent.
static java.lang.String REPLY_TO_Q
          The queue to which the admin reply should be sent.
static int TIMEOUT_MILLISECS
          The tool will wait for an admin reply message to appear on the reply queue for a set timeout period.
static short[] version
           
 
Constructor Summary
MQeAbstractCmdLineAdminTool()
           
 
Method Summary
static boolean checkAdminReply(MQeAdminMsg replyMsg)
          checkAdminReply() Check to see if a good reply was received.
static MQeFields primeAdminMsg(java.lang.String onQMgr, MQeAdminMsg msg)
          primeAdminMsg() Prime an admin message.
static MQeAdminMsg processAdminMsg(MQeQueueManager myQMgr, java.lang.String onQMgr, MQeAdminMsg msg, MQeFields filter)
          processAdminMsg() Send the admin message, and wait for a repy.
static MQeFields sendWaitMessage(MQeQueueManager myQMgr, java.lang.String targetQMgrName, MQeAdminMsg msg)
          To put the specified message to the Admin Q on the specified MQe queue manager and get a response.
 
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

ADMIN_Q_NAME

public static java.lang.String ADMIN_Q_NAME
The queue to which the admin message is sent.


REPLY_TO_Q

public static java.lang.String REPLY_TO_Q
The queue to which the admin reply should be sent.


TIMEOUT_MILLISECS

public static int TIMEOUT_MILLISECS
The tool will wait for an admin reply message to appear on the reply queue for a set timeout period.

Constructor Detail

MQeAbstractCmdLineAdminTool

public MQeAbstractCmdLineAdminTool()
Method Detail

sendWaitMessage

public static MQeFields sendWaitMessage(MQeQueueManager myQMgr,
                                        java.lang.String targetQMgrName,
                                        MQeAdminMsg msg)
                                 throws java.lang.Exception
To put the specified message to the Admin Q on the specified MQe queue manager and get a response.

Parameters:
myQMgr - A reference to an active MQe queue manager, which will be used send and receive MQe administration messages.
targetQMgrName - The name of the queue manager to which the message will be sent.
msg - The message we will send to the target queue manager, and await a response.
Returns:
The MQeFields response that the reply message contains
Throws:
java.lang.Exception - fails it the reply indicates the Admin message caused a failure, or if there was a failure posting the message.

processAdminMsg

public static MQeAdminMsg processAdminMsg(MQeQueueManager myQMgr,
                                          java.lang.String onQMgr,
                                          MQeAdminMsg msg,
                                          MQeFields filter)
                                   throws java.lang.Exception
processAdminMsg() Send the admin message, and wait for a repy. An exception is thrown if there is an error

Parameters:
myQMgr - A reference to an active MQe queue manager, which will be used to send and receive administration messages.
onQMgr - - the name of the queue manager where the message will be sent.
msg - - the admin message to send
filter - - an mqefields object that allows request and reply messages to be correlated.
Returns:
replyMsg returns the message received in response to the admin request or null if none was returned.
java.lang.Exception

checkAdminReply

public static boolean checkAdminReply(MQeAdminMsg replyMsg)
                               throws java.lang.Exception
checkAdminReply() Check to see if a good reply was received. If not detail the error(s) that occured and then throw an exception.

Parameters:
replyMsg - MQeAdminMsg - reply message to check
Returns:
boolean true if good
java.lang.Exception

primeAdminMsg

public static MQeFields primeAdminMsg(java.lang.String onQMgr,
                                      MQeAdminMsg msg)
                               throws java.lang.Exception
primeAdminMsg() Prime an admin message. Sets the admin message with items such as who to reply to along with a unique identifier that can be used to check for a matching response.

Parameters:
onQMgr - - the name of the queue manager where the message will be sent.
msg - - the admin message to prime
Returns:
MQeFields - a unique identifier for this request
java.lang.Exception

Websphere MQ Everyplace