Sample Code repository
All of the sample code used in the blog is available for checkout as a Apache Maven project at Google Code. Check out using SVN:
svn checkout http://ldap-sample-code.googlecode.com/svn/trunk/ ldap-sample-code-read-only
Project Description
The ldap-sample-code project houses sample code written for use in demonstrating aspects of LDAP, best practices with LDAP, and the UnboundID LDAP SDK. The sample code is often used to provide examples and demonstrations at the LDAP Blog and references to code in that blog refer to code hosted in this project.
Some of the examples use classes that are available in the UnboundID LDAP SDK commercial edition. If the commercial edition is not available, simply remove those classes after checking out the code and before using mvn to compile an create a jar file. Then download the standard edition of the LDAP SDK from the link above, or fetch it with maven.
The classes that would need to be removed are:
- src/main/java/samplecode/BindDemo.java
- src/main/java/samplecode/EffectiveRightsEntryDemo.java
- src/main/java/samplecode/OperationPurposeRequestControlExample.java
There are many examples of best practices uses of LDAP such as
- Bind demonstration
- Authorization Identity Request Control
- Password Modify Extended request
- Simple paged Results Request Control
- in-memory Directory Server
- search best practices
- Demonstrations use the LDAPCommandLineTool class
- the use of extensions and request controls
- matching rules used to compare distinguished names and attribute values
- use of the root DSE to check whether request controls and extensions are supported
- the minimal log formatter, suitable for use with the java.util.logging framework
