Configuring connection definitions in C

There is an important difference between administration available in C to that in Java™. The Java product relies solely on the administration message, C provides an administration API for the user to locally administer MQe. More information may be found abut the administration API in Configuring with the C administrator API, this chapter assumes you have already read the chapter on administration and know how to create an administrator handle and exception block used in the calls to the administration API. This example is in transport.c in the broker.dll for C.

Before we look at the individual functions providing the API to administer the connection definition, it will be worthwhile looking at the structure containing the information about the connection definition that is passed into all the functions requiring information, that is all except the function to delete the connection definition. The MQeConnectionDefinitionParms structure is as follows:

MQEVERSION         version;        
MQEINT32           opFlags;        
MQeStringHndl      hDescription;   
MQeStringHndl      hAdapterClass;  
MQeStringHndl *    phAdapterParms; 
MQEINT32           destParmLen;    
MQeStringHndl      hAdapterCommand;
MQeStringHndl      hChannelClass;  
MQeStringHndl      hViaQMName;     
Version
This is a field for internal use only and should not be set by the user.
opFlags
On input to a function this field provides bit flags indicating the areas of the resource that are to be administered. On output from a function if the action has been successful the flags will indicate the operations performed, if the action has failed the flags will indicate the failed component.
hDescription
The description for this connection definition.
hAdapterClass
The communications adapter class that will be used by this connection definition, currently there is just one communications adapter for C. In the MQe_Adapter_Constants.h header file there is a constant to define the class – MQE_HTTP_ADAPTER.
phAdapterParams
An array containing the network information required to connect to the remote queue manager. In an IP network this will contain the network address and IP port. The first element in the array is assumed to be the IP address, the second element is assumed to be the port number.
destParmLen
The length of the phAdapterParams array.
hAdapterCommand
This field may contain a servlet name to be included in an HTTP header.
hChannelClass
The class of channel to use, this should be set to MQE_CHANNEL_CLASS, defined in MQe_Connection_Constants.h
hViaQMName
If this connection definition defines a via connection then all other parameters should be null with this parameter containing the name of the via queue manager name.

A constant in MQe_Connection_Constant.h - CONNDEF_INIT_VAL will set the values of this structure to initial values which can then be altered as required.


Terms of use | WebSphere software

(c) Copyright IBM Corporation 2004, 2005. All rights reserved.