This chapter explains how to write functions that the Netscape Directory Server (Directory Server) calls before and after executing an LDAP operation. These functions are called pre-operation and post-operation plug-in functions.
The Directory Server can
perform the following LDAP operations: bind, unbind, search, modify, add, delete, modifyRDN,
compare,
and abandon.
|
|
|
|
The Directory Server can also perform extended operations as defined in the LDAPv3 protocol. For information on implementing plug-in functions to execute extended operations, see chapter 10, "Writing Extended Operation Plug-ins." |
|
|
|
|
You can configure the Directory Server to call your custom plug-in functions before and after executing any of these LDAP operations.
For example, you can write a pre-operation function that validates an entry before the server performs an LDAP add operation. An example of a post-operation plug-in function would be one that sends a notification to a user after their entry has been modified by an LDAP modify operation.
You can also set up the Directory Server to call your own plug-in functions before and after:
Figure 6-1 illustrates how the Directory Server front-end calls pre-operation and post-operation functions before and after executing an LDAP operation.
When processing a request, the Directory Server will call all registered pre-operation functions before it calls the backend to service the request. All pre-operation functions must return before the front-end calls the associated backend function.
As is the case with other server plug-in functions, pre-operation functions and post-operation functions are specified in a parameter block that you can set on server startup. Each function corresponds to an ID in the parameter block. In your initialization function, you can call the slapi_pblock_set() function to specify the name of your function that corresponds to the pre-operation or post-operation function. For more information on the parameter block, see Getting Data from the Parameter Block.
Table 6-1 lists the Directory Server pre-operation functions and the purpose of each function.
|
Specifies the function called before the Directory Server executes an LDAP bind operation. For information on writing this type of function, see Processing an LDAP Bind Operation. |
|
|
Specifies the function called before the Directory Server executes an LDAP unbind operation. For information on writing this type of function, see Processing an LDAP Unbind Operation. |
|
|
Specifies the function called before the Directory Server executes an LDAP search operation. For information on writing this type of function, see Processing an LDAP Search Operation. |
|
|
Specifies the function called before the Directory Server executes an LDAP compare operation. For information on writing this type of function, see Processing an LDAP Compare Operation. |
|
|
Specifies the function called before the Directory Server executes an LDAP add operation. For information on writing this type of function, see Processing an LDAP Add Operation. |
|
|
Specifies the function called before the Directory Server executes an LDAP modify operation. For information on writing this type of function, see Processing an LDAP Modify Operation. |
|
|
Specifies the function called before the Directory Server executes an LDAP modifyRDN operation. For information on writing this type of function, see Processing an LDAP Modify RDN Operation. |
|
|
Specifies the function called before the Directory Server executes an LDAP delete operation. For information on writing this type of function, see Processing an LDAP Delete Operation. |
|
|
Specifies the function called before the Directory Server executes an LDAP abandon operation. For information on writing this type of function, see Processing an LDAP Abandon Operation. |
|
|
Specifies the function called before the Directory Server sends an entry back to the client (for example, when you call slapi_send_ldap_search_entry(), the pre-operation entry function is called before the entry is sent back to the client). |
|
|
Specifies the function called before the Directory Server sends a referral back to the client (for example, when you call slapi_str2filter(), the pre-operation referral function is called before the referral is sent back to the client). |
|
|
Specifies the function called before the Directory Server sends a result code back to the client (for example, when you call slapi_send_ldap_result(), the pre-operation result function is called before the result code is sent back to the client). |
Table 6-2 lists the Directory Server post-operation functions and the purpose of each function.
|
Specifies the function called after the Directory Server executes an LDAP bind operation. For information on writing this type of function, see Processing an LDAP Bind Operation. |
|
|
Specifies the function called after the Directory Server executes an LDAP unbind operation. For information on writing this type of function, see Processing an LDAP Unbind Operation. |
|
|
Specifies the function called after the Directory Server executes an LDAP search operation. For information on writing this type of function, see Processing an LDAP Search Operation. |
|
|
Specifies the function called after the Directory Server executes an LDAP compare operation. For information on writing this type of function, see Processing an LDAP Compare Operation. |
|
|
Specifies the function called after the Directory Server executes an LDAP add operation. For information on writing this type of function, see Processing an LDAP Add Operation. |
|
|
Specifies the function called after the Directory Server executes an LDAP modify operation. For information on writing this type of function, see Processing an LDAP Modify Operation. |
|
|
Specifies the function called after the Directory Server executes an LDAP modifyRDN operation. For information on writing this type of function, see Processing an LDAP Modify RDN Operation. |
|
|
Specifies the function called after the Directory Server executes an LDAP delete operation. For information on writing this type of function, see Processing an LDAP Delete Operation. |
|
|
Specifies the function called after the Directory Server executes an LDAP abandon operation. For information on writing this type of function, see Processing an LDAP Abandon Operation. |
|
|
Specifies the function called after the Directory Server sends an entry back to the client (for example, when you call slapi_send_ldap_search_entry(), the post-operation entry function is called after the entry is sent back to the client). |
|
|
Specifies the function called after the Directory Server sends a referral back to the client (for example, when you call slapi_str2filter(), the post-operation referral function is called after the referral is sent back to the client). |
|
|
Specifies the function called after the Directory Server sends a result code back to the client (for example, when you call slapi_send_ldap_result(), the post-operation result function is called after the result code is sent back to the client). |
To register your pre-operation and post-operation plug-in functions, you need to write an initialization function and then configure the server to load your plug-in. For details, follow the procedures outlined in Writing Plug-in Initialization Functions and Configuring Plug-ins.
| Previous |
Contents |
Index |
DocHome | Next |