001/* 002 * CDDL HEADER START 003 * 004 * The contents of this file are subject to the terms of the 005 * Common Development and Distribution License, Version 1.0 only 006 * (the "License"). You may not use this file except in compliance 007 * with the License. 008 * 009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt 010 * or http://forgerock.org/license/CDDLv1.0.html. 011 * See the License for the specific language governing permissions 012 * and limitations under the License. 013 * 014 * When distributing Covered Code, include this CDDL HEADER in each 015 * file and include the License file at legal-notices/CDDLv1_0.txt. 016 * If applicable, add the following below this CDDL HEADER, with the 017 * fields enclosed by brackets "[]" replaced with your own identifying 018 * information: 019 * Portions Copyright [yyyy] [name of copyright owner] 020 * 021 * CDDL HEADER END 022 * 023 * 024 * Copyright 2006-2008 Sun Microsystems, Inc. 025 * Portions Copyright 2013-2015 ForgeRock AS. 026 */ 027package org.opends.server.types.operation; 028 029import java.util.List; 030import java.util.Set; 031 032import org.forgerock.opendj.ldap.ByteString; 033import org.opends.server.types.Control; 034import org.forgerock.opendj.ldap.DereferenceAliasesPolicy; 035import org.opends.server.types.DN; 036import org.opends.server.types.Entry; 037import org.opends.server.types.RawFilter; 038import org.forgerock.opendj.ldap.SearchScope; 039import org.opends.server.types.SearchFilter; 040import org.opends.server.types.SearchResultReference; 041 042/** 043 * This class defines a set of methods that are available for use by 044 * pre-operation plugins for search operations. Note that this 045 * interface is intended only to define an API for use by plugins and 046 * is not intended to be implemented by any custom classes. 047 */ 048@org.opends.server.types.PublicAPI( 049 stability=org.opends.server.types.StabilityLevel.UNCOMMITTED, 050 mayInstantiate=false, 051 mayExtend=false, 052 mayInvoke=true) 053public interface PreOperationSearchOperation 054 extends PreOperationOperation 055{ 056 /** 057 * Retrieves the raw, unprocessed base DN as included in the request 058 * from the client. This may or may not contain a valid DN, as no 059 * validation will have been performed. 060 * 061 * @return The raw, unprocessed base DN as included in the request 062 * from the client. 063 */ 064 ByteString getRawBaseDN(); 065 066 067 068 /** 069 * Retrieves the base DN for this search operation. 070 * 071 * @return The base DN for this search operation. 072 */ 073 DN getBaseDN(); 074 075 076 077 /** 078 * Retrieves the scope for this search operation. 079 * 080 * @return The scope for this search operation. 081 */ 082 SearchScope getScope(); 083 084 085 086 /** 087 * Retrieves the alias dereferencing policy for this search 088 * operation. 089 * 090 * @return The alias dereferencing policy for this search 091 * operation. 092 */ 093 DereferenceAliasesPolicy getDerefPolicy(); 094 095 096 097 /** 098 * Retrieves the size limit for this search operation. 099 * 100 * @return The size limit for this search operation. 101 */ 102 int getSizeLimit(); 103 104 105 106 /** 107 * Retrieves the time limit for this search operation. 108 * 109 * @return The time limit for this search operation. 110 */ 111 int getTimeLimit(); 112 113 114 115 /** 116 * Retrieves the typesOnly flag for this search operation. 117 * 118 * @return The typesOnly flag for this search operation. 119 */ 120 boolean getTypesOnly(); 121 122 123 124 /** 125 * Retrieves the raw, unprocessed search filter as included in the 126 * request from the client. It may or may not contain a valid 127 * filter (e.g., unsupported attribute types or values with an 128 * invalid syntax) because no validation will have been performed on 129 * it. 130 * 131 * @return The raw, unprocessed search filter as included in the 132 * request from the client. 133 */ 134 RawFilter getRawFilter(); 135 136 137 138 /** 139 * Retrieves the filter for this search operation. 140 * 141 * @return The filter for this search operation. 142 */ 143 SearchFilter getFilter(); 144 145 146 147 /** 148 * Retrieves the set of requested attributes for this search 149 * operation. Its contents should not be altered. 150 * 151 * @return The set of requested attributes for this search 152 * operation. 153 */ 154 Set<String> getAttributes(); 155 156 157 158 /** 159 * Returns the provided entry to the client. 160 * 161 * @param entry The entry that should be returned. 162 * @param controls The set of controls to include with the entry 163 * (may be {@code null} if no controls should be 164 * included with the entry). 165 * 166 * @return {@code true} if the caller should continue processing 167 * the search request and sending additional entries and 168 * references, or {@code false} if not for some reason 169 * (e.g., the size limit has been reached or the search has 170 * been abandoned). 171 */ 172 boolean returnEntry(Entry entry, List<Control> controls); 173 174 175 176 /** 177 * Returns the provided search result reference to the client. 178 * 179 * @param dn A DN related to the specified search 180 * reference. 181 * @param reference The search reference that should be returned. 182 * 183 * @return {@code true} if the caller should continue processing 184 * the search request and sending additional entries and 185 * references, or {@code false} if not for some reason 186 * (e.g., the size limit has been reached or the search has 187 * been abandoned). 188 */ 189 boolean returnReference(DN dn ,SearchResultReference reference); 190} 191