001/* 002 * Copyright 2007-2022 Ping Identity Corporation 003 * All Rights Reserved. 004 */ 005/* 006 * Copyright 2007-2022 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-2022 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 scope for this search request. 080 * 081 * @return The scope for this search request. 082 */ 083 @NotNull() 084 SearchScope getScope(); 085 086 087 088 /** 089 * Retrieves the dereference policy that should be used by the server for any 090 * aliases encountered during search processing. 091 * 092 * @return The dereference policy that should be used by the server for any 093 * aliases encountered during search processing. 094 */ 095 @NotNull() 096 DereferencePolicy getDereferencePolicy(); 097 098 099 100 /** 101 * Retrieves the maximum number of entries that should be returned by the 102 * server when processing this search request. 103 * 104 * @return The maximum number of entries that should be returned by the 105 * server when processing this search request, or zero if there is 106 * no limit. 107 */ 108 int getSizeLimit(); 109 110 111 112 /** 113 * Retrieves the maximum length of time in seconds that the server should 114 * spend processing this search request. 115 * 116 * @return The maximum length of time in seconds that the server should 117 * spend processing this search request, or zero if there is no 118 * limit. 119 */ 120 int getTimeLimitSeconds(); 121 122 123 124 /** 125 * Indicates whether the server should return only attribute names in matching 126 * entries, rather than both names and values. 127 * 128 * @return {@code true} if matching entries should include only attribute 129 * names, or {@code false} if matching entries should include both 130 * attribute names and values. 131 */ 132 boolean typesOnly(); 133 134 135 136 /** 137 * Retrieves the filter that should be used to identify matching entries. 138 * 139 * @return The filter that should be used to identify matching entries. 140 */ 141 @NotNull() 142 Filter getFilter(); 143 144 145 146 /** 147 * Retrieves the set of requested attributes to include in matching entries. 148 * 149 * @return The set of requested attributes to include in matching entries, or 150 * an empty array if the default set of attributes (all user 151 * attributes but no operational attributes) should be requested. 152 */ 153 @NotNull() 154 List<String> getAttributeList(); 155 156 157 158 /** 159 * {@inheritDoc} 160 */ 161 @Override() 162 @NotNull() 163 SearchRequest duplicate(); 164 165 166 167 /** 168 * {@inheritDoc} 169 */ 170 @Override() 171 @NotNull() 172 SearchRequest duplicate(@Nullable Control[] controls); 173}