1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.ldap.server.db;
18
19
20 import javax.naming.NamingException;
21 import javax.naming.directory.SearchControls;
22 import javax.naming.directory.SearchResult;
23 import javax.naming.ldap.LdapContext;
24
25
26 /***
27 * A filter is used to modify search results while they are being returned from
28 * naming enumerations containing DbSearchResults. These filters are used in
29 * conjunction with a {@link org.apache.ldap.server.db.ResultFilteringEnumeration}. Multiple filters can
30 * be applied one after the other and hence they are stackable.
31 *
32 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
33 * @version $Rev: 157708 $
34 */
35 public interface SearchResultFilter
36 {
37 /***
38 * Filters the contents of search results on the way out the door to client
39 * callers. These filters can and do produce side-effects on the results if
40 * if need be the attributes or names within the result should be cloned.
41 *
42 * @param result the database search result to return
43 * @param controls search controls associated with the invocation
44 * @return true if the result is to be returned, false if it is to be
45 * discarded from the result set
46 */
47 boolean accept( LdapContext ctx, SearchResult result, SearchControls controls )
48 throws NamingException;
49 }