[jira] Commented: (DIRSERVER-858) Allow subclassing LdapDN
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Directory Project > [jira] Commented: (DIRSERVER-858) Allow subclassing LdapDN




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    [jira] Commented: (DIRSERVER-858) Allow subclassing LdapDN  
Emmanuel Lecharny (JIRA)


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-06-07 12:11 PM


[ https://issues.apache.org/jira/brow...e=3Dcom.atlass=
ian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12478354 ]=20

Emmanuel Lecharny commented on DIRSERVER-858:
---------------------------------------------

Parsing a DN is a pretty fast operation : on my desktop (pentium 3Ghz), I c=
an parse 120 000 dc=3Dexample, dc=3Dcom DN per second.=20

Your example is not correct. I assume it will work for "dc=3Dexample, dc=3D=
com" if you do a=20
bytes =3D StringTools.getBytesUtf8(dn);=20
but if you have a DN like : sn=3Dl=C3=A9charny, dc=3Dexample, dc=3Dcom, it'=
s simply not enough. The '=C3=A9'  should be handled and escaped, and this =
is what the parser is doing.

Last point : LdapDN is not intended to be used out of the server.

However, if you propose a patch, we may consider to apply it. Don't forget =
to propose a patch for 1.0 and 1.5 version.

> Allow subclassing LdapDN
> ------------------------
>
>                 Key: DIRSERVER-858
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-858
>             Project: Directory ApacheDS
>          Issue Type: Improvement
>          Components: ldap
>    Affects Versions: 1.0.1, 1.5.0
>            Reporter: Endi S. Dewata
>
> Currently when you create an LdapDN object from a given DN string the cod=
e will always parse the string into its RDN components.
>     LdapDN dn =3D new LdapDN("dc=3Dexample,dc=3Dcom");
> The parsing code, however, depending on your application, could take up t=
o 5% of the time.
> For applications that require high performance, it would be great if we c=
ould create a subclass of LdapDN that will bypass the DN parsing code, or l=
azily parse the DN only when needed. See the following code:
>     LdapDN dn =3D new MyLdapDN("dc=3Dexample,dc=3Dcom");
>     SearchResponseEntry response =3D new SearchResponseEntryImpl(request.=
getMessageId());
>     response.setObjectName(dn);
>     response.setAttributes(attributes);
> The MyLdapDN class would be very simple:
>     public class MyLdapDN extends LdapDN {
>         public MyLdapDN(String dn) throws Exception {
>             bytes =3D StringTools.getBytesUtf8(dn);
>         }
>     }
> Unfortunately this code is currently doesn't work because the the "bytes"=
field of LdapDN is private and the LdapDN.getNbBytes() and LdapDN.getBytes=
() methods require direct access to the field.
> The solution is simple, here are some alternatives:
> 1. Change the field access to protected.
> 2. Add LdapDN.setBytes() method.
> 3. Add LdapDN.getBytes() that can be overridden by the subclass, and chan=
ge the LdapDN.getNbBytes() and LdapDN.getBytes() to call this method.

--=20
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 05:16 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register