001/* 002 * Copyright 2007-2024 Ping Identity Corporation 003 * All Rights Reserved. 004 */ 005/* 006 * Copyright 2007-2024 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) 2007-2024 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.NotNull; 044import com.unboundid.util.Nullable; 045import com.unboundid.util.ThreadSafety; 046import com.unboundid.util.ThreadSafetyLevel; 047 048 049 050/** 051 * This interface defines a set of methods that may be safely called in an LDAP 052 * search request without altering its contents. This interface must not be 053 * implemented by any class other than {@link SearchRequest}. 054 * <BR><BR> 055 * This interface does not inherently provide the assurance of thread safety for 056 * the methods that it exposes, because it is still possible for a thread 057 * referencing the object which implements this interface to alter the request 058 * using methods not included in this interface. However, if it can be 059 * guaranteed that no thread will alter the underlying object, then the methods 060 * exposed by this interface can be safely invoked concurrently by any number of 061 * threads. 062 */ 063@NotExtensible() 064@ThreadSafety(level=ThreadSafetyLevel.INTERFACE_NOT_THREADSAFE) 065public interface ReadOnlySearchRequest 066 extends ReadOnlyLDAPRequest 067{ 068 /** 069 * Retrieves the base DN for this search request. 070 * 071 * @return The base DN for this search request. 072 */ 073 @NotNull() 074 String getBaseDN(); 075 076 077 078 /** 079 * Retrieves the base DN for this search request, parsed as a DN object. 080 * 081 * @return The base DN for this search request, parsed as a DN object. 082 * 083 * @throws LDAPException If the base DN string cannot be parsed as a valid 084 * DN. 085 */ 086 @NotNull() 087 DN getParsedBaseDN() 088 throws LDAPException; 089 090 091 092 /** 093 * Retrieves the scope for this search request. 094 * 095 * @return The scope for this search request. 096 */ 097 @NotNull() 098 SearchScope getScope(); 099 100 101 102 /** 103 * Retrieves the dereference policy that should be used by the server for any 104 * aliases encountered during search processing. 105 * 106 * @return The dereference policy that should be used by the server for any 107 * aliases encountered during search processing. 108 */ 109 @NotNull() 110 DereferencePolicy getDereferencePolicy(); 111 112 113 114 /** 115 * Retrieves the maximum number of entries that should be returned by the 116 * server when processing this search request. 117 * 118 * @return The maximum number of entries that should be returned by the 119 * server when processing this search request, or zero if there is 120 * no limit. 121 */ 122 int getSizeLimit(); 123 124 125 126 /** 127 * Retrieves the maximum length of time in seconds that the server should 128 * spend processing this search request. 129 * 130 * @return The maximum length of time in seconds that the server should 131 * spend processing this search request, or zero if there is no 132 * limit. 133 */ 134 int getTimeLimitSeconds(); 135 136 137 138 /** 139 * Indicates whether the server should return only attribute names in matching 140 * entries, rather than both names and values. 141 * 142 * @return {@code true} if matching entries should include only attribute 143 * names, or {@code false} if matching entries should include both 144 * attribute names and values. 145 */ 146 boolean typesOnly(); 147 148 149 150 /** 151 * Retrieves the filter that should be used to identify matching entries. 152 * 153 * @return The filter that should be used to identify matching entries. 154 */ 155 @NotNull() 156 Filter getFilter(); 157 158 159 160 /** 161 * Retrieves the set of requested attributes to include in matching entries. 162 * 163 * @return The set of requested attributes to include in matching entries, or 164 * an empty array if the default set of attributes (all user 165 * attributes but no operational attributes) should be requested. 166 */ 167 @NotNull() 168 List<String> getAttributeList(); 169 170 171 172 /** 173 * {@inheritDoc} 174 */ 175 @Override() 176 @NotNull() 177 SearchRequest duplicate(); 178 179 180 181 /** 182 * {@inheritDoc} 183 */ 184 @Override() 185 @NotNull() 186 SearchRequest duplicate(@Nullable Control[] controls); 187}