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