View Javadoc
1   /*
2    *   Licensed to the Apache Software Foundation (ASF) under one
3    *   or more contributor license agreements.  See the NOTICE file
4    *   distributed with this work for additional information
5    *   regarding copyright ownership.  The ASF licenses this file
6    *   to you under the Apache License, Version 2.0 (the
7    *   "License"); you may not use this file except in compliance
8    *   with the License.  You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   *   Unless required by applicable law or agreed to in writing,
13   *   software distributed under the License is distributed on an
14   *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   *   KIND, either express or implied.  See the License for the
16   *   specific language governing permissions and limitations
17   *   under the License.
18   *
19   */
20  
21  package org.apache.directory.api.ldap.model.cursor;
22  
23  
24  import org.apache.directory.api.ldap.model.entry.Entry;
25  import org.apache.directory.api.ldap.model.exception.LdapException;
26  import org.apache.directory.api.ldap.model.message.IntermediateResponse;
27  import org.apache.directory.api.ldap.model.message.Referral;
28  import org.apache.directory.api.ldap.model.message.Response;
29  import org.apache.directory.api.ldap.model.message.SearchResultDone;
30  
31  
32  /**
33   * An extension of Cursor which includes the retrieval of the SearchResultDone. 
34   * 
35   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
36   */
37  public interface SearchCursor extends Cursor<Response>
38  {
39      /**
40       * @return true if the cursor has processed all the elements we were searching
41       */
42      boolean isDone();
43  
44  
45      /**
46       * gives the SearchResultDone message received at the end of search results
47       * 
48       * @return the SearchResultDone message, null if the search operation fails for any reason 
49       */
50      SearchResultDone getSearchResultDone();
51  
52  
53      /**
54       * @return true if the next element in the cursor is a referral 
55       */
56      boolean isReferral();
57  
58  
59      /**
60       * @return The next referral element, if it's a referral 
61       * @throws LdapException If the 
62       */
63      Referral getReferral() throws LdapException;
64  
65  
66      /**
67       * @return true if the next element in the cursor is an entry 
68       */
69      boolean isEntry();
70  
71  
72      /**
73       * @return The next entry element, if it's an entry 
74       * @throws LdapException If the 
75       */
76      Entry getEntry() throws LdapException;
77  
78  
79      /**
80       * @return true if the next element in the cursor is an intermediate response 
81       */
82      boolean isIntermediate();
83  
84  
85      /**
86       * @return The next intermediate response element, if it's an intermediate response 
87       * @throws LdapException If the 
88       */
89      IntermediateResponse getIntermediate() throws LdapException;
90  }