You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Joan Bellver Faus <jb...@dsic.upv.es> on 2010/03/01 13:19:15 UTC

Re: Recharging ACL file from Java Client

Quoting Carl Trieloff <cc...@redhat.com>:

>
>
> yes, place the new file and then there is a QMF method that can be  
> called to relaod
> the ACL.  If the new ACL file has errors, the old files runs will  
> stay in place.
>
Hi,

I tried to use the library org.apache.qpid.console to access the class  
session and be able to use the acl package but  appears only the  
package broker, therefore i can only make use of the functions for the  
broker, but not for the acl, you give me a more definite idea of how  
to use methods for the acl from a java client?

thank you,



> The methods can be called via qpid-tool.
> Carl.
>
>
>
> On 02/26/2010 11:51 AM, Joan Bellver Faus wrote:
>>
>> Hi,
>>
>> is there any way to recharge the ACL file while the Broker is  
>> running using a Java Client?
>>
>> We are using the C++ Broker (version 0.5) and the Java client  
>> (trunk version).
>>
>> We have tested that this can be done using the python client, but  
>> we do not find the way to do it using the java client. We have  
>> tried using qman-jmx and qman ws-dm.
>>
>> Thank you,
>> Joan
>>
>> ----------------------------------------------------------------
>> This message was sent using IMP, the Internet Messaging Program.
>>
>>
>>
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project:      http://qpid.apache.org
>> Use/Interact: mailto:users-subscribe@qpid.apache.org
>>
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Recharging ACL file from Java Client

Posted by Carl Trieloff <cc...@redhat.com>.
On 03/02/2010 09:16 AM, Joan Bellver Faus wrote:
> Hello, thank you for your contribution, but i only was interested in 
> using Java code, not python, or tools such as qpid-tool, in any case 
> thank you very much.
>
> Finally i think i have solved the problem, my example code, by if 
> someone could also serve, is:
>
>         ArrayList<QMFObject> qmf = new ArrayList<QMFObject>();
>
>         Session sess = new Session();
>         
> sess.addBroker("amqp://guest:guest@/test?brokerlist='tcp://host.domain:port'"); 
>
>
>         HashMap<String, Object> hash = new HashMap<String, Object>();
>         hash.put("_class", "acl");
>         qmf = sess.getObjects(hash);
>
>         MethodResult me = qmf.get(0).invokeMethod("reloadACLFile","");
>
>
> Note that the broker have loaded the acl file.


ack,

Carl.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Recharging ACL file from Java Client

Posted by Joan Bellver Faus <jb...@dsic.upv.es>.
Hello, thank you for your contribution, but i only was interested in  
using Java code, not python, or tools such as qpid-tool, in any case  
thank you very much.

Finally i think i have solved the problem, my example code, by if  
someone could also serve, is:

		ArrayList<QMFObject> qmf = new ArrayList<QMFObject>();

		Session sess = new Session();
		sess.addBroker("amqp://guest:guest@/test?brokerlist='tcp://host.domain:port'");

		HashMap<String, Object> hash = new HashMap<String, Object>();
		hash.put("_class", "acl");
		qmf = sess.getObjects(hash);

		MethodResult me = qmf.get(0).invokeMethod("reloadACLFile","");


Note that the broker have loaded the acl file.


>
>
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Recharging ACL file from Java Client

Posted by Carl Trieloff <cc...@redhat.com>.
On 03/01/2010 09:10 AM, Joan Bellver Faus wrote:
> Quoting Carl Trieloff <cc...@redhat.com>:
>
>> On 03/01/2010 07:19 AM, Joan Bellver Faus wrote:
>>> Quoting Carl Trieloff <cc...@redhat.com>:
>>>
>>>>
>>>>
>>>> yes, place the new file and then there is a QMF method that can be 
>>>> called to relaod
>>>> the ACL.  If the new ACL file has errors, the old files runs will 
>>>> stay in place.
>>>>
>>> Hi,
>>>
>>> I tried to use the library org.apache.qpid.console to access the 
>>> class session and be able to use the acl package but  appears only 
>>> the package broker, therefore i can only make use of the functions 
>>> for the broker, but not for the acl, you give me a more definite 
>>> idea of how to use methods for the acl from a java client?
>>>
>>> thank you,
>>
>>
>> Can you make sure it does what you are looking for from qpid-tool first.
>
> I do not understand that you mean with this, there is any example or 
> test for that i can guide? thanks.
>
> if it does I will point you to how to


run qpid-tool under the python commands in 0.5

at the prompt type help.

schema
schema acl
list acl

call {id} reloadACLFile


---------------------------------

<class name="Acl">
<property name="brokerRef"     type="objId"   
references="org.apache.qpid.broker:Broker" access="RO" index="y" 
parentRef="y"/>
<property name="policyFile"    type="sstr"    access="RO"    desc="Name 
of the policy file"/>
<property name="enforcingAcl"  type="bool"    access="RO"    
desc="Currently Enforcing ACL"/>
<property name="transferAcl"   type="bool"    access="RO"    desc="Any 
transfer ACL rules in force"/>
<property name="lastAclLoad"   type="absTime" access="RO"    
desc="Timestamp of last successful load of ACL"/>
<statistic name="aclDenyCount" type="count64" unit="request" 
desc="Number of ACL requests denied"/>

<method name="reloadACLFile" desc="Reload the ACL file"/>
</class>






---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Recharging ACL file from Java Client

Posted by Joan Bellver Faus <jb...@dsic.upv.es>.
Quoting Carl Trieloff <cc...@redhat.com>:

> On 03/01/2010 07:19 AM, Joan Bellver Faus wrote:
>> Quoting Carl Trieloff <cc...@redhat.com>:
>>
>>>
>>>
>>> yes, place the new file and then there is a QMF method that can be  
>>> called to relaod
>>> the ACL.  If the new ACL file has errors, the old files runs will  
>>> stay in place.
>>>
>> Hi,
>>
>> I tried to use the library org.apache.qpid.console to access the  
>> class session and be able to use the acl package but  appears only  
>> the package broker, therefore i can only make use of the functions  
>> for the broker, but not for the acl, you give me a more definite  
>> idea of how to use methods for the acl from a java client?
>>
>> thank you,
>
>
> Can you make sure it does what you are looking for from qpid-tool first.

I do not understand that you mean with this, there is any example or  
test for that i can guide? thanks.

if it does I will point you to how to
> do it with the POJO objects from Java client.
>
> Carl.
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: Recharging ACL file from Java Client

Posted by Carl Trieloff <cc...@redhat.com>.
On 03/01/2010 07:19 AM, Joan Bellver Faus wrote:
> Quoting Carl Trieloff <cc...@redhat.com>:
>
>>
>>
>> yes, place the new file and then there is a QMF method that can be 
>> called to relaod
>> the ACL.  If the new ACL file has errors, the old files runs will 
>> stay in place.
>>
> Hi,
>
> I tried to use the library org.apache.qpid.console to access the class 
> session and be able to use the acl package but  appears only the 
> package broker, therefore i can only make use of the functions for the 
> broker, but not for the acl, you give me a more definite idea of how 
> to use methods for the acl from a java client?
>
> thank you,


Can you make sure it does what you are looking for from qpid-tool first. 
if it does I will point you to how to
do it with the POJO objects from Java client.

Carl.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org