001    /*
002     * CDDL HEADER START
003     *
004     * The contents of this file are subject to the terms of the
005     * Common Development and Distribution License, Version 1.0 only
006     * (the "License").  You may not use this file except in compliance
007     * with the License.
008     *
009     * You can obtain a copy of the license at
010     * trunk/opends/resource/legal-notices/OpenDS.LICENSE
011     * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
012     * See the License for the specific language governing permissions
013     * and limitations under the License.
014     *
015     * When distributing Covered Code, include this CDDL HEADER in each
016     * file and include the License file at
017     * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
018     * add the following below this CDDL HEADER, with the fields enclosed
019     * by brackets "[]" replaced with your own identifying information:
020     *      Portions Copyright [yyyy] [name of copyright owner]
021     *
022     * CDDL HEADER END
023     *
024     *
025     *      Copyright 2006-2008 Sun Microsystems, Inc.
026     */
027    package org.opends.server.types.operation;
028    
029    
030    
031    import java.util.LinkedHashSet;
032    import java.util.List;
033    
034    import org.opends.server.types.*;
035    
036    
037    /**
038     * This class defines a set of methods that are available for use by
039     * pre-parse plugins for search operations.  Note that this interface
040     * is intended only to define an API for use by plugins and is not
041     * intended to be implemented by any custom classes.
042     */
043    @org.opends.server.types.PublicAPI(
044         stability=org.opends.server.types.StabilityLevel.UNCOMMITTED,
045         mayInstantiate=false,
046         mayExtend=false,
047         mayInvoke=true)
048    public interface PreParseSearchOperation
049           extends PreParseOperation
050    {
051      /**
052       * Retrieves the raw, unprocessed base DN as included in the request
053       * from the client.  This may or may not contain a valid DN, as no
054       * validation will have been performed.
055       *
056       * @return  The raw, unprocessed base DN as included in the request
057       *          from the client.
058       */
059      public ByteString getRawBaseDN();
060    
061    
062    
063      /**
064       * Specifies the raw, unprocessed base DN for this search operation.
065       *
066       * @param  rawBaseDN  The raw, unprocessed base DN for this search
067                            operation.
068       */
069      public void setRawBaseDN(ByteString rawBaseDN);
070    
071    
072    
073      /**
074       * Retrieves the scope for this search operation.
075       *
076       * @return  The scope for this search operation.
077       */
078      public SearchScope getScope();
079    
080    
081    
082      /**
083       * Specifies the scope for this search operation.
084       *
085       * @param  scope  The scope for this search operation.
086       */
087      public void setScope(SearchScope scope);
088    
089    
090    
091      /**
092       * Retrieves the alias dereferencing policy for this search
093       * operation.
094       *
095       * @return  The alias dereferencing policy for this search
096       *          operation.
097       */
098      public DereferencePolicy getDerefPolicy();
099    
100    
101    
102      /**
103       * Specifies the alias dereferencing policy for this search
104       * operation.
105       *
106       * @param  derefPolicy  The alias dereferencing policy for this
107       *                      search operation.
108       */
109      public void setDerefPolicy(DereferencePolicy derefPolicy);
110    
111    
112    
113      /**
114       * Retrieves the size limit for this search operation.
115       *
116       * @return  The size limit for this search operation.
117       */
118      public int getSizeLimit();
119    
120    
121    
122      /**
123       * Specifies the size limit for this search operation.
124       *
125       * @param  sizeLimit  The size limit for this search operation.
126       */
127      public void setSizeLimit(int sizeLimit);
128    
129    
130    
131      /**
132       * Retrieves the time limit for this search operation.
133       *
134       * @return  The time limit for this search operation.
135       */
136      public int getTimeLimit();
137    
138    
139    
140      /**
141       * Specifies the time limit for this search operation.
142       *
143       * @param  timeLimit  The time limit for this search operation.
144       */
145      public void setTimeLimit(int timeLimit);
146    
147    
148    
149      /**
150       * Retrieves the typesOnly flag for this search operation.
151       *
152       * @return  The typesOnly flag for this search operation.
153       */
154      public boolean getTypesOnly();
155    
156    
157    
158      /**
159       * Specifies the typesOnly flag for this search operation.
160       *
161       * @param  typesOnly  The typesOnly flag for this search operation.
162       */
163      public void setTypesOnly(boolean typesOnly);
164    
165    
166    
167      /**
168       * Retrieves the raw, unprocessed search filter as included in the
169       * request from the client.  It may or may not contain a valid
170       * filter (e.g., unsupported attribute types or values with an
171       * invalid syntax) because no validation will have been performed on
172       * it.
173       *
174       * @return  The raw, unprocessed search filter as included in the
175       *          request from the client.
176       */
177      public RawFilter getRawFilter();
178    
179    
180    
181      /**
182       * Specifies the raw, unprocessed search filter as included in the
183       * request from the client.
184       *
185       * @param  rawFilter  The raw, unprocessed search filter.
186       */
187      public void setRawFilter(RawFilter rawFilter);
188    
189    
190    
191      /**
192       * Retrieves the set of requested attributes for this search
193       * operation.  Its contents should not be be altered.
194       *
195       * @return  The set of requested attributes for this search
196       *          operation.
197       */
198      public LinkedHashSet<String> getAttributes();
199    
200    
201    
202      /**
203       * Specifies the set of requested attributes for this search
204       * operation.
205       *
206       * @param  attributes  The set of requested attributes for this
207       *                     search operation.
208       */
209      public void setAttributes(LinkedHashSet<String> attributes);
210    
211    
212    
213      /**
214       * Returns the provided entry to the client.
215       *
216       * @param  entry     The entry that should be returned.
217       * @param  controls  The set of controls to include with the entry
218       *                   (may be {@code null} if no controls should be
219       *                   included with the entry).
220       *
221       * @return  {@code true} if the caller should continue processing
222       *          the search request and sending additional entries and
223       *          references, or {@code false} if not for some reason
224       *          (e.g., the size limit has been reached or the search has
225       *          been abandoned).
226       */
227      public boolean returnEntry(Entry entry, List<Control> controls);
228    
229    
230    
231      /**
232       * Returns the provided search result reference to the client.
233       *
234       * @param  reference  The search reference that should be returned.
235       * @param  dn         A DN related to the specified search
236       *                    reference.
237       *
238       * @return  {@code true} if the caller should continue processing
239       *          the search request and sending additional entries and
240       *          references, or {@code false} if not for some reason
241       *          (e.g., the size limit has been reached or the search has
242       *          been abandoned).
243       */
244      public boolean
245      returnReference(DN dn, SearchResultReference reference);
246    }
247