Work in progress

This site is in the process of being reviewed and updated.

Merge lookup (2), list (1), hasEntry (1) and search (1) methods into a single search method in the InterceptorChain

Current situation

We have the following methods in the Interceptor interface:

  • Attributes lookup( NextInterceptor next, LdapDN name )
  • Attributes lookup( NextInterceptor next, LdapDN dn, String[] attrIds )
  • boolean hasEntry( NextInterceptor next, LdapDN name )
  • NamingEnumeration list( NextInterceptor next, LdapDN baseName )
  • NamingEnumeration search( NextInterceptor next, LdapDN baseName, Map environment, ExprNode filter, SearchControls searchControls )

Problem

Although they all share similar semantics (search), they are implemented as 5 distinct methods (for performance requirements). This requires to handle each of these methods with small changes in all relevant services (like AuthorizationService).

Solution

Merge all these methods into a generic search method. Still keep those methods in the external API and call the search method with appropriate parameters over the InterceptorChain. Also keep these methods in the Partition interface. To still provide similar performance, determine special routines like lookup and list via the search method parameters in the last interceptor and make it call appropriate optimized Partition methods. For example "if filter is null and scope is baseObject then call lookup", "if filter is null and scope is oneLevel then call list".

New architecture

lookup()    |                      |lookup()
list()      |-----> search() ----->|list() 
hasEntry()  |<---------------------|hasEntry()
search()    |                      |search()
------------ ---------------------  ----------
External API   Interceptor Chain    Partition

Define and use operation context parameters as the only parameter for each Interceptor method

....

  • No labels