#NEWLINE# def handle_LDAPExtendedRequest( self , request , controls , reply ) : #NEWLINE# #INDENT# self . checkControls ( controls ) #NEWLINE# for handler in [ getattr ( self , attr ) for attr in dir ( self ) if attr . startswith ( 'extendedRequest_' ) ] : #NEWLINE# #INDENT# if ( getattr ( handler , 'oid' , None ) == request . requestName ) : #NEWLINE# #INDENT# berdecoder = getattr ( handler , 'berdecoder' , None ) #NEWLINE# if ( berdecoder is None ) : #NEWLINE# #INDENT# values = [ request . requestValue ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# values = pureber . berDecodeMultiple ( request . requestValue , berdecoder ) #NEWLINE# #UNINDENT# d = defer . maybeDeferred ( reply , * values , ** { #NEWLINE# #INDENT# 'reply' : reply , #NEWLINE# #UNINDENT# } ) #NEWLINE# def eb( fail , oid ) : #NEWLINE# #INDENT# fail . trap ( ldaperrors . LDAPException ) #NEWLINE# return pureldap . LDAPExtendedResponse ( resultCode = fail . value . resultCode , errorMessage = fail . value . message , responseName = oid ) #NEWLINE# #UNINDENT# d . addErrback ( eb , request . requestName ) #NEWLINE# return d #NEWLINE# #UNINDENT# #UNINDENT# raise ldaperrors . LDAPProtocolError ( ( 'Unknown extended request: %s' % request . requestName ) )