LDAP Programming with Java
暫譯: 使用 Java 進行 LDAP 程式設計

Rob Weltman, Tony Dahbura

  • 出版商: Addison Wesley
  • 出版日期: 2000-02-14
  • 售價: $2,390
  • 貴賓價: 9.5$2,271
  • 語言: 英文
  • 頁數: 692
  • 裝訂: Hardcover
  • ISBN: 0201657589
  • ISBN-13: 9780201657586
  • 相關分類: Java 程式語言
  • 已絕版

買這商品的人也買了...

商品描述


Description

Powerful techniques for directory-enabling any Java TM application, from intranet to E-commerce and beyond!

  • Combine the power and reach of LDAP directories with the portability and efficiency of Java.
  • Detailed case studies -- including how to build reusable LDAP-aware JavaBeans from scratch.
  • The authoritative guide to the Directory SDK for Java -- by its creators!
In this book, the creators of the Directory SDK for Java show how it can be used to build powerful, standards-based directory applications that leverage LDAP directory information on intranets, the Internet, even in E-commerce applications. Start by reviewing what Directories are, what directory-enabled applications can accomplish, and the key elements of the LDAP directory standard. Next, establish a directory application development environment; learn how the Directory SDK for Java can be used to build LDAP-enabled applications; and walk through retrieving, creating, maintaining, and securing directory information. Along the way, developers will learn how to build LDAP-aware applets; script LDAP with JavaScript and Java; use LDAP on a Web server; create reusable LDAP JavaBeans; optimize the performance of their LDAP-enabled applications; and much more. The CD-ROM includes reference documentation and source code for the Directory SDK for Java, and for all examples and programs in the book; as well as the entire text of the book in fully-searchable format. For all intermediate to advanced Java and network programmers, system, network, and messaging administrators.

Rob Weltman is manager of the Directory Applications Group at Netscape, and is the designer of the Directory SDK for Java.

Tony Dahbura Lead Engineer with Netscape. He specializes in LDAP implementation and planning, as well as the use of the Java language to facilitate LDAP access and usage.

Back to Top


Appropriate Courses

Networking--Advanced Topics.

Back to Top


Table Of Contents

Preface.
Acknowledgments.
Introduction.
1. What Can You Find in a Directory?
What Is a Directory?
What Is That Phone Number?
Directory Clients for an Online Phone Book.
Is He Really Who He Says He Is?
Working Together.
Computers, Printers, Toasters.


2. The Lingua Franca of Directories Is LDAP.
A Brief History of Electronic Directories.
I Heard It through the Grapevine.
Directories for the Internet.
>Directories for a Single Network: Proprietary Solutions.
X.500: The "Heavyweight" Directory Service.
From Humble Beginnings.
Future Directions for LDAP.
The LDAP Information and Naming Models: How Directories Are Organized.
The LDAP Information Model.
The LDAP Naming Model.
LDAP Spoken Here.
Many Roads to Rome.
Directory SDK for C.
Directory SDK for Java.
Java Naming and Directory Interface.

3. May We Introduce Directory SDK for Java.
What Directory SDK for Java Can Do for You: Freedom from Protocol Handling.
The Use of Standard Java Objects for Returning and Processing Data: Utility Classes for Handling LDAP-Specific Entities.
Full Access to All LDAP Services.
Flexible Authentication Models.
Write Once, Run Anywhere.
Multilayered Functionality.
A Platform for Directory-Enabled Applications.
What Else Can the SDK Do for Me?
Dynamic Organizational Chart.
Directory-Linking Tool.
Access Control for Existing or New Applications.
Installation and Setup of the SDK.
Staying Current.
Installing the SDK.
Conclusion.

II. GETTING STARTED.


4. Setting Up Your Own Directory.
Downloading and Installing Netscape Directory Server.
Before You Download and Install the Software.
Downloading Netscape Directory Server.
Installing Netscape Directory Server.
Setting Up the Sample Database.
Using the Command-Line Tools with Your New Directory.
Finding Entries with LDAPSearch.
Adding Entries to the Directory.
Understanding LDIF: How to Describe a Directory Entry.
Object Classes: Determining What Information Makes Up an Entry.
Choosing a Distinguished Name: Where Do You Want to Add the Entry?
Examples of Defining and Adding Entries.
Conclusion.

5. Searching with the SDK.
Our First Search.
Host Name.
Port.
Base DN.
Scope.
Filter.
Attributes.
Search Preferences.
Our First Search Program.
Using Search Filters.
Handling Results.
Attributes in Detail.
I Want Only One Record and I Have the DN.
Searching and Comparing.
More on Filters.
Sorting.
Authenticating for Searches.
Improving Directory Search Performance.
Use Indexed Attributes.
Specify an Object Class to Get Only Entries of the Desired Type.
Retrieve Only Attributes You Need.
Keep the DN Handy.
Use compare Where It Makes Sense.
Conclusion.

6. Creating and Maintaining Information.
Before We Can Update: Authentication Basics.
Adding an Entry.
Summary of Steps to Add a New Entry.
Inserting Records from a Data File.
Adding an Organizational Unit.
Processing Exceptions.
Modifying an Existing Entry.
Summary of Steps to Modify an Existing Entry.
Adding an Attribute.
Modifying an Attribute.
Removing an Attribute.
Updating Multivalued Attributes.
Storing Binary Data.
Storing Preferences and State.
Deleting an Entry.
Renaming an Entry: Modifying the RDN.
Managing Groups.
Adding a User to a Group.
Removing a User from a Group.
Using the LDAPIsMember Bean.
Conclusion.

7. Securing the Data.
No Standards for Access Control.
Setting Up an Access Control List.
Viewing Access Control Lists through LDAP.
Modifying Access Control Lists through LDAP.
Authenticating to the Directory.
Using Password-Based Authentication.
Communicating over Secure Sockets Layer.
Using Certificate-Based Authentication.
Using SASL Authentication.
Authenticating with SASL in LDAP.
Callbacks in SASL.
The SASL Framework Classes.
Preparing to Use an Existing Mechanism.
Your Own SaslClient and ClientFactory.
Conclusion.

III. GETTING DOWN AND DIRTY.


8. More Power to the Browser: An Applet That Speaks LDAP.
What's So Different about an Applet?
Certificates and Signed Applets.
Writing LDAP Applets for Netscape Navigator.
Requesting Connection Privileges.
Packaging Your Applet.
Generating a Test Certificate.
Signing Your Code.
Testing Your Applet.
Using the Codebase as a Principal.
Writing LDAP Applets for Microsoft Internet Explorer.
Requesting Connection Privileges.
Packaging Your Applet.
Generating a Test Certificate.
Signing Your Code.
Creating a Web Page for the Applet.
Writing LDAP Applets for Java Plug-In Software.
Packaging Your Applet.
Generating a Key Pair and Self-signed Certificate.
Signing Your Code.
Setting Up the End Useris System.
A Directory Viewer Applet.
A Simple Example for Java Plug-In Software.
Conclusion.

9. Scripting LDAP: JavaScript and Java.
Accessing Java Applets from JavaScript.
Accessing Java Objects from JavaScript.
JavaScript Gotchas.
Handling Java Exceptions in JavaScript.
Handling Arrays of Strings.
Requesting Privileges and Signing Your JavaScript Code.
Accessing the LDAP Classes from JScript in Internet Explorer.
Conclusion.

10. Don't Redo It, Reuse It: LDAP JavaBeans.
Invisible LDAP JavaBeans.
LDAPBasePropertySupport.
LDAPSimpleAuth.
LDAPGetEntries.
Directory-Based Authentication in JavaScript.
Using PropertyChangeEvent Notifications.
Graphical LDAP JavaBeans.
A Directory Browser.
A Directory Lister.
Conclusion.

11. Make Your Application Location-Independent.
The Teex Multicharacter-Set Text Editor.
The Teex JavaBean.
A Class for User Preferences.
Storing Preferences as Attributes in User Entries.
Saving Preferences as an Object in the Directory.
Using Directory Structure to Model Attributes.
Conclusion.

12. Modeling Relationships.
Mirroring an Organizational Structure.
Attributes as Pointers.
Parsing the Reporting Relationships in a Directory.
An Alternative Strategy for Management Parsing.
An Organizational Chart Tree Component.
A More Traditional Organizational Chart Component.
Inspecting Properties of an Entry.
Connecting the Property Table and the Directory Viewers.
Conclusion.

13. Servlets and LDAP.
Overview of Servlets.
Uses of LDAP in Servlets.
Designing the LDAP Servlet.
Location of Files.
Our Phone Book Servlet.
Phone Book Lookups.
Accessibility with a Simple Browser.
Utilizing the Corporate LDAP Directory.
Customizability.
Search Attributes.
Intranet and Extranet.
User Self-administration.
Connection Pooling and Data Caching.
Accessibility over SSL.
Connection-Pooling Class.
Servlet Request-Response Model.
Setting Up and Using the Servlet.
Tips for Servlet Developers.
Conclusion.

IV. BEYOND THE BASICS.


14. Options and Constraints.
How Do They Affect Me?
A View into Options.
TimeLimit.
Referrals.
BindProc.
ReBindProc.
HopLimit.
Constraints for Searching.
ServerTimeLimit.
Dereference.
MaxResults.
BatchSize.
MaxBackLog.
Conclusion.

15. Odds and Ends.
LDAP URLs.
An IETF Standard.
Using LDAP URLs in Java.
Not Your Average URL.

A Rose by Any Other Name.
When What You Read Is Not What You Wrote.
Sometimes One Thread Is Not Enough.
Don't Step on My Settings.
A Cloned Connection Is a Safe Connection.

Performance, and How to Get It.
Breaking Up Is Hard to Do: Avoid Unnecessary Connections.
Pool the Connections.
Fewer But Better Searches.
To Cache or Not to Cache.

Conclusion.

16. Advanced Topics.
Information about Information: Managing the Schema.
Programmatic Access through the Schema Classes.
A Pretty Printer for Schema Contents.

Controls: An Essential Extension.
Too Much Data: A Virtual List View.
Call Me When You're Ready: Persistent Search.
Password Expiration Notification.
Trust Me: The Proxied Authorization Control.
Your Very Own Controls: Using the BER Package.

When the Data Lives Elsewhere: Managing Referrals.
Catching and Processing Referral Exceptions.
Automatic Referrals: Anonymous or under Client Control.
The manageDsaIT Control.
LDAPBind for Complete Client Control.

And Now for Something Completely Different: Extended Operations.
Aiming for 24 x 7: Failover and Reconnecting.
Transparent Reconnection.

Controlling the Result Queue: The Connection Backlog.
Down to the Wire: Using the Asynchronous Interface.
Conclusion.

Appendix A: More to Learn About LDAP.
Going to the Source: Internet Standards.
Where to Get RFCs and Internet Drafts.
LDAP RFCs.
LDAP Internet Drafts.
X.500 Documents.

Books about LDAP.
LDAP Concepts and Deployment.
LDAP Programming.
X.500.

LDAP Information on the Internet.
LDAP FAQs and Presentations.
LDAP Client SDKs.
Add-On Products for LDAP Directories.
Collections of LDAP Documents and Links.
X.500.
Miscellaneous.

Newsgroups Where LDAP Is Spoken.
LDAP in Your Inbox.
LDAP Servers at Your Disposal.

Appendix B: Classes of the LDAP SDK.
The netscape.ldap Package.
LDAPConnection and Connection Management.
Basic LDAP Message and Data Encapsulation.
Handling Messages from the Server.
Authentication and Reauthentication.
Exceptions.
Controls.
Caching.
Client-Side Sorting.
Schema Representation.
Miscellaneous Utility Classes.

The netscape.ldap.util Package.
DNs and RDNs.
LDIF Reader Classes.
Connection Pool.


Appendix C: LDAP Utility Classes on the CD-ROM.
The table Package.
The util Package.

Appendix D: Common LDAP Schema Elements.
Object Classes.
Abstract Object Classes.
Structural Object Classes.
Auxiliary Object Classes.

Attributes.
Attribute Syntaxes.
Attribute Types


Appendix E: LDAP Error Codes.
Index. 0201657589T04062001


Back to Top

商品描述(中文翻譯)

描述

強大的技術,能夠為任何 Java TM 應用程式提供目錄功能,從內部網路到電子商務及更遠的應用!
- 結合 LDAP 目錄的強大功能與 Java 的可攜性和效率。
- 詳細的案例研究,包括如何從零開始構建可重用的 LDAP 感知 JavaBeans。
- 由其創建者撰寫的 Java 目錄 SDK 的權威指南!

在本書中,Java 目錄 SDK 的創建者展示了如何使用它來構建強大且基於標準的目錄應用程式,利用內部網路、互聯網甚至電子商務應用中的 LDAP 目錄資訊。首先回顧什麼是目錄,目錄啟用的應用程式可以實現什麼,以及 LDAP 目錄標準的關鍵要素。接下來,建立目錄應用程式開發環境;學習如何使用 Java 目錄 SDK 構建 LDAP 啟用的應用程式;並逐步了解檢索、創建、維護和保護目錄資訊。在此過程中,開發人員將學習如何構建 LDAP 感知的 applet;使用 JavaScript 和 Java 腳本化 LDAP;在 Web 伺服器上使用 LDAP;創建可重用的 LDAP JavaBeans;優化其 LDAP 啟用應用程式的性能;以及更多內容。CD-ROM 包含 Java 目錄 SDK 的參考文檔和源代碼,以及書中所有示例和程式的源代碼;還有整本書的全文以可完全搜索的格式提供。適合所有中級到高級的 Java 和網路程式設計師、系統、網路和消息管理員。

Rob Weltman 是 Netscape 目錄應用程式組的經理,也是 Java 目錄 SDK 的設計者。

Tony Dahbura 是 Netscape 的首席工程師,專注於 LDAP 實施和規劃,以及使用 Java 語言促進 LDAP 的訪問和使用。

適合的課程

網路 - 進階主題。

目錄

- 前言
- 致謝
- 介紹
- 1. 目錄中可以找到什麼?
- 什麼是目錄?
- 那個電話號碼是什麼?
- 在線電話簿的目錄客戶端。
- 他真的是他所說的那個人嗎?
- 共同工作。
- 電腦、印表機、烤麵包機。
- 2. 目錄的通用語言是 LDAP。
- 電子目錄的簡史。
- 我從小道消息中聽到的。
- 互聯網的目錄。
- 單一網路的目錄:專有解決方案。
- X.500:'重型' 目錄服務。
- 從謙卑的開始。
- LDAP 的未來方向。
- LDAP 資訊和命名模型:目錄的組織方式。
- LDAP 資訊模型。
- LDAP 命名模型。
- 這裡講 LDAP。
- 通往羅馬的多條道路。
- C 的目錄 SDK。
- Java 的目錄 SDK。
- Java 命名和目錄介面。
- 3. 介紹 Java 目錄 SDK。
- Java 目錄 SDK 能為您做什麼:擺脫協議處理的自由。
- 使用標準 Java 物件返回和處理資料:處理 LDAP 特定實體的工具類別。
- 完全訪問所有 LDAP 服務。
- 靈活的身份驗證模型。
- 寫一次,隨處運行。
- 多層功能。
- 目錄啟用應用程式的平台。
- SDK 還能為我做什麼?
- 動態組織圖。
- 目錄鏈接工具。
- 現有或新應用程式的訪問控制。
- SDK 的安裝和設置。
- 保持最新。
- 安裝 SDK。
- 結論。

II. 開始使用。

- 4. 設置自己的目錄。
- 下載和安裝 Netscape 目錄伺服器。
- 在下載和安裝軟體之前。
- 下載 Netscape 目錄伺服器。
- 安裝 Netscape 目錄伺服器。
- 設置示例數據庫。
- 使用命令行工具與您的新目錄。
- 使用 LDAPSearch 查找條目。
- 向目錄添加條目。
- 理解 LDIF:如何描述目錄條目。
- 物件類別:確定構成條目的資訊。
- 選擇一個區別名稱:您希望將條目添加到哪裡?
- 定義和添加條目的示例。
- 結論。
- 5. 使用 SDK 進行搜索。
- 我們的第一次搜索。
- 主機名稱。
- 端口。
- 基本 DN。
- 範圍。
- 過濾器。
- 屬性。
- 搜索偏好。
- 我們的第一次搜索程式。
- 使用搜索過濾器。
- 處理結果。
- 屬性詳情。
- 我只想要一條記錄,我有 DN。
- 搜索和比較。
- 更多過濾器。
- 排序。
- 搜索的身份驗證。
- 改善目錄搜索性能。
- 使用索引屬性。
- 指定物件類別以僅獲取所需類型的條目。
- 僅檢索所需的屬性。
- 隨時保持 DN。
- 在合適的地方使用比較。
- 結論。
- 6. 創建和維護資訊。
- 在我們可以更新之前:身份驗證基礎。
- 添加條目。
- 添加新條目的步驟摘要。
- 從數據文件插入記錄。
- 添加組織單位。
- 處理異常。
- 修改現有條目。
- 修改現有條目的步驟摘要。
- 添加屬性。
- 修改屬性。
- 刪除屬性。
- 更新多值屬性。
- 儲存二進位資料。
- 儲存偏好和狀態。
- 刪除條目。
- 重命名條目:修改 RDN。
- 管理群組。
- 將用戶添加到群組。
- 從群組中刪除用戶。
- 使用 LDAPIsMember Bean。
- 結論。
- 7. 保護資料。
- 沒有訪問控制的標準。
- 設置訪問控制列表。
- 通過 LDAP 查看訪問控制列表。
- 通過 LDAP 修改訪問控制列表。
- 對目錄進行身份驗證。
- 使用基於密碼的身份驗證。
- 通過安全套接字層進行通信。
- 使用基於證書的身份驗證。
- 使用 SASL 身份驗證。
- 在 LDAP 中使用 SASL 進行身份驗證。
- SASL 中的回調。
- SASL 框架類。
- 準備使用現有機制。
- 您自己的 SaslClient 和 ClientFactory。
- 結論。

III. 深入探討。

- 8. 為瀏覽器增添更多功能:一個能夠講 LDAP 的 applet。
- applet 有什麼不同?
- 證書和簽名的 applet。
- 為 Netscape Navigator 編寫 LDAP applet。
- 請求連接權限。
- 打包您的 applet。
- 生成測試證書。
- 簽署您的代碼。
- 測試您的 applet。
- 使用代碼庫作為主體。
- 為 Microsoft Internet Explorer 編寫 LDAP applet。
- 請求連接權限。
- 打包您的 applet。
- 生成測試證書。
- 簽署您的代碼。
- 為 applet 創建網頁。
- 為 Java Plug-In 軟體編寫 LDAP applet。
- 打包您的 applet。
- 生成密鑰對和自簽名證書。
- 簽署您的代碼。
- 設置最終用戶的系統。
- 目錄查看器 applet。
- Java Plug-In 軟體的簡單示例。
- 結論。
- 9. 腳本化 LDAP:JavaScript 和 Java。
- 從 JavaScript 訪問 Java applet。
- 從 JavaScript 訪問 Java 物件。
- JavaScript 的陷阱。
- 在 JavaScript 中處理 Java 異常。
- 處理字符串數組。
- 請求權限並簽署您的 JavaScript 代碼。
- 從 Internet Explorer 的 JScript 訪問 LDAP 類。
- 結論。
- 10. 不要重做,重用:LDAP JavaBeans。
- 隱形的 LDAP JavaBeans。
- LDAPBasePropertySupport。
- LDAPSimpleAuth。
- LDAPGetEntries。
- JavaScript 中的基於目錄的身份驗證。
- 使用 PropertyChangeEvent 通知。
- 圖形 LDAP JavaBeans。
- 目錄瀏覽器。
- 目錄列舉器。
- 結論。
- 11. 使您的應用程式位置獨立。
- Teex 多字符集文本編輯器。
- Teex JavaBean。
- 用戶偏好的類別。
- 將偏好儲存為用戶條目的屬性。
- 將偏好儲存為目錄中的物件。
- 使用目錄結構來建模屬性。
- 結論。
- 12. 建模關係。
- 鏡像組織結構。
- 屬性作為指針。
- 解析目錄中的報告關係。
- 管理解析的替代策略。
- 組織圖樹組件。
- 更傳統的組織圖組件。
- 檢查條目的屬性。
- 連接屬性表和目錄查看器。
- 結論。
- 13. Servlets 和 LDAP。
- Servlets 概述。
- Servlets 中 LDAP 的用途。
- 設計 LDAP Servlet。
- 文件的位置。
- 我們的電話簿 Servlet。
- 電話簿查詢。
- 使用簡單瀏覽器的可訪問性。
- 利用企業 LDAP 目錄。
- 可自定義性。
- 搜索屬性。
- 內部網路和外部網路。
- 用戶自我管理。
- 連接池和數據緩存。
- 通過 SSL 的可訪問性。
- 連接池類。
- Servlet 請求-響應模型。
- 設置和使用 Servlet。
- Servlet 開發者的提示。
- 結論。

IV. 超越基礎。

- 14. 選項和限制。
- 它們如何影響我?
- 選項的視圖。
- TimeLimit。
- 轉介。
- BindProc。
- ReBindProc。
- HopLimit。
- 搜索的限制。
- ServerTimeLimit。
- Dereference。
- MaxResults。
- BatchSize。
- MaxBackLog。
- 結論。
- 15. 雜項。
- LDAP URLs。
- 一個 IETF 標準。
- 在 Java 中使用 LDAP URLs。
- 不是您普通的 URL。
- 其他名稱的玫瑰。
- 當您閱讀的內容與您所寫的不同時。
- 有時一個線程不夠。
- 不要踩到我的設置。
- 克隆的連接是安全的連接。
- 性能,以及如何獲得它。
- 分手是困難的:避免不必要的連接。
- 池化連接。

最後瀏覽商品 (20)