Skip Navigation Links | |
Exit Print View | |
Oracle Directory Server Enterprise Edition Developer's Guide 11 g Release 1 (11.1.1.5.0) |
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
Converting To and From LDIF Representations
Converting an LDIF String to a Slapi_Entry Structure
Converting a Slapi_Entry Structure to an LDIF String
Getting Entry Attributes and Attribute Values
Adding and Removing Attribute Values
Verifying Schema Compliance for an Entry
Handling Entry Distinguished Names
Getting the Parent and Suffix DNs
Determining Whether a Suffix Is Served Locally
Is the User the Directory Manager?
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
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
This section demonstrates how to create an entry in the directory. Create a new entry by allocating space, and creating a completely new entry. Alternatively, create a new entry by duplicating an existing entry and modifying its values.
Create a completely new entry by using slapi_entry_alloc() to allocate the memory that is required, as shown in the following example.
Example 4-1 Creating a New Entry (entries.c)
#include "slapi-plugin.h" int test_ldif() { Slapi_Entry * entry = NULL; /* Entry to hold LDIF */ /* Allocate the Slapi_Entry structure. */ entry = slapi_entry_alloc(); /* Add code that fills the Slapi_Entry structure. */ /* Add code that uses the Slapi_Entry structure. */ /* Release memory allocated for the entry. */ slapi_entry_free(entry); return (0); }
Create a copy of an entry with slapi_entry_dup().