h2. The Apache LDAP API Rationale Once we start to think about creating a new *LDAP* *API*, the first thing that comes to mind is that it could be a duplication of effort: there are already many libraries offering almost everything needed to write *LDAP* code. Some of them are : * *JNDI* : the default *JDK* *API* * *Netscape* [LdapSdk|http://www.mozilla.org/directory/javasdk.html] * *OpenLDAP* [JLdap|http://www.openldap.org/jldap/] So what makes the development of a new *LDAP JAVA API* a valid effort, and not another version of *[NIH|http://en.wikipedia.org/wiki/Not_Invented_Here]* syndrom? There are many reasons why we decided to start to work on such an *API*, and we will expose them in this chapter. h3. History The Apache Directory Server project was first built on top of *JNDI*, but many of the internal *LDAP* structures were developed internally, just because *JNDI* was not designed specifically for *LDAP*, so it was not convenient for us to use those structures. Step by step, all of the *LDAP* objects (_Attribute_, _Entry_, _DN_, ...) were implemented again. At some point, we needed to communicate with another *LDAP* server without having to go through *JNDI*, so we developed our own _LdapConnection_ class. This was the last step toward a full *Java API*. Strangely enough, at the very same time in 2007, the *Sun* people working on *OpenDS* contacted us to know if we would agree to work on what would have become the next version of *JNDI* ([Resurrecting The Java LDAP Centric API|http://blogs.sun.com/treydrake/entry/resurrecting_the_java_ldap_centric]). Sadly, this effort soon stalled, as it seemed that *JNDI2* was not an urgency for *Sun* anymore. We decided to go on but the pace was slow. We started again to work on this API with the *OpenDS* team in 2009 and did a presentation during the 2009 *LdapCon* ([Towards a common LDAP API for the Java Platform|http://www.symas.com/ldapcon2009/papers/poitou1.shtml]). The story repeated itself with *Oracle* buying *Sun* in 2010, after months of valuable collaboration with *Sun*. At last, we got some kind of convergence in many aspects of the *API*. We agreed on some of the key features the new *LDAP API* should offer: * A complete coverage of the *LDAP* protocol. * A schema-aware *API* * An easy-to-use *API* * An *API* taking advantage of the new *Java* constructs (generics, ellipsis, NIO). h3. Result The newly defined *API* fulfills all of those aspects. We also wanted to make this *API* available for the masses. The Apache Software Foundation values quality and community over code, which means we think that the code is the result of a collaborative work, our users being a part of this collaboration. Every bug a user finds is an opportunity to provide a better version of the *API*. At the end, we are proud to deliver an *API* which is used in the Apache Directory Server, but also in the LDAP Browser.