[prev in list] [next in list] [prev in thread] [next in thread]
List: python-ldap-dev
Subject: Re: set_rebind_proc
From: Michael_Ströder <michael () stroeder ! com>
Date: 2002-06-30 17:09:36
[Download RAW message or body]
Steffen Ries wrote:
>
>>I have to admit that I'm scared about adding such functionality into
>>the C part of python-ldap. I'd like to encourage you to find a
>>Python-only solution which is easier to maintain. BTW: That's exactly
>>one of the benefits of class ldap.ldapobject.LDAPObject: It can be
>>sub-classed for extending its functionality.
>
> Hmm. Implementing a Python-only solution would require to catch the
> ldap.REFERRAL (or ldap.PARTIAL_RESULT) for each of the operations,
> decide how to chase the referral and then retry the operation. I can
> try to come up with a proposal...
> [..]
>>I'd rather like to see a framework which helps the application
>>developer to implement generic exception handlers for
>>e.g. ldap.SERVER_DOWN or ldap.REFERRAL and decide what to do in
>>his/her specific environment.
>
> Are you thinking of registering error specific exception handlers or
> pushing the functionality to the application?
LDAPObject._ldap_call could be the point from where registered
exception handlers are called. E.g. a new method
LDAPObject.ErrorHandler(e,func,args,kwargs) could check whether a
generic handler method is registered for a specific LDAPError
class and call that handler with these parameters.
Now the application would sub-class LDAPObject and implement such
handlers applying the specific knowledge about the environment.
Note that we have the advantage of having OO-oriented API and
exceptions. Therefore we aren't limited to such crude mechanisms
common in C like call-back functions. IMHO we should think in this
direction.
> I would like to add some functionality to the library (call it a
> framework), rather than burden the application to wrap every
> search/add/modify with an exception handler for chasing referrals. I
> have this kind of code in some places for fail over, which makes it
> pretty hard to maintain.
Well, I'd like to have something in the python-ldap library too.
But although it sounds pretty easy I guess it's not. There are
some caveats I'm sure (e.g. some kind of nested error handling in
exception handlers...).
Ciao, Michael.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Python-LDAP-dev mailing list
Python-LDAP-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic