Handling PCF messages with IBM MQ classes for Java

Java classes are provided to create and parse PCF-structured messages, and to facilitate sending PCF requests and collecting PCF responses.

Classes PCFMessage & MQCFGR represent arrays of PCF parameter structures. They provide convenience methods for adding and retrieving PCF parameters.

PCF parameter structures are represented by the classes MQCFH, MQCFIN, MQCFIN64, MQCFST, MQCFBS, MQCFIL, MQCFIL64 MQCFSL, and MQCFGR. These share basic operational interfaces:
  • Methods to read and write message content: read (), write (), and size ()
  • Methods to manipulate parameters: getValue (), setValue (), getParameter () and others
  • The enumerator method .nextParameter (), which parses PCF content in an MQMessage
The PCF filter parameter is used in inquire commands to provide a filter function. It in encapsulated in the following classes:
  • MQCFIF - integer filter
  • MQCFSF - string filter
  • MQCFBF - byte filter

Two agent classes, PCFAgent and PCFMessageAgent are provided to manage the connection to a Queue Manager, the command server queue, and an associated response queue. PCFMessageAgent extends PCFAgent and should normally be used in preference to it. The PCFMessageAgent class converts the received MQMessages and passes them back to the caller as a PCFMessage array. PCFAgent returns an array of MQMessages, which you have to parse before use.