JBStrap LDAP DAO

Data handling in LDAP

Fetch

Use this functionality to programmatically retrieve data based on a DataDescriptor from an LDAP server. In the data query, you can apply filter criteria to the query. Filter criteria are JBStrap Criteria objects. Results are returned as DataRecord or List<DataRecord> objects. You can retrieve all the corresponding records or only a subset of the record for a faster response time.

If you can specify the client object, the access rights in the DataDescriptor are checked. If a user does not have read rights for the data (as specified in the DataDescriptor), the an error is returned, preventing unauthorized access to the data.

Here are a few examples of how to fetch data using the LDAP DataDescriptor:

Fetching all data using a DataDescriptor
Fetching all data using a DataDescriptor while checking for access rights
Fetching all data that meet the specified Criteria using a DataDescriptor (fetching every Record object where the objectClass is a person)
Fetching all records from the DataDescriptor where the objectClass is a person while also checking the access rights
Fetching the first 50 records using a DataDescriptor that meets the specified filters (records where the objectClass is a person). If there are more than 50 corresponding records, only the first 50 ones will be fetched).
Fetching the next 50 records (51-100) while checking the access rights
Fetching the first 50 records that meet the specified criteria and sorting the results in descending order by name
Fetching the first 50 records while checking the access rights and sorting search results in descending order by name and ascending order by company

Fetching a record from the LDAP server using its unique ID:

Fetching the record that corresponds to the primary key (CN=Example User,OU=Users,OU=ExampleOrgUnit,DC=company,DC=com) from a DataDescriptor
Fetching the record that corresponds to the primary key (CN=Example User,OU=Users,OU=ExampleOrgUnit,DC=company,DC=com) from a DataDescriptor while checking for access rights

Counting the records:

Counting the record rows in a DataDescriptor
Counting the record rows in a DataDescriptor while checking the access rights
Counting the record rows in a DataDescriptor that meet the specified criteria (where the objectClass column is a person)
Counting the record rows in a DataDescriptor that meet the specified criteria while checking the access rights