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