Introduction

Practical Spring LDAP provides a complete coverage of Spring LDAP, a framework designed to take the pain out of LDAP programming. This book starts by explaining the fundamental concepts of LDAP and showing the reader how to set up the development environment. It then dives into Spring LDAP, analyzing the problems it is designed to solve. After that, the book focuses on the practical aspects of unit testing and integration testing LDAP code. This is followed by an in-depth treatment of LDAP controls and new Spring LDAP 1.3.1 features such as Object Directory Mapping and LDIF parsing. Finally, it concludes with discussions of LDAP authentication and connection pooling.

What the Book Covers

Chapter 1 starts with an overview of directory servers. It then discusses basics of LDAP and introduces the four LDAP information models. It finishes up with an introduction to the LDIF format that is used for representing LDAP data.

Chapter 2 focuses on the Java Naming and Directory Interface (JNDI). In this chapter, you look at creating applications that interact with LDAP using plain JNDI.

Chapter 3 explains what Spring LDAP is and why it is an important option in an enterprise developer’s repertoire. In this chapter, you set up the development environment needed to create Spring LDAP applications, and other important tools such as Maven and a test LDAP server. Finally, you implement a basic but complete Spring LDAP application using annotations.

Chapter 4 covers the fundamentals of Unit/Mock/Integration testing. You then look at setting up an embedded LDAP server for unit testing your application code. You also review available tools for generating test data. Finally, you use EasyMock framework to mock test LDAP code.

Chapter 5 introduces the basics of JNDI object factories and using these factories for creating objects that are more meaningful to the application. You then examine a complete Data Access Object (DAO) layer implementation using Spring LDAP and object factories.

Chapter 6 covers LDAP Search. This chapter begins with the underlying ideas of LDAP Search. I then introduce various Spring LDAP Filters that make LDAP searching easier. Finally, you look at creating a custom search filter to address situations where the current set is not sufficient.

Chapter 7 provides an in-depth overview of LDAP controls that can be used for extending LDAP server functionality. Then it moves on to sorting and paging LDAP results using sort and page controls.

Chapter 8 deals with Object-Directory Mapping, a new feature that was introduced in Spring LDAP 1.3.1. In this chapter, you look at bridging the gap between domain model and directory server. You then re-implement the DAO using ODM concepts.

Chapter 9 introduces the important ideas of transactions and transactional integrity, before analyzing the transaction abstractions provided by Spring Framework. Finally, it takes a look at Spring LDAP’s compensating transaction support.

Chapter 10 starts with implementing authentication, the most common operation performed against LDAP. It then deals with parsing LDIF files using another feature that was introduced in Spring 1.3.1. I end the chapter by looking at the connection pooling support provided by Spring LDAP.

Target Audience

Practical Spring LDAP is intended for developers interested in building Java/JEE applications using LDAP. It also teaches techniques for creating unit/integration tests for LDAP applications. The book assumes basic familiarity with Spring Framework; prior exposure to LDAP is helpful but not required. Developers who are already familiar with Spring LDAP will find best practices and examples that can help them get the most out of the framework.

Downloading Source Code

The source code for the examples in this book can be downloaded from www.apress.com. For detailed information about how to locate this book’s source code, go to www.apress.com/source-code/. The code is organized by chapter and can be built using Maven.

The code uses Spring LDAP 1.3.2 and Spring Framework 3.2.4. It is tested against OpenDJ and ApacheDS LDAP servers. More information on getting started can be found in Chapter 3.

Questions?

If you have any questions or suggestions, you can contact the author at [email protected].

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset