Hi Emmanuel,

2005/12/8, Emmanuel Lecharny <[EMAIL PROTECTED]>:
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=People, dc=example, dc=com

will be transformed to :

2.5.4.11=People, 0.9.2342.19200300.100.1.25=example,
0.9.2342.19200300.100.1.25=com

(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 simply ignore the parameter for now.

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

Reply via email to