Sun Java System Directory Server Enterprise Edition 6.0 Developer's Guide

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 11–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.