Towards a Common Java LDAP API - Apache Directory

20
Towards a Common Java LDAP API Emmanuel Lecharny Apache Directory [email protected] Ludovic Poitou OpenDS [email protected]

Transcript of Towards a Common Java LDAP API - Apache Directory

Page 1: Towards a Common Java LDAP API - Apache Directory

Towards a Common Java LDAP API

Emmanuel LecharnyApache Directory

[email protected]

Ludovic PoitouOpenDS

[email protected]

Page 2: Towards a Common Java LDAP API - Apache Directory
Page 3: Towards a Common Java LDAP API - Apache Directory

A poor man's choice:

JNDIor

JLDAP/Netscape LDAP SDK

Page 4: Towards a Common Java LDAP API - Apache Directory

Good News:

Apache Directory Client APIOpenDS Client SDK

UnboundID LDAP SDK

Page 5: Towards a Common Java LDAP API - Apache Directory

Why this resurgence of activity ?

• Servers need to issue outbound connections• A directory product is wrapped with

tools• Previous effort to agree on standard

API stalled

Page 6: Towards a Common Java LDAP API - Apache Directory

Is the LDAP developers ecosystem that large ?

We just need one good common API

Page 7: Towards a Common Java LDAP API - Apache Directory

The foundation

• JLDAP/Netscape SDK as template• Leveraging Java5 language

constructions• Synchronous and Asynchronous

methods

Page 8: Towards a Common Java LDAP API - Apache Directory

ConnectionRequest

ResponseHandling Data

Page 9: Towards a Common Java LDAP API - Apache Directory

Connection

• LDAPConnection is an interface• Factory – to hide I/O library– to handle single connection vs pooled

connections• Referral Policies (including

Authentication)

Page 10: Towards a Common Java LDAP API - Apache Directory

Request / Responses

Synchronous vs Asynchronous3 approaches

Just a question of style

Page 11: Towards a Common Java LDAP API - Apache Directory

Handling data

EntriesAttributes

ValuesNames

Page 12: Towards a Common Java LDAP API - Apache Directory

Entry description

• Base object for the server• Contains the DN and the Attributes• Uses ellipsis :

entry.add( "ObjectClass", "top", "person" );• Constructor or factory ?

Page 13: Towards a Common Java LDAP API - Apache Directory

Example : JNDIDirContext ctx = new InitialDirContext( env );

Attributes attrs = new BasicAttributes( true ); // case-ignoreAttribute objclass = new BasicAttribute("objectclass");objclass.add("top");objclass.add("organizationalUnit");attrs.put(objclass);attrs.put( "ou", "fruits" ); Context result = ctx.createSubcontext("ou=Fruits", attrs);

Example : New APIEntry entry = new EntryImpl(

new DN( "ou=fruits, dc=example, dc=com" ) );

entry.add( "objectClass", "top", "organizationalUnit" );entry.add( "ou", "fruits" ); connection.add( entry );

Page 14: Towards a Common Java LDAP API - Apache Directory

Values description

• Much more an internal representation of attribute data

• Should it be exposed to the client?• It contains

•either String (for H/R attributeTypes)•Or byte[] (Binary AttributeTypes)

• From the server point of view, everything is a byte[]

Page 15: Towards a Common Java LDAP API - Apache Directory
Page 16: Towards a Common Java LDAP API - Apache Directory

Search responses

• Enumeration of Searched Entries• Should search always try to page (like

RDMBs queries) ?• Should it be additional APIs built on the

basic Search request ?

Page 17: Towards a Common Java LDAP API - Apache Directory

Schema

• Schema is required for handling DNs, Entries, Values...

• Some servers may return non schema compliant data

• Application may not know Server's schema or works with multiple servers with different schema

• API needs to handle all scenarii

Page 18: Towards a Common Java LDAP API - Apache Directory

Schema

• Default schema must be present– At least the standard one

• Should be able to extend from file or server• How to deal with server specific schema

elements requiring code (Syntax, MatchingRules) ?

Page 19: Towards a Common Java LDAP API - Apache Directory

Other aspects

• Security : TLS handled under the hood• Exceptions • Extended operations• Controls• DSML

•Reader / Writer / Utilities• LDIF

•Reader / Writer / Utilities

Page 20: Towards a Common Java LDAP API - Apache Directory

Conclusion

• There is NO common API yet.• There are many aspects to address as a

community• Server vendors have their needs and their

proposed solutions• Application developers should participate and

provide input• It will take time to have that single best of the

world common LDAP JAVA API !• Interested ? Join the effort !