This method is implemented in class examples.config.QueueManagerAdmin. It shows how to use the primitives in the BasicAdministration class to update a queue manager description, and to report the success of the action.
/** * Update the description field of the * specified queue manager to the specified * string. Use the supplied queueManager * reference as the access to the * MQe network. * * @param queueManager (MQeQueueManager): access point to the MQe network * @param queueManagerName (String): name of queue manager to modify * @param (String): new description for queue manager */ public static final boolean updateQueueManagerDescription( MQeQueueManager queueManager, String targetQueueManagerName, String description) throws Exception { // create administration message MQeQueueManagerAdminMsg msg = new MQeQueueManagerAdminMsg(); // request an update msg.setAction(MQeAdminMsg.Action_Update); // set the new value of the parameter //into the input fields in the message // the field name is the attribute name, // and the field value is the new // value of the attribute. The type is specified // by the administration message. // In this case, the field name is 'description', // the value is the new // description, an the type is Unicode. msg.getInputFields().putAscii( MQeQueueManagerAdminMsg.QMgr_Description, description); // set up for reply etc String uniqueTag = BasicAdministration.decorateAdminMsg( msg, targetQueueManagerName); // put the message to the right administration queue queueManager.putMessage(targetQueueManagerName, MQe.Admin_Queue_Name, msg, null, 0L); // wait for the reply message MQeAdminMsg reply = BasicAdministration.waitForRemoteAdminReply( queueManager, targetQueueManagerName, uniqueTag); return BasicAdministration.isSuccess(reply); }