Hi,

Attached is an HTML file describing briefly how LDAP connections will be handled and pooled by the LDAP Service manager. The LDAP service will be responsible for creating new LDAP connections, as well as shutting them down when not used for a certain amount of time.

Again, this is a first draft, so feedback and comments are much appreciated.

-- Leif

file:/u/leif/Services.html
 


LDAP Service

The LDAP service object will be responsible for managing two types of objects, nsLDAPConnection and nsLDAPServer. The latter interface is new, and will hold all authentication and credential information related to a certain LDAP servers preference. It depends on nsLDAPURL. Get/Set methods for username, password and, eventually, certificate/PSM handles are avialable, as well as any other information related to the LDAP server (e.g. max number of entries to return, timeouts etc.).

We have two alternatives to populate the LDAP Service with nsLDAPServer objects.

  1. Upon instantiation of the LDAP Service object, one nsLDAPServer object per LDAP server preference will be created, and added to the service. We could possibly isolate the Mozilla preferences dependencies by having a callback funtion passed to the LDAP Service object, which is then called to prefill nsLDAPServers.
  2. A client of the LDAP Service will request an nsLDAPServer object. If one already exists, it's returned, otherwise an empty object is created and returned. The client is then expected to fill in relevant information, like the URI, credentials etc. if needed.
Extra ('user defined') nsLDAPServer objects can be added to the LDAP service object by calling the AddServer method. This feature is not scheduled to be supported for Mozilla v0.9.

The LDAP Service implements a GetServer method, which takes as an argument the unique identifier, perhaps from the LDAP preferences (e.g. "ldap1"). It will return the nsLDAPServer object related to the specific LDAP server. This will later be used to request a connection from the LDAP Service.

The LDAP service object also  implements a GetConnection() method. It will take one argument, an nsLDAPServer handle. The service will then return a ready to use LDAP connection object (nsLDAPConnection). This is possibly a brand new connection, a connection that's been reconnected after a timeout, or one that's already available and ready to use (cached). But in either case, we promise that the connection is live and functional when returned to the client.

Example:


A client of the LDAP service would do something in the line of:

ldapID = <LDAP server prefs ID selected, e.g. 'ldap1'>;

ldapServer = service->GetServer(ldapID);
conn = service->GetConnection(ldapServer);
.
.
.
 

Reply via email to