John Marmion <[EMAIL PROTECTED]> writes:
> 
> I wanted to get back to you before the weekend to give you
> my very early impressions of using the XPCOM LDAP Wrapper. We will
> be very happy to use it. It looks like a solid bit of 
> engineering. 

Thanks!  Glad it looks to meet your needs.  We hope to soon set up a
bugzilla component for it so that there's a place to track bugs,
features requests, etc.

> I notice that it has Query only functionality and that it employs 
> ayschronous access. We will be hoping to add Add/Edit/Delete 
> functionality at some stage. But we can discuss these issues 
> later, at this point I am anxious to understand the 
> implementation. 

Yes, it should have more than query access.  Query acess just seemed
like the best first thing to implement.  Most of the focus has been on
asynchronous stuff thus far because there are relatively few places in
Mozilla where one can afford to stall out the current thread waiting
for network results to return.

> As usual for me I wrote a simple C program to access the XPCOM
> component. We have created a local LDAP Directory Server and I want
> to a pass in a URL select string and retrieve the corresponding
> entries:
> 
> 1. create a URL object
> 2. SetSpec
> 
> 3. Create Connection Object
> 4. Connection.Init using URL.host , URL.port etc..
> 
> 5. Create Operation Object 
> 6. Operation.Init(connection, .......MessageListener)
> 7. Operation.SimpleBind()
> 8. Operation.UrlSearch()

Last time I tried it, UrlSearch didn't really work right.... see the
comments in nsILDAPOperation.idl for a bit more info, as well as bug
44017.

> I am having difficulty in understanding the MessageListener 
> and the relationship with the Message Object --
> as I don't see how it is created. Typically what I want to
> is a UrlSearch followed by getting the attributes and results.
>
> Perhaps you can shed some light on this for me.. 

My initial plan was to try and use UrlSearch to do the work for
nsLDAPChannel.  But I eventually came to the conclusion that was
likely to cause me problems because its synchronicity problems and
because it wasn't really factored the way I wanted.

Basically, the nsIMessageListener is a callback interface that the
client of the XPCOM wrapper implements to get results from an async
operation.  Each time onLDAPMessage gets called, the parameter to that 
function is a newly created nsILDAPMessage, created by the XPCOM
wrapper as the corresponding protocol message arrived from the server.

For a more-or-less working example of some of this stuff, take a look
at nsLDAPChannel, especially the AsyncRead, and OnLDAP* methods.

Dan


Reply via email to