001/*
002 * Copyright 2007-2020 Ping Identity Corporation
003 * All Rights Reserved.
004 */
005/*
006 * Copyright 2007-2020 Ping Identity Corporation
007 *
008 * Licensed under the Apache License, Version 2.0 (the "License");
009 * you may not use this file except in compliance with the License.
010 * You may obtain a copy of the License at
011 *
012 *    http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing, software
015 * distributed under the License is distributed on an "AS IS" BASIS,
016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017 * See the License for the specific language governing permissions and
018 * limitations under the License.
019 */
020/*
021 * Copyright (C) 2008-2020 Ping Identity Corporation
022 *
023 * This program is free software; you can redistribute it and/or modify
024 * it under the terms of the GNU General Public License (GPLv2 only)
025 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
026 * as published by the Free Software Foundation.
027 *
028 * This program is distributed in the hope that it will be useful,
029 * but WITHOUT ANY WARRANTY; without even the implied warranty of
030 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
031 * GNU General Public License for more details.
032 *
033 * You should have received a copy of the GNU General Public License
034 * along with this program; if not, see <http://www.gnu.org/licenses>.
035 */
036package com.unboundid.ldap.sdk;
037
038
039
040import java.util.List;
041
042import com.unboundid.util.NotExtensible;
043import com.unboundid.util.ThreadSafety;
044import com.unboundid.util.ThreadSafetyLevel;
045
046
047
048/**
049 * This interface defines a set of methods that may be safely called in an LDAP
050 * search request without altering its contents.  This interface must not be
051 * implemented by any class other than {@link SearchRequest}.
052 * <BR><BR>
053 * This interface does not inherently provide the assurance of thread safety for
054 * the methods that it exposes, because it is still possible for a thread
055 * referencing the object which implements this interface to alter the request
056 * using methods not included in this interface.  However, if it can be
057 * guaranteed that no thread will alter the underlying object, then the methods
058 * exposed by this interface can be safely invoked concurrently by any number of
059 * threads.
060 */
061@NotExtensible()
062@ThreadSafety(level=ThreadSafetyLevel.INTERFACE_NOT_THREADSAFE)
063public interface ReadOnlySearchRequest
064       extends ReadOnlyLDAPRequest
065{
066  /**
067   * Retrieves the base DN for this search request.
068   *
069   * @return  The base DN for this search request.
070   */
071  String getBaseDN();
072
073
074
075  /**
076   * Retrieves the scope for this search request.
077   *
078   * @return  The scope for this search request.
079   */
080  SearchScope getScope();
081
082
083
084  /**
085   * Retrieves the dereference policy that should be used by the server for any
086   * aliases encountered during search processing.
087   *
088   * @return  The dereference policy that should be used by the server for any
089   *          aliases encountered during search processing.
090   */
091  DereferencePolicy getDereferencePolicy();
092
093
094
095  /**
096   * Retrieves the maximum number of entries that should be returned by the
097   * server when processing this search request.
098   *
099   * @return  The maximum number of entries that should be returned by the
100   *          server when processing this search request, or zero if there is
101   *          no limit.
102   */
103  int getSizeLimit();
104
105
106
107  /**
108   * Retrieves the maximum length of time in seconds that the server should
109   * spend processing this search request.
110   *
111   * @return  The maximum length of time in seconds that the server should
112   *          spend processing this search request, or zero if there is no
113   *          limit.
114   */
115  int getTimeLimitSeconds();
116
117
118
119  /**
120   * Indicates whether the server should return only attribute names in matching
121   * entries, rather than both names and values.
122   *
123   * @return  {@code true} if matching entries should include only attribute
124   *          names, or {@code false} if matching entries should include both
125   *          attribute names and values.
126   */
127  boolean typesOnly();
128
129
130
131  /**
132   * Retrieves the filter that should be used to identify matching entries.
133   *
134   * @return  The filter that should be used to identify matching entries.
135   */
136  Filter getFilter();
137
138
139
140  /**
141   * Retrieves the set of requested attributes to include in matching entries.
142   *
143   * @return  The set of requested attributes to include in matching entries, or
144   *          an empty array if the default set of attributes (all user
145   *          attributes but no operational attributes) should be requested.
146   */
147  List<String> getAttributeList();
148
149
150
151  /**
152   * {@inheritDoc}
153   */
154  @Override()
155  SearchRequest duplicate();
156
157
158
159  /**
160   * {@inheritDoc}
161   */
162  @Override()
163  SearchRequest duplicate(Control[] controls);
164}