Return-Path: X-Original-To: apmail-directory-api-archive@minotaur.apache.org Delivered-To: apmail-directory-api-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C65919D07 for ; Thu, 14 Jun 2012 13:14:08 +0000 (UTC) Received: (qmail 34608 invoked by uid 500); 14 Jun 2012 13:14:08 -0000 Delivered-To: apmail-directory-api-archive@directory.apache.org Received: (qmail 34578 invoked by uid 500); 14 Jun 2012 13:14:08 -0000 Mailing-List: contact api-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: api@directory.apache.org Delivered-To: mailing list api@directory.apache.org Received: (qmail 34569 invoked by uid 99); 14 Jun 2012 13:14:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jun 2012 13:14:08 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of pajbam@gmail.com designates 74.125.82.44 as permitted sender) Received: from [74.125.82.44] (HELO mail-wg0-f44.google.com) (74.125.82.44) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jun 2012 13:14:00 +0000 Received: by wgbdr13 with SMTP id dr13so1900761wgb.1 for ; Thu, 14 Jun 2012 06:13:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=ChFsgDey+AXKHlgQd40oPv/lct9Xv0ovaBtKWNolCYw=; b=JKJvps1p0OahhN2PMPKIccTa+L8gWhVgVfAihdg62rQmBu7rbrX/heDN0OPr3opvzs aMq4wPKu8UXE1Rfe8QZ/Lcstkb6qL0kRZczy4MQhUznnQf5c4yJBBosLJyp9jgFzrzax vjF9iUt8n8bd5Iy7zQyEnsx+VnZz0QxioQrX/mIDXlrvBNbW7txMXpoOqbFfMjSjKj15 Flv08yCpTkxvSKlvZjK6U3mWu6MftAEfGJRkV5hqdiy3gypByX1uJjrLAiLXDvybX61n 9bH682a8OsYxH+G4I/UjZn+QlQNYH6JU7v96S3drenmuJ9haXwxJgpM84TYntVQobvlJ +zTQ== Received: by 10.180.24.103 with SMTP id t7mr46591445wif.16.1339679619309; Thu, 14 Jun 2012 06:13:39 -0700 (PDT) Received: from [192.168.0.11] (lon92-10-78-226-4-211.fbx.proxad.net. [78.226.4.211]) by mx.google.com with ESMTPS id db7sm18662312wib.6.2012.06.14.06.13.38 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 14 Jun 2012 06:13:38 -0700 (PDT) Sender: Pierre-Arnaud Marcelot Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Apple Message framework v1278) Subject: Re: Parsing response control From: Pierre-Arnaud Marcelot In-Reply-To: Date: Thu, 14 Jun 2012 15:13:37 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <5f0cfd7923ab9f90724050867a2f8755@linagora.com> <527C673E-2A48-4419-91F2-D15766B1B910@marcelot.net> To: api@directory.apache.org, =?iso-8859-1?Q?Rapha=EBl_Ouazana-Sustowski?= X-Mailer: Apple Mail (2.1278) X-Virus-Checked: Checked by ClamAV on apache.org 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(=85) 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=EBl Ouazana-Sustowski wrote: > Thank you very much, both ways finally work fine if I use them early = enough. >=20 > By both ways I mean with System.setProperty and with registerControl. >=20 > Regards, > Rapha=EBl Ouazana. >=20 > On Thu, 14 Jun 2012 14:41:54 +0200, Pierre-Arnaud Marcelot wrote: >> Small mistake in the previous code. >>=20 >> This should work much better (variable naming was not consistent): >>> LdapApiService ldapApiService =3D = LdapApiServiceFactory.getSingleton(); >>>=20 >>> ControlFactory factory =3D new SyncStateValueFactory( = ldapApiService ); >>> ldapApiService.registerControl( factory ); >>=20 >> Regards, >> Pierre-Arnaud >>=20 >> On 14 juin 2012, at 14:36, Pierre-Arnaud Marcelot wrote: >>=20 >>> Hi Rapha=EBl, >>>=20 >>> I'm not sure it will work but you could try to configure the LDAP = API service with the following code: >>>> LdapApiService ldapApiService =3D = LdapApiServiceFactory.getSingleton(); >>>>=20 >>>> ControlFactory factory =3D new SyncStateValueFactory( codec = ); >>>> codec.registerControl( factory ); >>>=20 >>>=20 >>> 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. >>>=20 >>> Let us know if it succeeds (or not). >>>=20 >>> Regards, >>> Pierre-Arnaud >>>=20 >>> On 14 juin 2012, at 14:02, Rapha=EBl Ouazana-Sustowski wrote: >>>=20 >>>> Hi, >>>>=20 >>>> 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. >>>>=20 >>>> Reading code, it seems I should load ExtrasBundleActivator, but I = don't know how I can do that. >>>> Else I tried: >>>>=20 >>>> System.setProperty( >>>> StandaloneLdapApiService.DEFAULT_CONTROLS_LIST, >>>> = "org.apache.directory.shared.ldap.extras.controls.syncrepl_impl.SyncStateV= alueFactory" >>>> ); >>>>=20 >>>> Which has been indicated here: = http://mail-archives.apache.org/mod_mbox/directory-api/201106.mbox/%3CBANL= kTikTTQLfM4eFxtATnzh%2BYFPPXoNQUA%40mail.gmail.com%3E >>>>=20 >>>> But this does not seem to work. >>>>=20 >>>> How can I get a correctly parsed response control? >>>>=20 >>>> Regards, >>>> Rapha=EBl Ouazana. >>>=20 >=20