View Javadoc

1   /*
2    * Copyright 2002-2005 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package net.sf.ldaptemplate;
17  
18  import javax.naming.NamingEnumeration;
19  import javax.naming.NamingException;
20  import javax.naming.directory.DirContext;
21  
22  /***
23   * Interface for delegating an actual search operation. The typical
24   * implementation of executeSearch would be something like:
25   * 
26   * <pre>
27   * return ctx.search(dn, filter, searchControls);
28   * </pre>
29   * 
30   * @see net.sf.ldaptemplate.LdapTemplate#search(SearchExecutor,
31   *      SearchResultCallbackHandler)
32   * 
33   * @author Mattias Arthursson
34   */
35  public interface SearchExecutor {
36      /***
37       * Execute the actual search.
38       * 
39       * @param ctx
40       *            the DirContext on which to work.
41       * @return the NamingEnumeration resulting from the search operation.
42       * @throws NamingException
43       *             if the search results in one.
44       */
45      public NamingEnumeration executeSearch(DirContext ctx)
46              throws NamingException;
47  }