Author |
Message
|
pcouas |
Posted: Sat Aug 17, 2019 12:40 am Post subject: Delete Authorisation not possible, but no error ? |
|
|
Voyager
Joined: 06 Sep 2011 Posts: 79
|
Hi
I tried to delete Autorisation with Java code on QManager V9 9.1.0.2 without succes !!
Code: |
private void remove(String queueName, String[] userNames, String qmanagerName, String hostname,Auth_QAFields.DefObjectTypeEnum type, Boolean forceQmanagerMQIACF,Integer port)
PCFMessageAgent pcfMessageAgent = null;
PCFMessage request = new PCFMessage(CMQCFC.MQCMD_DELETE_AUTH_REC);
request.addParameter(CMQCFC.MQCACF_AUTH_PROFILE_NAME,queueName);
request.addParameter(CMQCFC.MQIACF_OBJECT_TYPE, CMQC.MQOT_Q);
request.addParameter(CMQCFC.MQCACF_GROUP_ENTITY_NAMES, userNames);
if(forceQmanagerMQIACF){
//https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.ref.adm.doc/q087180_.htm
request.addParameter( CMQCFC.MQIACF_PURGE, CMQCFC.MQPO_YES ); //le parametre doit etre apres le nom du flux
}
pcfMessageAgent.send(request);
log.info("remove apres Send");
|
I have no errors, but record are not deleted, i could see it with MQMON tool ,?
Regards[/code]
Last edited by pcouas on Sat Aug 17, 2019 10:45 pm; edited 1 time in total |
|
Back to top |
|
 |
pcouas |
Posted: Sat Aug 17, 2019 10:41 pm Post subject: Re: Delete Authorisation not possible, but no error ? |
|
|
Voyager
Joined: 06 Sep 2011 Posts: 79
|
pcouas wrote: |
Hi
I have no errors no Java Exceptions, but record are not deleted, i could see it with MQMON tool authorisation is still exst ,?
Regards[/code] |
|
|
Back to top |
|
 |
hughson |
Posted: Sun Aug 18, 2019 12:59 am Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
Please show the output of the display (either MO71 screenshot or MQSC output) of the record that you are trying to delete but it still remains there. Seeing it will help us to advice you how to change your code.
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
 |
pcouas |
Posted: Sun Aug 18, 2019 10:03 pm Post subject: |
|
|
Voyager
Joined: 06 Sep 2011 Posts: 79
|
Hi
Code and image after code is running
Regards
Code: |
String[] usernNamesx=new String[]{"mqm"};
PCFMessage request = new PCFMessage(CMQCFC.MQCMD_DELETE_AUTH_REC);
request.addParameter(CMQCFC.MQCACF_AUTH_PROFILE_NAME, "AATOTO3");
request.addParameter(CMQCFC.MQIACF_OBJECT_TYPE, CMQC.MQOT_Q);
request.addParameter(CMQCFC.MQCACF_GROUP_ENTITY_NAMES, usernNamesx);
|
[img]
https://i.postimg.cc/J7sdGNyz/aatoto3-Capture.png
[/img]
[url]
https://postimg.cc/rzL9HtCB
[/url] |
|
Back to top |
|
 |
hughson |
Posted: Sun Aug 18, 2019 10:15 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
Thank you for posting the image of a screenshot of your MO71 output. It didn't show up in your post (I think because you have newline characters inside your img tags), but I saw it when I started to reply. For others reading this thread, here is the image:-
This image shows that you are trying to remove an authority record for the mqm group. It is not possible to do this. That is why it is not working. The authorities that are in place for the mqm group are burnt into the queue manager and cannot be removed.
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
 |
pcouas |
Posted: Sun Aug 18, 2019 10:20 pm Post subject: |
|
|
Voyager
Joined: 06 Sep 2011 Posts: 79
|
Hi,
But i can do it with MQMON tool "Delete" option ? |
|
Back to top |
|
 |
pcouas |
Posted: Sun Aug 18, 2019 10:27 pm Post subject: |
|
|
Voyager
Joined: 06 Sep 2011 Posts: 79
|
I have created this record with Java Code , but il could not delete with Java code ! |
|
Back to top |
|
 |
pcouas |
Posted: Sun Aug 18, 2019 10:34 pm Post subject: |
|
|
Voyager
Joined: 06 Sep 2011 Posts: 79
|
Ok if i replace "mqm" user by "test" user, i could delete Authority with Java code ! |
|
Back to top |
|
 |
hughson |
Posted: Sun Aug 18, 2019 10:40 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
pcouas wrote: |
Hi,
But i can do it with MQMON tool "Delete" option ? |
It is not possible to delete mqm group records with any tool - as I said they are burnt into the queue manager at creation.
pcouas wrote: |
I have created this record with Java Code , but il could not delete with Java code ! |
You did not create the record in the screenshot with your Java Code, it already existed as soon as the queue called AATOTO3 was created.
pcouas wrote: |
Ok if i replace "mqm" user by "test" user, i could delete Authority with Java code ! |
Yes, you can certainly manipulate authority records for groups (or users if you have a queue manager that can have user records) that are not mqm. If you still have the same problem with your code, please again post us a display of the record that is still there after you try to delete it and we will help further.
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
 |
pcouas |
Posted: Sun Aug 18, 2019 11:15 pm Post subject: |
|
|
Voyager
Joined: 06 Sep 2011 Posts: 79
|
I confirm you than i could create AUTHORITY record with user "mqm" with my Java code
Code: |
PCFMessage request = new PCFMessage(CMQCFC.MQCMD_SET_AUTH_REC);
request.addParameter(CMQCFC.MQCACF_AUTH_PROFILE_NAME,objet.getName());
request.addParameter(CMQCFC.MQIACF_OBJECT_TYPE, objet.getDefObjectType().getValue());
log.info("DefObjectTypeEnumc:"+ objet.getDefObjectType().getValue());
if(!KEEP_CURRENT_AUTH_WHEN_UPDATE){
request.addParameter(CMQCFC.MQIACF_AUTH_REMOVE_AUTHS, new int[]{CMQCFC.MQAUTH_ALL});
}
request.addParameter(CMQCFC.MQIACF_AUTH_ADD_AUTHS, getAuthMapping(objet)); //on prend les droits de la table
request.addParameter(CMQCFC.MQCACF_GROUP_ENTITY_NAMES, new String[]{objet.getUser()});
pcfMessageAgent = openNewPCFMessageAgent( qmanagerName, hostname,port);
pcfMessageAgent.setWaitInterval(Math.max( pcfMessageAgent.getWaitInterval(), pcfint)); // tewenty the default wait time en secondes Pb de creation
//attention le user unix doit deja exister dans /etc/passwd pour que la commande PCF fonctionne
log.info("Création de l'authentification sur la file avant send " +objet.getName()+" du user " + objet.getUser()+ " sur "+qmanagerName);
pcfMessageAgent.send(request);
log.info("Création de l'authentification sur la file apres send " +objet.getName()+" du user " + objet.getUser()+ " sur "+qmanagerName);
|
|
|
Back to top |
|
 |
hughson |
Posted: Mon Aug 19, 2019 1:32 am Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
pcouas wrote: |
I confirm you than i could create AUTHORITY record with user "mqm" with my Java code |
And I will repeat, the mqm group already has ALL authorities to ALL objects. There is nothing that you can create that wasn't already there.
Please check what is there before you run your code, and look what is different after you run your code. You will find that nothing has changed.
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
 |
|