ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » INQUIRE_AUTH_RECS is not working

Post new topic  Reply to topic
 INQUIRE_AUTH_RECS is not working « View previous topic :: View next topic » 
Author Message
Sunil
PostPosted: Sun Aug 17, 2008 8:49 am    Post subject: INQUIRE_AUTH_RECS is not working Reply with quote

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
View user's profile Send private message
PhilBlake
PostPosted: Mon Aug 18, 2008 2:25 am    Post subject: Reply with quote

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
View user's profile Send private message
Sunil
PostPosted: Wed Aug 27, 2008 9:32 pm    Post subject: Reply with quote

Novice

Joined: 20 May 2008
Posts: 11

Thanks Phil. The soulution suggested by you worked.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » INQUIRE_AUTH_RECS is not working
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.