directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Zoerner <ste...@labeo.de>
Subject Implementing a simple interceptor: Adding it to the chain
Date Sat, 06 Feb 2010 20:38:07 GMT
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.

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:


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"?

The default list of interceptors goes this:

# org.apache.directory.server.core.normalization.NormalizationInterceptor
# org.apache.directory.server.core.authn.AuthenticationInterceptor
# org.apache.directory.server.core.referral.ReferralInterceptor
# org.apache.directory.server.core.authz.AciAuthorizationInterceptor
# org.apache.directory.server.core.authz.DefaultAuthorizationInterceptor
# org.apache.directory.server.core.exception.ExceptionInterceptor
# org.apache.directory.server.core.changelog.ChangeLogInterceptor
# 
org.apache.directory.server.core.operational.OperationalAttributeInterceptor
# org.apache.directory.server.core.schema.SchemaInterceptor
# org.apache.directory.server.core.subtree.SubentryInterceptor
# org.apache.directory.server.core.collective.CollectiveAttributeInterceptor
# org.apache.directory.server.core.event.EventInterceptor
# org.apache.directory.server.core.trigger.TriggerInterceptor
# org.apache.directory.server.core.journal.JournalInterceptor

Thanks in advance,
     StefanZ

Mime
View raw message