Websphere MQ Everyplace

examples.administration.commandline
Class ConnectionCreator

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

public class ConnectionCreator
extends MQeAbstractCmdLineAdminTool

A command-line tool to allow someone to add a connection to an MQe queue manager without programming anything in Java.

Syntax

java examples.administration.commandline.ConnectionCreator <connectionName> <qMgr> <adapter> <channel> <ini_file>

connectionName
The name of connection which is to be created.
qMgr
The MQe queue manager to which the connection will be added. Normally this would be the same as the queue manager that this example runs.
adapter
The adapter definition, describing how the connection is to be made. This will be of the form Network:hostName:portNumber normally. If you wish the adapter to be a "null" adapter, then use a value of "null" here.

channel
The name of the channel class (or a class alias) which will be used to establish the connection. If you wish to have a null channel, then use the special value of "null" here.
iniFile
The fully qualified path of the .ini file used by this tool to instantiate a device queue manager, send the admin message, and wait for the reply.

Examples

This tool would normally be used to create a straight connection from the device queue manager to a server queue manager for example: ...ConnectionCreator MyServerQM MyDeviceQM Network:MyServer:MyServersPort DefaultChannel C:\MQe\...\MyDeviceQM.ini

It can also be used to create a "via" routing... where the MyServer2QM is sent messages via MyServerQM... ...ConnectionCreator MyServer2QM MyDeviceQM MyServerQM DefaultChannel C:\MQe\...\MyDeviceQM.ini

It can also be used to create a peer channel listener on the device queue manager, say for port 8085... ...ConnectionCreator MyDeviceQM MyDeviceQM Network::8085 com.ibm.mqe.MQePeerChannel C:\MQe\...\MyDeviceQM.ini


Field Summary
static short[] version
           
 
Fields inherited from class examples.administration.commandline.MQeAbstractCmdLineAdminTool
ADMIN_Q_NAME, REPLY_TO_Q, TIMEOUT_MILLISECS
 
Constructor Summary
ConnectionCreator()
           
 
Method Summary
 void activate(java.lang.String[] args)
          Does all the work.
static void createConnection(java.lang.String connection, java.lang.String adapter, java.lang.String channel, java.lang.String targetQMgr, MQeQueueManager myQMgr)
          Creates an admin message which will cause a connection definition to be created 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

ConnectionCreator

public ConnectionCreator()
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.
Returns:
void

activate

public void activate(java.lang.String[] args)
              throws java.lang.Exception
Does all the work.

Parameters:
args - Command-line arguments to be used.
Returns:
void
Throws:
java.lang.Exception

createConnection

public static void createConnection(java.lang.String connection,
                                    java.lang.String adapter,
                                    java.lang.String channel,
                                    java.lang.String targetQMgr,
                                    MQeQueueManager myQMgr)
                             throws java.lang.Exception
Creates an admin message which will cause a connection definition to be created then it sends it to a queue manager.

Parameters:
connection - The name of the connection definition to be created.
adapter - The adapter definition, describing how the connection is to be made. This will be of the form Network:hostName:portNumber normally. If you wish the adapter to be a "null" adapter, then use a value of "null" here.
channel - The name of the channel class (or a class alias) which will be used to establish the connection. If you wish to have a null channel, then use the special value of "null" here.
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:
void
Throws:
java.lang.Exception

Websphere MQ Everyplace