Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 87458 invoked from network); 19 Dec 2005 08:16:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Dec 2005 08:16:17 -0000 Received: (qmail 13227 invoked by uid 500); 19 Dec 2005 08:16:13 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 13124 invoked by uid 500); 19 Dec 2005 08:16:12 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 13111 invoked by uid 99); 19 Dec 2005 08:16:12 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Dec 2005 00:16:12 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of trustin@gmail.com designates 64.233.184.197 as permitted sender) Received: from [64.233.184.197] (HELO wproxy.gmail.com) (64.233.184.197) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Dec 2005 00:16:11 -0800 Received: by wproxy.gmail.com with SMTP id 57so975958wri for ; Mon, 19 Dec 2005 00:15:50 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=IugQSrfw5XIQXe9CaJsL8e+/h7pZRVRNoizbh1ujTerP6+OXbIfpgP0c+0914M1nCvXLDEI8Y+HJQ8KndZ44d9i94EunnI3bRjswx3t1bBHkx/lmj4JUHMKLNYI49JNk+9Dq0BsEESXhkn6XE095Wm0N++cy3dVDDD13XWuPzyk= Received: by 10.54.77.16 with SMTP id z16mr620160wra; Mon, 19 Dec 2005 00:15:50 -0800 (PST) Received: by 10.54.127.19 with HTTP; Mon, 19 Dec 2005 00:15:50 -0800 (PST) Message-ID: <768dcb2e0512190015r3765b09eu@mail.gmail.com> Date: Mon, 19 Dec 2005 17:15:50 +0900 From: Trustin Lee To: Apache Directory Developers List Subject: Re: Oids global access In-Reply-To: <1134004666.7846.136.camel@portable> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_22230_23968814.1134980150444" References: <452648305.1133998571050.JavaMail.jira@ajax.apache.org> <1134004666.7846.136.camel@portable> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_22230_23968814.1134980150444 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Emmanuel, 2005/12/8, Emmanuel Lecharny : > > Hi all, > > I have a problem : I want to be able to access the Name <-> Oid Map, to > be able to transform names to oid when parsing a DN (this is related to > DIRLDAP-73 bug : http://issues.apache.org/jira/browse/DIRLDAP-73 ) > > What I want to do is simple : translating any DN to its counterpart > using oid instead of names, like : > > ou=3DPeople, dc=3Dexample, dc=3Dcom > > will be transformed to : > > 2.5.4.11=3DPeople, 0.9.2342.19200300.100.1.25=3Dexample, > 0.9.2342.19200300.100.1.25=3Dcom > > (I'm talking of the internal representation of the DN, not the User > Provided DN, which will remain the same) > > To do that, I need to read the HashMap where is stored all the Name/Oid > maps. It's currentrly stored in the oidRegistry. > > The problem is that this Map is not accessible directly. > > I think that the best place to do the translation is in DnParser, thus I > need a static oidRegistry I can read from the parser. > > This is not something complicated to do, but I'm just asking myself : is > there any better solution ? > > (Of course, rethinking the way DN are parsed/normalized is possible, but > not for 1.0) > > I welcome any suggestion ! Why don't you override Context#getNameParser(String)? I guess we can simpl= y ignore the parameter for now. Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ ------=_Part_22230_23968814.1134980150444 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Emmanuel,

2005/12/8, Emmanuel Le= charny <elecharny@gmail.com&g= t;:
Hi all,

I have a problem : I want to be able to access the Name <= -> Oid Map, to
be able to transform names to oid when parsing a DN (t= his is related to
DIRLDAP-73 bug : http://issues.apache.org/jira/browse/DIRLDAP-73 )

What I want to= do is simple : translating any DN to its counterpart
using oid instead = of names, like :

ou=3DPeople, dc=3Dexample, dc=3Dcom

will be = transformed to :

2.5.4.11=3DPeople, 0.9.2342.19200300.100.1.25=3Dexample,
0.9.234= 2.19200300.100.1.25=3Dcom

(I'm talking of the internal representatio= n of the DN, not the User
Provided DN, which will remain the same)
To do that, I need to read the HashMap where is stored all the Name/Oid
= maps. It's currentrly stored in the oidRegistry.

The problem is that= this Map is not accessible directly.

I think that the best place to= do the translation is in DnParser, thus I
need a static oidRegistry I can read from the parser.

This is no= t something complicated to do, but I'm just asking myself : is
there any= better solution ?

(Of course, rethinking the way DN are parsed/norm= alized is possible, but
not for 1.0)

I welcome any suggestion !

Why= don't you override Context#getNameParser(String)?  I guess we can sim= ply ignore the parameter for now.

Trustin
--
what= we call human nature is actually human habit
--
http://gleamynode.net/ ------=_Part_22230_23968814.1134980150444--