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 legal-notices/CDDLv1_0.txt
010 * or http://forgerock.org/license/CDDLv1.0.html.
011 * See the License for the specific language governing permissions
012 * and limitations under the License.
013 *
014 * When distributing Covered Code, include this CDDL HEADER in each
015 * file and include the License file at legal-notices/CDDLv1_0.txt.
016 * If applicable, add the following below this CDDL HEADER, with the
017 * fields enclosed by brackets "[]" replaced with your own identifying
018 * information:
019 *      Portions Copyright [yyyy] [name of copyright owner]
020 *
021 * CDDL HEADER END
022 *
023 *
024 *      Copyright 2008-2009 Sun Microsystems, Inc.
025 *      Portions Copyright 2011-2015 ForgeRock AS
026 */
027package org.opends.server.core;
028
029import java.util.List;
030import java.util.Set;
031
032import org.forgerock.opendj.ldap.ByteString;
033import org.forgerock.opendj.ldap.DereferenceAliasesPolicy;
034import org.forgerock.opendj.ldap.SearchScope;
035import org.opends.server.controls.MatchedValuesControl;
036import org.opends.server.types.*;
037
038/**
039 * This abstract class wraps/decorates a given search operation.
040 * This class will be extended by sub-classes to enhance the
041 * functionality of the SearchOperationBasis.
042 */
043public abstract class SearchOperationWrapper extends
044    OperationWrapper<SearchOperation> implements SearchOperation
045{
046
047  /**
048   * Creates a new search operation based on the provided search operation.
049   *
050   * @param search The search operation to wrap
051   */
052  protected SearchOperationWrapper(SearchOperation search)
053  {
054    super(search);
055  }
056
057  /** {@inheritDoc} */
058  @Override
059  public boolean returnEntry(Entry entry, List<Control> controls)
060  {
061    return getOperation().returnEntry(entry, controls);
062  }
063
064  /** {@inheritDoc} */
065  @Override
066  public boolean returnEntry(Entry entry, List<Control> controls,
067                             boolean evaluateAci)
068  {
069    return getOperation().returnEntry(entry, controls, evaluateAci);
070  }
071
072  /** {@inheritDoc} */
073  @Override
074  public boolean returnReference(DN dn, SearchResultReference reference)
075  {
076    return getOperation().returnReference(dn, reference);
077  }
078
079  /** {@inheritDoc} */
080  @Override
081  public boolean returnReference(DN dn, SearchResultReference reference,
082                                 boolean evaluateAci)
083  {
084    return getOperation().returnReference(dn, reference, evaluateAci);
085  }
086
087  /** {@inheritDoc} */
088  @Override
089  public String toString()
090  {
091    return getOperation().toString();
092  }
093
094  /** {@inheritDoc} */
095  @Override
096  public Set<String> getAttributes()
097  {
098    return getOperation().getAttributes();
099  }
100
101  /** {@inheritDoc} */
102  @Override
103  public DN getBaseDN()
104  {
105    return getOperation().getBaseDN();
106  }
107
108  /** {@inheritDoc} */
109  @Override
110  public DereferenceAliasesPolicy getDerefPolicy()
111  {
112    return getOperation().getDerefPolicy();
113  }
114
115  /** {@inheritDoc} */
116  @Override
117  public int getEntriesSent()
118  {
119    return getOperation().getEntriesSent();
120  }
121
122  /** {@inheritDoc} */
123  @Override
124  public SearchFilter getFilter()
125  {
126    return getOperation().getFilter();
127  }
128
129  /** {@inheritDoc} */
130  @Override
131  public ByteString getRawBaseDN()
132  {
133    return getOperation().getRawBaseDN();
134  }
135
136  /** {@inheritDoc} */
137  @Override
138  public RawFilter getRawFilter()
139  {
140    return getOperation().getRawFilter();
141  }
142
143  /** {@inheritDoc} */
144  @Override
145  public int getReferencesSent()
146  {
147    return getOperation().getReferencesSent();
148  }
149
150  /** {@inheritDoc} */
151  @Override
152  public SearchScope getScope()
153  {
154    return getOperation().getScope();
155  }
156
157  /** {@inheritDoc} */
158  @Override
159  public int getSizeLimit()
160  {
161    return getOperation().getSizeLimit();
162  }
163
164  /** {@inheritDoc} */
165  @Override
166  public int getTimeLimit()
167  {
168    return getOperation().getTimeLimit();
169  }
170
171  /** {@inheritDoc} */
172  @Override
173  public boolean getTypesOnly()
174  {
175    return getOperation().getTypesOnly();
176  }
177
178  /** {@inheritDoc} */
179  @Override
180  public void sendSearchResultDone()
181  {
182    getOperation().sendSearchResultDone();
183  }
184
185  /** {@inheritDoc} */
186  @Override
187  public void setAttributes(Set<String> attributes)
188  {
189    getOperation().setAttributes(attributes);
190  }
191
192  /** {@inheritDoc} */
193  @Override
194  public void setBaseDN(DN baseDN)
195  {
196    getOperation().setBaseDN(baseDN);
197  }
198
199  /** {@inheritDoc} */
200  @Override
201  public void setDerefPolicy(DereferenceAliasesPolicy derefPolicy)
202  {
203    getOperation().setDerefPolicy(derefPolicy);
204  }
205
206  /** {@inheritDoc} */
207  @Override
208  public void setRawBaseDN(ByteString rawBaseDN)
209  {
210    getOperation().setRawBaseDN(rawBaseDN);
211  }
212
213  /** {@inheritDoc} */
214  @Override
215  public void setRawFilter(RawFilter rawFilter)
216  {
217    getOperation().setRawFilter(rawFilter);
218  }
219
220  /** {@inheritDoc} */
221  @Override
222  public void setScope(SearchScope scope)
223  {
224    getOperation().setScope(scope);
225  }
226
227  /** {@inheritDoc} */
228  @Override
229  public void setSizeLimit(int sizeLimit)
230  {
231    getOperation().setSizeLimit(sizeLimit);
232  }
233
234  /** {@inheritDoc} */
235  @Override
236  public void setTimeLimit(int timeLimit)
237  {
238    getOperation().setTimeLimit(timeLimit);
239  }
240
241  /** {@inheritDoc} */
242  @Override
243  public void setTypesOnly(boolean typesOnly)
244  {
245    getOperation().setTypesOnly(typesOnly);
246  }
247
248  /** {@inheritDoc} */
249  @Override
250  public void setTimeLimitExpiration(long timeLimitExpiration)
251  {
252    getOperation().setTimeLimitExpiration(timeLimitExpiration);
253  }
254
255  /** {@inheritDoc} */
256  @Override
257  public boolean isReturnSubentriesOnly()
258  {
259    return getOperation().isReturnSubentriesOnly();
260  }
261
262  /** {@inheritDoc} */
263  @Override
264  public void setReturnSubentriesOnly(boolean returnLDAPSubentries)
265  {
266    getOperation().setReturnSubentriesOnly(returnLDAPSubentries);
267  }
268
269  /** {@inheritDoc} */
270  @Override
271  public MatchedValuesControl getMatchedValuesControl()
272  {
273    return getOperation().getMatchedValuesControl();
274  }
275
276  /** {@inheritDoc} */
277  @Override
278  public void setMatchedValuesControl(MatchedValuesControl controls)
279  {
280    getOperation().setMatchedValuesControl(controls);
281  }
282
283  /** {@inheritDoc} */
284  @Override
285  public boolean isIncludeUsableControl()
286  {
287    return getOperation().isIncludeUsableControl();
288  }
289
290  /** {@inheritDoc} */
291  @Override
292  public void setIncludeUsableControl(boolean includeUsableControl)
293  {
294    getOperation().setIncludeUsableControl(includeUsableControl);
295  }
296
297  /** {@inheritDoc} */
298  @Override
299  public long getTimeLimitExpiration()
300  {
301    return getOperation().getTimeLimitExpiration();
302  }
303
304  /** {@inheritDoc} */
305  @Override
306  public boolean isClientAcceptsReferrals()
307  {
308    return getOperation().isClientAcceptsReferrals();
309  }
310
311  /** {@inheritDoc} */
312  @Override
313  public void setClientAcceptsReferrals(boolean clientAcceptReferrals)
314  {
315    getOperation().setClientAcceptsReferrals(clientAcceptReferrals);
316  }
317
318  /** {@inheritDoc} */
319  @Override
320  public boolean isSendResponse()
321  {
322    return getOperation().isSendResponse();
323  }
324
325  /** {@inheritDoc} */
326  @Override
327  public void setSendResponse(boolean sendResponse)
328  {
329    getOperation().setSendResponse(sendResponse);
330  }
331
332  /** {@inheritDoc} */
333  @Override
334  public boolean isRealAttributesOnly(){
335    return getOperation().isRealAttributesOnly();
336  }
337
338  /** {@inheritDoc} */
339  @Override
340  public void setRealAttributesOnly(boolean realAttributesOnly){
341    getOperation().setRealAttributesOnly(realAttributesOnly);
342  }
343
344  /** {@inheritDoc} */
345  @Override
346  public boolean isVirtualAttributesOnly()
347  {
348    return getOperation().isVirtualAttributesOnly();
349  }
350
351  /** {@inheritDoc} */
352  @Override
353  public void setVirtualAttributesOnly(boolean virtualAttributesOnly){
354    getOperation().setVirtualAttributesOnly(virtualAttributesOnly);
355  }
356
357  /** {@inheritDoc} */
358  @Override
359  public void sendSearchEntry(SearchResultEntry entry)
360      throws DirectoryException
361  {
362    getOperation().sendSearchEntry(entry);
363  }
364
365  /** {@inheritDoc} */
366  @Override
367  public boolean sendSearchReference(SearchResultReference reference)
368      throws DirectoryException
369  {
370    return getOperation().sendSearchReference(reference);
371  }
372
373}