JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Directory Server Enterprise Edition Developer's Guide 11 g Release 1 (11.1.1.5.0)
search filter icon
search icon

Document Information

Preface

Part I Directory Server Plug-In API Guide

1.  Before You Start Writing Plug-Ins

2.  Changes to the Plug-In API Since Directory Server 5.2

3.  Getting Started With Directory Server Plug-Ins

4.  Working With Entries Using Plug-Ins

5.  Extending Client Request Handling Using Plug-Ins

6.  Handling Authentication Using Plug-Ins

7.  Performing Internal Operations With Plug-Ins

8.  Writing Entry Store and Entry Fetch Plug-Ins

9.  Writing Extended Operation Plug-Ins

10.  Writing Matching Rule Plug-Ins

How Matching Rule Plug-Ins Work

What a Matching Rule Is

Requesting a Matching Rule

What a Matching Rule Plug-In Does

Example Matching Rule Plug-In

Configuring Matching Rule Plug-Ins

Registering Matching Rule Plug-Ins

Handling Extensible Match Filters

How Directory Server Handles Extensible Match Searches

Filter Matching Function

Subtype Matches

Thread Safety and Filter Matching Functions

Filter Index Function

Input Parameters for Filter Index Functions

Output Parameters for Filter Index Functions

Thread Safety and Filter Index Functions

Filter Factory Function

Input Parameters for Filter Factory Functions

Output Parameters for Filter Factory Functions

Thread Safety and Filter Factory Functions

Filter Object Destructor Function

Indexing Entries According to a Matching Rule

How Directory Server Handles the Index

Indexer Function

Input Parameters for Indexers

Output Parameter for Indexers

Thread Safety and Indexers

Indexer Factory Function

Input Parameters for Indexer Factory Functions

Output Parameters for Indexer Factory Functions

Thread Safety and Indexer Factory Functions

Indexer Object Destructor Function

Enabling Sorting According to a Matching Rule

How Directory Server Performs Sorting According to a Matching Rule

Handling an Unknown Matching Rule

Internal List of Correspondences

OIDs Not in the Internal List

11.  Writing Password Storage Scheme Plug-Ins

12.  Writing Password Quality Check Plug-Ins

13.  Writing Computed Attribute Plug-Ins

Part II Directory Server Plug-In API Reference

14.  Data Type and Structure Reference

15.  Function Reference, Part I

16.  Function Reference, Part II

17.  Parameter Block Reference

A.  NameFinder Application

Prerequisite Software

Deploying NameFinder

Configuring NameFinder to Access Your Directory

Customizing NameFinder

Index

How Matching Rule Plug-Ins Work

This section summarizes what matching rule plug-ins are and how Directory Server handles them.

What a Matching Rule Is

A matching rule defines a specific way to compare attribute values that have a given syntax. In other words, a matching rule defines how potentially matching attributes are compared.

Every matching rule is identified by a unique object identifier (OID) string. A client application that requests a search can specify the matching rule OID in the search filter. The OID indicates to Directory Server how to check for a match of two attribute values.

In practice, a client application might want only entries with attribute values that match the value provided exactly. The sample plug-in demonstrates how you might implement a solution for that case. Another client might want to sort entries according to the rules for a given locale. Directory Server actually uses a matching rule plug-in to handle locale—specific matching.

Chapter 14, Directory Server Internationalization Support, in Oracle Directory Server Enterprise Edition Reference includes a list of matching rules. Directory Server supports the rules for internationalized searches. You can also view the list by searching the default schema.

$ ldapsearch -h localhost -p 1389 -b cn=schema cn=schema matchingRules

Requesting a Matching Rule

To request a custom matching rule on a specific attribute, a client application includes the matching rule OID in the search filter. LDAP v3 calls these search filters extensible match filters. An extensible match filter looks like the following:

(cn:2.5.13.5:=Quentin)

This filter tells the server to search for Quentin in the common name (CN) of the entries by using matching rule 2.5.13.5. The matching rule happens to be a case exact match.

The case exact matching rule plug-in OID 2.5.13.5 enables Directory Server to perform the search correctly. Directory Server calls code in this matching rule plug-in to check for matches during a search. The server also uses the code to generate indexes that accelerate case exact searches. The indexes also help to sort entries found during such searches.

What a Matching Rule Plug-In Does

A matching rule plug-in can provide code to do the following:

To enable these capabilities, the plug-in implements matching and indexing routines that Directory Server calls to handle requests involving the particular matching rule.

The plug-in also implements factory functions that specify which routine to call when handling a particular matching rule. As a result, a plug-in can support multiple matching rules. Yet, plug-ins implementing only one matching rule also require factory function code to wrap indexing and matching routines. A plug-in therefore requires many lines of code and several functions to handle even a minimal matching rule.

The following table shows all the functions that a matching rule plug-in can implement.

Table 10-1 Functions Defined in Matching Rule Plug-Ins

Type
Parameter Block Identifier
Required?
Filter factory
SLAPI_PLUGIN_MR_FILTER_CREATE_FN
Required
Filter index, used to check an index for matches
SLAPI_PLUGIN_MR_FILTER_INDEX_FN
Not required
Filter match
SLAPI_PLUGIN_MR_FILTER_MATCH_FN
Required
Filter match reset
SLAPI_PLUGIN_MR_FILTER_RESET_FN
If filter must be reset for reuse
Filter object destructor
SLAPI_PLUGIN_DESTROY_FN
If needed to free memory
Indexer
SLAPI_PLUGIN_MR_INDEX_FN
Not required
Indexer factory
SLAPI_PLUGIN_MR_INDEXER_CREATE_FN
Not required
Indexer object destructor
SLAPI_PLUGIN_DESTROY_FN
If needed to free memory
Plug-in initialization function
Not applicable, but instead specified in configuration settings
Required
Server shutdown (cleanup) function
SLAPI_CLOSE_FN
Not required
Server startup function
SLAPI_START_FN
Not required

Refer to Part II, Directory Server Plug-In API Reference for details about parameter block identifiers that you can use with matching rule plug-ins.