KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > directory > ldapstudio > browser > core > model > ISearch


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.ldapstudio.browser.core.model;
22
23
24 import java.io.Serializable JavaDoc;
25
26 import org.apache.directory.ldapstudio.browser.core.propertypageproviders.ConnectionPropertyPageProvider;
27 import org.apache.directory.ldapstudio.browser.core.propertypageproviders.SearchPropertyPageProvider;
28 import org.eclipse.core.runtime.IAdaptable;
29
30
31 /**
32  * An ISearch holds all search parameters and search results of an
33  * LDAP search.
34  *
35  * @author <a HREF="mailto:dev@directory.apache.org">Apache Directory Project</a>
36  * @version $Rev$, $Date$
37  */

38 public interface ISearch extends Serializable JavaDoc, IAdaptable, SearchPropertyPageProvider, ConnectionPropertyPageProvider
39 {
40
41     /** Constant for empty search base */
42     public static final DN EMPTY_SEARCH_BASE = new DN(); //$NON-NLS-1$
43

44     /** The returning attribute shortcut for all user attributes '*' */
45     public static final String JavaDoc ALL_USER_ATTRIBUTES = "*"; //$NON-NLS-1$
46

47     /** The returning attribute shortcut for all operational attributes '+' */
48     public static final String JavaDoc ALL_OPERATIONAL_ATTRIBUTES = "+"; //$NON-NLS-1$
49

50     /** Constant for no returning attributes, an empty array */
51     public static final String JavaDoc[] NO_ATTRIBUTES = new String JavaDoc[0];
52
53     /** True filter (objectClass=*) */
54     public static final String JavaDoc FILTER_TRUE = "(objectClass=*)"; //$NON-NLS-1$
55

56     /** False filter (!(objectClass=*)) */
57     public static final String JavaDoc FILTER_FALSE = "(!(objectClass=*))"; //$NON-NLS-1$
58

59     /** Search scope object */
60     public static final int SCOPE_OBJECT = 0;
61
62     /** Search scope one level */
63     public static final int SCOPE_ONELEVEL = 1;
64
65     /** Search scope subtree */
66     public static final int SCOPE_SUBTREE = 2;
67
68
69     /**
70      * Gets the LDAP URL of this search.
71      *
72      * @return the LDAP URL of this search
73      */

74     public abstract URL getUrl();
75
76
77     /**
78      * Checks if the hasChildren flag should be initialized.
79      *
80      * @return true, if the hasChildren flag should be initialized
81      */

82     public abstract boolean isInitHasChildrenFlag();
83
84
85     /**
86      * Checks if the isAlias and isReferral flags should be initialized.
87      *
88      * @return true, if the isAlias and isReferral flags should be initialized
89      */

90     public abstract boolean isInitAliasAndReferralFlag();
91
92
93     /**
94      * Gets the controls.
95      *
96      * @return the controls
97      */

98     public abstract Control[] getControls();
99
100
101     /**
102      * Gets the count limit, 0 means no limit.
103      *
104      * @return the count limit
105      */

106     public abstract int getCountLimit();
107
108
109     /**
110      * Sets the count limit, 0 means no limit.
111      *
112      * @param countLimit the count limit
113      */

114     public abstract void setCountLimit( int countLimit );
115
116
117     /**
118      * Gets the filter.
119      *
120      * @return the filter
121      */

122     public abstract String JavaDoc getFilter();
123
124
125     /**
126      * Sets the filter, a null or empty filter will be
127      * transformed to (objectClass=*).
128      *
129      * Calling this method causes firing a search update event.
130      *
131      * @param filter the filter
132      */

133     public abstract void setFilter( String JavaDoc filter );
134
135
136     /**
137      * Gets the returning attributes.
138      *
139      * @return the returning attributes
140      */

141     public abstract String JavaDoc[] getReturningAttributes();
142
143
144     /**
145      * Sets the returning attributes, an empty array indicates none,
146      * null will be transformed to '*' (all user attributes).
147      *
148      * Calling this method causes firing a search update event.
149      *
150      * @param returningAttributes the returning attributes
151      */

152     public abstract void setReturningAttributes( String JavaDoc[] returningAttributes );
153
154
155     /**
156      * Gets the search scope, one of ISearch.SCOPE_OBJECT,
157      * ISearch.SCOPE_ONELEVEL or ISearch.SCOPE_SUBTREE.
158      *
159      * @return the search scope
160      */

161     public abstract int getScope();
162
163
164     /**
165      * Sets the search scope, one of ISearch.SCOPE_OBJECT,
166      * ISearch.SCOPE_ONELEVEL or ISearch.SCOPE_SUBTREE.
167      *
168      * Calling this method causes firing a search update event.
169      *
170      * @param scope the search scope
171      */

172     public abstract void setScope( int scope );
173
174
175     /**
176      * Gets the aliases dereferencing method, one of IConnection.DEREFERENCE_ALIASES_NEVER,
177      * IConnection.DEREFERENCE_ALIASES_ALWAYS, IConnection.DEREFERENCE_ALIASES_FINDING
178      * or IConnection.DEREFERENCE_ALIASES_SEARCH.
179      *
180      *
181      * @return the aliases dereferencing method
182      */

183     public abstract int getAliasesDereferencingMethod();
184
185
186     /**
187      * Sets the aliases dereferencing method, one of IConnection.DEREFERENCE_ALIASES_NEVER,
188      * IConnection.DEREFERENCE_ALIASES_ALWAYS, IConnection.DEREFERENCE_ALIASES_FINDING
189      * or IConnection.DEREFERENCE_ALIASES_SEARCH.
190      *
191      * Calling this method causes firing a search update event.
192      *
193      * @param aliasesDereferencingMethod the aliases dereferencing method
194      */

195     public abstract void setAliasesDereferencingMethod( int aliasesDereferencingMethod );
196
197
198     /**
199      * Gets the referrals handling method, one of IConnection.HANDLE_REFERRALS_IGNORE
200      * or IConnection.HANDLE_REFERRALS_FOLLOW.
201      *
202      * @return the referrals handling method
203      */

204     public abstract int getReferralsHandlingMethod();
205
206
207     /**
208      * Sets the referrals handling method, one of IConnection.HANDLE_REFERRALS_IGNORE or
209      * IConnection.HANDLE_REFERRALS_FOLLOW.
210      *
211      * Calling this method causes firing a search update event.
212      *
213      * @param referralsHandlingMethod the referrals handling method
214      */

215     public abstract void setReferralsHandlingMethod( int referralsHandlingMethod );
216
217
218     /**
219      * Gets the search base.
220      *
221      * @return the search base
222      */

223     public abstract DN getSearchBase();
224
225
226     /**
227      * Sets the search base, a null search base will be
228      * transformed to an empty DN.
229      *
230      * Calling this method causes firing a search update event.
231      *
232      * @param searchBase the search base
233      */

234     public abstract void setSearchBase( DN searchBase );
235
236
237     /**
238      * Gets the time limit in milliseconds, 0 means no limit.
239      *
240      * @return the time limit
241      */

242     public abstract int getTimeLimit();
243
244
245     /**
246      * Sets the time limit in milliseconds, 0 means no limit.
247      *
248      * Calling this method causes firing a search update event.
249      *
250      * @param timeLimit the time limit
251      */

252     public abstract void setTimeLimit( int timeLimit );
253
254
255     /**
256      * Gets the symbolic name.
257      *
258      * @return the name
259      */

260     public abstract String JavaDoc getName();
261
262
263     /**
264      * Sets the symbolic name.
265      *
266      * Calling this method causes firing a search update event.
267      *
268      * @param name the name
269      */

270     public abstract void setName( String JavaDoc searchName );
271
272
273     /**
274      * Gets the search results, null indicates that the
275      * search wasn't performed yet.
276      *
277      * @return the search results
278      */

279     public abstract ISearchResult[] getSearchResults();
280
281
282     /**
283      * Sets the search results.
284      *
285      * Calling this method causes firing a search update event.
286      *
287      * @param searchResults the search results
288      */

289     public abstract void setSearchResults( ISearchResult[] searchResults );
290
291
292     /**
293      * Checks if the count limit exceeded.
294      *
295      * @return true, if the count limit exceeded
296      */

297     public abstract boolean isCountLimitExceeded();
298
299
300     /**
301      * Sets the count limit exceeded flag.
302      *
303      * Calling this method causes firing a search update event.
304      *
305      * @param countLimitExceeded the count limit exceeded flag
306      */

307     public abstract void setCountLimitExceeded( boolean countLimitExceeded );
308
309
310     /**
311      * Gets the connection.
312      *
313      * @return the connection
314      */

315     public abstract IConnection getConnection();
316
317
318     /**
319      * Sets the connection.
320      *
321      * Calling this method causes firing a search update event.
322      *
323      * @param connection the connection
324      */

325     public abstract void setConnection( IConnection connection );
326
327
328     /**
329      * Clones this search.
330      *
331      * @return the cloned search
332      */

333     public abstract Object JavaDoc clone();
334
335
336     /**
337      * Gets the search parameter.
338      *
339      * @return the search parameter
340      */

341     public abstract SearchParameter getSearchParameter();
342
343
344     /**
345      * Sets the search parameter.
346      *
347      * @param searchParameter the search parameter
348      */

349     public abstract void setSearchParameter( SearchParameter searchParameter );
350
351 }
352
Popular Tags