|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
INQUIRE_AUTH_RECS is not working |
« View previous topic :: View next topic » |
Author |
Message
|
Sunil |
Posted: Sun Aug 17, 2008 8:49 am Post subject: INQUIRE_AUTH_RECS is not working |
|
|
Novice
Joined: 20 May 2008 Posts: 11
|
Hi All,
Few days back I got the solution from this forum for INQUIRE_ENTITY_AUTH. Now I am getting error 3171 for INQUIRE_AUTH_RECS. The program snippet is given below. Any help would be appreciated.
package com.test;
import java.io.IOException;
import com.ibm.mq.MQException;
import com.ibm.mq.pcf.CMQC;
import com.ibm.mq.pcf.CMQCFC;
import com.ibm.mq.pcf.CMQZC;
import com.ibm.mq.pcf.PCFMessage;
import com.ibm.mq.pcf.PCFMessageAgent;
public class FetchAuthoritySample {
public void viewAuthorization() {
try
{
PCFMessageAgent agent;
// Connect a PCFAgent to the specified queue manager
agent = new PCFMessageAgent("192.168.1.175", Integer.parseInt("1414"),"S_dbdev");
System.out.println ("Connected.");
PCFMessage request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_AUTH_RECS);
request.addParameter(CMQCFC.MQIACF_AUTH_OPTIONS,CMQCFC.MQAUTHOPT_NAME_ALL_MATCHING);
request.addParameter(CMQCFC.MQIACF_AUTH_OPTIONS,CMQCFC.MQAUTHOPT_NAME_AS_WILDCARD);
request.addParameter(CMQCFC.MQIACF_OBJECT_TYPE, CMQC.MQOT_ALL);
request.addParameter(CMQCFC.MQIACF_ENTITY_TYPE, CMQZC.MQZAET_GROUP);
request.addParameter(CMQCFC.MQCACF_ENTITY_NAME, "mqm");
request.addParameter(CMQCFC.MQCACF_AUTH_PROFILE_NAME, "*");
PCFMessage [] responses = agent.send (request);
for (int i = 0; i < responses.length; i++)
{
PCFMessage response = responses [i];
int[] auth_int_array = (int[])response.getParameterValue (CMQCFC.MQIACF_AUTHORIZATION_LIST);
if (auth_int_array != null && auth_int_array.length > 0)
{
for (int authz_index=0;authz_index< auth_int_array.length;authz_index++)
{
int authz_int = auth_int_array[authz_index];
System.out.println("Authz " + authz_int);
}
}
}
// Disconnect
System.out.print ("Disconnecting... ");
agent.disconnect ();
System.out.println ("Done.");
}
catch (MQException mqe)
{
System.err.println (mqe);
}
catch (IOException ioe)
{
System.err.println (ioe);
}}
public static void main(String[] args) {
FetchAuthoritySample dispAuthz = new FetchAuthoritySample();
dispAuthz.viewAuthorization();
}}
Regards
Sunil |
|
Back to top |
|
 |
PhilBlake |
Posted: Mon Aug 18, 2008 2:25 am Post subject: |
|
|
 Acolyte
Joined: 25 Oct 2005 Posts: 64
|
Hi Sunil... you cannot have multiple MQIACF_AUTH_OPTIONS. You need to "and" them together .... so try
Code: |
request.addParameter(CMQCFC.MQIACF_AUTH_OPTIONS, CMQCFC.MQAUTHOPT_NAME_ALL_MATCHING
+ CMQCFC.MQAUTHOPT_NAME_AS_WILDCARD); |
but be carefull, not all options are valid with each other
Phil |
|
Back to top |
|
 |
Sunil |
Posted: Wed Aug 27, 2008 9:32 pm Post subject: |
|
|
Novice
Joined: 20 May 2008 Posts: 11
|
Thanks Phil. The soulution suggested by you worked. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|