directory-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierre-Arnaud Marcelot ...@marcelot.net>
Subject Re: Parsing response control
Date Thu, 14 Jun 2012 13:13:37 GMT
Cool. :)

Thanks for letting us know.

The "system property solution" needs to be set very early (before the LDAP API Service is
first initialized), while the "service.registerControl(…) solution" is a little more flexible
and can be set at any point in time (of course it will only work for responses received after
it has been configured).

Regards,
Pierre-Arnaud

On 14 juin 2012, at 14:50, Raphaël Ouazana-Sustowski wrote:

> Thank you very much, both ways finally work fine if I use them early enough.
> 
> By both ways I mean with System.setProperty and with registerControl.
> 
> Regards,
> Raphaël Ouazana.
> 
> On Thu, 14 Jun 2012 14:41:54 +0200, Pierre-Arnaud Marcelot wrote:
>> Small mistake in the previous code.
>> 
>> This should work much better (variable naming was not consistent):
>>> LdapApiService ldapApiService = LdapApiServiceFactory.getSingleton();
>>> 
>>> ControlFactory<?, ?> factory = new SyncStateValueFactory( ldapApiService
);
>>> ldapApiService.registerControl( factory );
>> 
>> Regards,
>> Pierre-Arnaud
>> 
>> On 14 juin 2012, at 14:36, Pierre-Arnaud Marcelot wrote:
>> 
>>> Hi Raphaël,
>>> 
>>> I'm not sure it will work but you could try to configure the LDAP API service
with the following code:
>>>> LdapApiService ldapApiService = LdapApiServiceFactory.getSingleton();
>>>> 
>>>> ControlFactory<?, ?> factory = new SyncStateValueFactory( codec );
>>>> codec.registerControl( factory );
>>> 
>>> 
>>> You need to insert that before sending or receiving any data.
>>> It should make the LDAP API Service aware of the SyncStateValueControl and allow
to create the correct instances of it.
>>> 
>>> Let us know if it succeeds (or not).
>>> 
>>> Regards,
>>> Pierre-Arnaud
>>> 
>>> On 14 juin 2012, at 14:02, Raphaël Ouazana-Sustowski wrote:
>>> 
>>>> Hi,
>>>> 
>>>> I'm using ApacheDS API to implement a SyncRepl client.
>>>> When I receive a Response, I get a BasicControlDecorator which decorates
an OpaqueControl, instead of a SyncStateValueControl.
>>>> 
>>>> Reading code, it seems I should load ExtrasBundleActivator, but I don't know
how I can do that.
>>>> Else I tried:
>>>> 
>>>> System.setProperty(
>>>> 	StandaloneLdapApiService.DEFAULT_CONTROLS_LIST,
>>>> 	"org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncStateValueFactory"
>>>> 	);
>>>> 
>>>> Which has been indicated here: http://mail-archives.apache.org/mod_mbox/directory-api/201106.mbox/%3CBANLkTikTTQLfM4eFxtATnzh%2BYFPPXoNQUA%40mail.gmail.com%3E
>>>> 
>>>> But this does not seem to work.
>>>> 
>>>> How can I get a correctly parsed response control?
>>>> 
>>>> Regards,
>>>> Raphaël Ouazana.
>>> 
> 


Mime
View raw message