directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@gmail.com>
Subject Re: Implementing a simple interceptor: Adding it to the chain
Date Sat, 06 Feb 2010 23:14:46 GMT
On 2/6/10 9:38 PM, Stefan Zoerner wrote:
> Hi all,
>
> in order to complete the examples in our Advanced User's Guide for 
> ApacheDS, I have started to create and document a simple interceptor 
> as a starting point for developers, who are interested to extend the 
> server that way.
>
> http://cwiki.apache.org/confluence/display/DIRxSBOX/Implementing+a+simple+interceptor

>
>
> It would be great if those who know the internals of the server would 
> review the example and check whether it is OK. Although it works, 
> there is probably still room for improvement. Any feedback is highly 
> appreciated.
I will have a look at it tomorrow.
>
> If the page is reviewed and complete, I will move it to the Advanced 
> User's Guide (chapter 6. Extending the server).
>
> And at least one thing is probably wrong in the example: The position 
> of the interceptor within the chain. Currently, I simply add it at the 
> end with this code:
Probably not the right place, as this is where we have put the logger 
interceptor. The reason why the logger is at the end is that it must 
only log operations that have been successfully executed.

However, there is no standard place to inject the interceptor, and this 
is something we have to fix in the server.
>
>
> DirectoryService directoryService = new DefaultDirectoryService();
> directoryService.setShutdownHookEnabled(true);
>
> LdapServer ldapServer = new LdapServer();
> ldapServer.setDirectoryService(directoryService);
> ldapServer.setAllowAnonymousAccess(true);
>
> List<Interceptor> is = directoryService.getInterceptors();
> is.add(new PasswordHashInterceptor());
> directoryService.setInterceptors(is);
>
>
> Any recommendations where to add it in the list, and how to accomplish 
> the task of a positional addition, e.g. "after SubentryInterceptor"?
Let me check what this interceptor does, and I'll give you some advice 
about where to inject it.

Thanks a lot for this doco !

-- 
Regards,
Cordialement,
Emmanuel L├ęcharny
www.nextury.com



Mime
View raw message