Using the administrator handle

Once an Administrator Handle has been created, any of the mqeAdministrator calls can then be used. The calls are all of the form:

MQERETURN mqeAdministrator_Object_action(
                             MQeAdministratorHndl hAdministrator,
                             MQeExceptBlock*   pExceptBlock,
                             ...)
Where:
  • object is the type of object to be administered, for example, a queue manager, local queue, or synchronous remote queue
  • action is the operation to be performed, for example, create, delete, inquire, or update.
Note: Some actions are only available for some object types.

Example calls:

If NULL is used to create an MQeAdministratirHndl, the next administration API call can only be one of MQeAdministrator_free or MQeAdministrator_create_QueueManager. Once the queue manager has been created, all the administration APIs are available for use.

 mqeAdministrator_LocalQueue_create
/* create a local queue */

 mqeAdministrator_AdminQueue_inquire
/* inquire on a local queue */

Many of the APIs, particularly the inquire and update calls, have arguments which are structures containing multiple elements, some of which may or may not be filled in. In order to accommodate this functionality, such structures contain an element called "opFlags", a set of bits to indicate which elements of the structure are set. Also supplied are macros that initialize these opFlag structures to appropriate values, and macros for each bit that can be set.

For instance, if you wanted to inquire on a local queue but you were only interested in the description and the Maximum Message Size fields, then you would do the following:

MQeLocalQParms lqParms = LOCAL_Q_INIT_VAL;
lqParms.opFlags |= QUEUE_DESC_OP;
lqParms.opFlags |= QUEUE_MAX_MSG_SIZE_OP;
/* Note that the | function is being used */

/* call inquire function */

Similarly, if you wanted to test which elements are filled in when such a structure is returned from a function, you would do the following:

if(lqParms.opFlags & QUEUE_DESC_OP)
{ /* description is set*/
}
if(lqParms.opFlags & QUEUE_MAX_MSG_SIZE_OP)
{ /* max msg size is set*/
}

Terms of use | WebSphere software

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