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 2006-2008 Sun Microsystems, Inc. 015 * Portions Copyright 2013-2016 ForgeRock AS. 016 */ 017package org.opends.server.types.operation; 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.types.*; 027 028/** 029 * This class defines a set of methods that are available for use by 030 * pre-parse plugins for search operations. Note that this interface 031 * is intended only to define an API for use by plugins and is not 032 * intended to be implemented by any custom classes. 033 */ 034@org.opends.server.types.PublicAPI( 035 stability=org.opends.server.types.StabilityLevel.UNCOMMITTED, 036 mayInstantiate=false, 037 mayExtend=false, 038 mayInvoke=true) 039public interface PreParseSearchOperation 040 extends PreParseOperation 041{ 042 /** 043 * Retrieves the raw, unprocessed base DN as included in the request 044 * from the client. This may or may not contain a valid DN, as no 045 * validation will have been performed. 046 * 047 * @return The raw, unprocessed base DN as included in the request 048 * from the client. 049 */ 050 ByteString getRawBaseDN(); 051 052 053 054 /** 055 * Specifies the raw, unprocessed base DN for this search operation. 056 * 057 * @param rawBaseDN The raw, unprocessed base DN for this search 058 operation. 059 */ 060 void setRawBaseDN(ByteString rawBaseDN); 061 062 063 064 /** 065 * Retrieves the scope for this search operation. 066 * 067 * @return The scope for this search operation. 068 */ 069 SearchScope getScope(); 070 071 072 073 /** 074 * Specifies the scope for this search operation. 075 * 076 * @param scope The scope for this search operation. 077 */ 078 void setScope(SearchScope scope); 079 080 081 082 /** 083 * Retrieves the alias dereferencing policy for this search 084 * operation. 085 * 086 * @return The alias dereferencing policy for this search 087 * operation. 088 */ 089 DereferenceAliasesPolicy getDerefPolicy(); 090 091 092 093 /** 094 * Specifies the alias dereferencing policy for this search 095 * operation. 096 * 097 * @param derefPolicy The alias dereferencing policy for this 098 * search operation. 099 */ 100 void setDerefPolicy(DereferenceAliasesPolicy derefPolicy); 101 102 103 104 /** 105 * Retrieves the size limit for this search operation. 106 * 107 * @return The size limit for this search operation. 108 */ 109 int getSizeLimit(); 110 111 112 113 /** 114 * Specifies the size limit for this search operation. 115 * 116 * @param sizeLimit The size limit for this search operation. 117 */ 118 void setSizeLimit(int sizeLimit); 119 120 121 122 /** 123 * Retrieves the time limit for this search operation. 124 * 125 * @return The time limit for this search operation. 126 */ 127 int getTimeLimit(); 128 129 130 131 /** 132 * Specifies the time limit for this search operation. 133 * 134 * @param timeLimit The time limit for this search operation. 135 */ 136 void setTimeLimit(int timeLimit); 137 138 139 140 /** 141 * Retrieves the typesOnly flag for this search operation. 142 * 143 * @return The typesOnly flag for this search operation. 144 */ 145 boolean getTypesOnly(); 146 147 148 149 /** 150 * Specifies the typesOnly flag for this search operation. 151 * 152 * @param typesOnly The typesOnly flag for this search operation. 153 */ 154 void setTypesOnly(boolean typesOnly); 155 156 157 158 /** 159 * Retrieves the raw, unprocessed search filter as included in the 160 * request from the client. It may or may not contain a valid 161 * filter (e.g., unsupported attribute types or values with an 162 * invalid syntax) because no validation will have been performed on 163 * it. 164 * 165 * @return The raw, unprocessed search filter as included in the 166 * request from the client. 167 */ 168 RawFilter getRawFilter(); 169 170 171 172 /** 173 * Specifies the raw, unprocessed search filter as included in the 174 * request from the client. 175 * 176 * @param rawFilter The raw, unprocessed search filter. 177 */ 178 void setRawFilter(RawFilter rawFilter); 179 180 181 182 /** 183 * Retrieves the set of requested attributes for this search 184 * operation. Its contents should not be altered. 185 * 186 * @return The set of requested attributes for this search 187 * operation. 188 */ 189 Set<String> getAttributes(); 190 191 192 193 /** 194 * Specifies the set of requested attributes for this search 195 * operation. 196 * 197 * @param attributes The set of requested attributes for this 198 * search operation. 199 */ 200 void setAttributes(Set<String> attributes); 201 202 203 204 /** 205 * Returns the provided entry to the client. 206 * 207 * @param entry The entry that should be returned. 208 * @param controls The set of controls to include with the entry 209 * (may be {@code null} if no controls should be 210 * included with the entry). 211 * 212 * @return {@code true} if the caller should continue processing 213 * the search request and sending additional entries and 214 * references, or {@code false} if not for some reason 215 * (e.g., the size limit has been reached or the search has 216 * been abandoned). 217 */ 218 boolean returnEntry(Entry entry, List<Control> controls); 219 220 221 222 /** 223 * Returns the provided search result reference to the client. 224 * 225 * @param reference The search reference that should be returned. 226 * @param dn A DN related to the specified search reference. 227 * @return {@code true} if the caller should continue processing 228 * the search request and sending additional entries and 229 * references, or {@code false} if not for some reason 230 * (e.g., the size limit has been reached or the search has 231 * been abandoned). 232 */ 233 boolean returnReference(DN dn, SearchResultReference reference); 234} 235