DataModelLdap.with_config


Description:

[ CCode ( has_construct_function = false ) ]
[ Version ( since = "5.2" ) ]
public DataModelLdap.with_config (Connection cnc, string? base_dn, string? filter, string? attributes, LdapSearchScope scope)

Creates a new DataModel object to extract some LDAP contents.

The returned data model will contain one row for each LDAP entry returned by the search, and will always return the DN (Distinguished Name) of the LDAP entry as first column. Other atttibutes may be mapped to other columns, see the attributes argument.

Note that the actual LDAP search command is not executed until necessary (when using the returned data model).

The base_dn is the point in the LDAP's DIT (Directory Information Tree) from where the search will occur, for example "dc=gda,dc=org". A null value indicates that the starting point for the search will be the one specified when opening the LDAP connection.

The filter argument is a valid LDAP filter string, for example "(uidNumber=1001)". If null, then a default search filter of "(objectClass=*)" will be used.

attributes specifies which LDAP attributes the search must return. It is a comma separated list of attribute names, for example "uidNumber, mail, uid, jpegPhoto" (spaces between attribute names are ignored). If null, then no attribute will be fetched. See gda_ldap_connection_declare_table for more information about this argument.

scope is the scope of search specified when the LDAP search is actually executed.

In case of multi valued attributes, an error will be returned when trying to read the attribute: get_value_at will return null when using an iterator.

This is a convenience function intended to be used by bindings.

Parameters:

cnc

an LDAP opened connection (must be a balid GdaLdapConnection)

base_dn

the base DN to search on, or null

filter

an LDAP filter, for example "(objectClass=*)"

attributes

the list (CSV format) of attributes to fetch, each in the format <attname>[::<GType>]

scope

the search scope

Returns:

a new DataModelLdap object