This class extends SPOPS::LDAP with one purpose: be able to fetch objects from multiple datasources. This can happen when you have got objects dispersed among multiple directories -- for instance, your 'Accounting' department is on one LDAP server and your 'Development' department on another. One class can (more or less -- see below) link the two LDAP servers.

Every object is tagged with the datasource it came from (in the _datasource property, if you ever need it), and any calls to save() or remove() will use this datasource to retrieve the proper connection for the object.

The fetch() method is the only functional method overridden from SPOPS::LDAP. The fetch_group() or fetch_iterator() methods will only use the first datasource in the listing, whatever datasource you pass in with the parameter 'connect_key' or whatever LDAP connection handle you pass in with the parameter 'ldap'. If you want to retrieve objects from multiple datasources using the same filter, use the fetch_group_all() method.

The fetch_iterator() method is not supported at all for multiple datasources -- use fetch_group_all() in conjunction with SPOPS::Iterator::WrapList if your implementation expects an SPOPS::Iterator object.

Given the normal parameters for fetch(), tries to retrieve an object matching either the $id or the 'filter' specified in \%params from one of the datasources. When it finds an object it is immediately returned.

If you pass in the key 'ldap' in \%params, this functions as the fetch() does in SPOPS::LDAP and multiple datasources are not used.

Returns: SPOPS object (if found), or undef.

fetch_group_all( \%params )

Given the normal parameters for fetch_group(), retrieves all objects matching the parameters from all datasources. Use with caution.

Returns: Arrayref of SPOPS objects.

save( \%params )

Just pass along the right handle to the actual save() method in SPOPS::LDAP.

remove( \%params )

Just pass along the right handle to the actual remove() method in SPOPS::LDAP.

base_dn( $connect_key )

Returns the full base DN associated with $connect_key.

get_partial_dn( $connect_key )

Retrieves the partial base DN associated with $connect_key.

get_connect_key()

If called, returns either the value of the config key 'default_datasource' or the value of the class constant 'DEFAULT_CONNECT_KEY', which is normally 'main'.