Search code examples
javaibm-mqpcf

Get Websphere MQ object authorizations via PCF


Need to get the complete list of authorizations for MQ object (typically a queue), like the one returned by dspmqaut command, but with PCF.

Any idea how this could be done?

I believe this should be possible, as soon as MQ Explorer, supposed to operate with PCF, enables such function.

UPDATE

Need to do that in java, the regular attributes of the queue are already received without a problem (MQCMD_INQUIRE_Q, MQCMD_INQUIRE_Q_STATUS, etc.)

FOLLOW UP to Josh comment, finally worked with the code below

PCFMessage request = new PCFMessage(MQConstants.MQCMD_INQUIRE_AUTH_RECS);
request.addParameter(MQConstants.MQIACF_AUTH_OPTIONS, MQConstants.MQAUTHOPT_ENTITY_EXPLICIT+MQConstants.MQAUTHOPT_NAME_ALL_MATCHING+MQConstants.MQAUTHOPT_NAME_AS_WILDCARD);
request.addParameter(MQConstants.MQIACF_OBJECT_TYPE, MQConstants.MQOT_Q);
request.addParameter(MQConstants.MQCACF_AUTH_PROFILE_NAME, "*");
request.addParameter(MQConstants.MQIACF_AUTH_PROFILE_ATTRS, MQConstants.MQIACF_ALL);

Solution

  • The documentation is located in the IBM MQ Knowledge Center. You can find the v9.0 KC page Reference > Administration reference > Programmable command formats reference > Definitions of the Programmable Command Formats > Inquire Authority Records on Multiplatforms.

    For examples of usage I did a git search for MQCMD_INQUIRE_AUTH_RECS for Java which brings up brings up a couple of examples. Take away the language restriction and you will have more examples, the PCF concept is the same across all languages.