9.3. Registering Entry Store/Fetch Functions

The plug-in configuration entry is much like that for other types of plug-ins. The nsslapd-pluginType is ldbmentryfetchstore. The plug-in init function should register the entry fetch callback using slapi_pblock_set() with SLAPI_PLUGIN_ENTRY_FETCH_FUNC and register the entry store callback using slapi_pblock_set() with SLAPI_PLUGIN_ENTRY_STORE_FUNC. It is not necessary to have both functions; it is possible to use only a fetch or only a store function.
It is also possible to register a start and a close function.
To register an entry store or entry fetch plug-in function, edit the Directory Server's dse.ldif file configuration file and add the entry:
  1. Add the plug-in parameters to the dse.ldif file. For example:
    # ldapmodify -D "cn=Directory Manager" -W -p 389 -h server.example.com -x
    
    dn: cn=Test entry,cn=plugins,cn=config
    objectClass: top
    objectClass: nsSlapdPlugin
    objectClass: extensibleObject
    cn: Test entry
    nsslapd-pluginPath: /path/to/test-plugin.so
    nsslapd-pluginInitfunc: testentry_init
    nsslapd-pluginType: ldbmentryfetchstore
    nsslapd-pluginEnabled: on
    nsslapd-pluginId: test-entry
  2. Restart the server to load the new plug-in.
    # systemctl restart dirsrv.target
The testentry.c source file has an example plug-in function that implements entry store and entry fetch operations. Example files are installed in /usr/lib64/dirsrv/plugins.