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 010 * docs/licenses/cddl.txt 011 * or http://www.opensource.org/licenses/cddl1.php. 012 * See the License for the specific language governing permissions 013 * and limitations under the License. 014 * 015 * When distributing Covered Code, include this CDDL HEADER in each 016 * file and include the License file at 017 * docs/licenses/cddl.txt. If applicable, 018 * add the following below this CDDL HEADER, with the fields enclosed 019 * by brackets "[]" replaced with your own identifying information: 020 * Portions Copyright [yyyy] [name of copyright owner] 021 * 022 * CDDL HEADER END 023 * 024 * 025 * Copyright 2010-2014 UnboundID Corp. 026 */ 027 package com.unboundid.directory.sdk.common.operation; 028 029 030 031 import java.util.List; 032 033 import com.unboundid.ldap.sdk.DereferencePolicy; 034 import com.unboundid.ldap.sdk.Filter; 035 import com.unboundid.ldap.sdk.ReadOnlySearchRequest; 036 import com.unboundid.ldap.sdk.SearchResultListener; 037 import com.unboundid.ldap.sdk.SearchScope; 038 import com.unboundid.util.NotExtensible; 039 import com.unboundid.util.ThreadSafety; 040 import com.unboundid.util.ThreadSafetyLevel; 041 042 043 044 /** 045 * This interface defines a set of methods which may be used to interact with a 046 * search request. 047 */ 048 @NotExtensible() 049 @ThreadSafety(level=ThreadSafetyLevel.INTERFACE_NOT_THREADSAFE) 050 public interface SearchRequest 051 extends Request 052 { 053 /** 054 * Retrieves the base DN for the search. 055 * 056 * @return The base DN for the search. 057 */ 058 String getBaseDN(); 059 060 061 062 /** 063 * Retrieves the scope for the search. 064 * 065 * @return The scope for the search. 066 */ 067 SearchScope getScope(); 068 069 070 071 /** 072 * Retrieves the dereference policy for the search. 073 * 074 * @return The dereference policy for the search. 075 */ 076 DereferencePolicy getDerefPolicy(); 077 078 079 080 /** 081 * Retrieves the size limit for the search. 082 * 083 * @return The size limit for the search, or zero if no size limit should be 084 * requested. 085 */ 086 int getSizeLimit(); 087 088 089 090 /** 091 * Retrieves the time limit for the search in seconds. 092 * 093 * @return The time limit for the search in seconds, or zero if no time limit 094 * should be requested. 095 */ 096 int getTimeLimitSeconds(); 097 098 099 100 /** 101 * Indicates whether search result entries should contain only attribute types 102 * or both types and values. 103 * 104 * @return {@code true} if search result entries should contain only 105 * attribute types but no values, or {@code false} if entries should 106 * contain both attribute types and values. 107 */ 108 boolean getTypesOnly(); 109 110 111 112 /** 113 * Retrieves the filter for the search. 114 * 115 * @return The filter for the search. 116 */ 117 Filter getFilter(); 118 119 120 121 /** 122 * Retrieves the list of requested attributes. 123 * 124 * @return The list of requested attributes. 125 */ 126 List<String> getAttributes(); 127 128 129 130 /** 131 * Retrieves an LDAP SDK representation of this search request. 132 * 133 * @param listener The search result listener that should be used for the 134 * request. It may be {@code null} if no listener should be 135 * used. 136 * 137 * @return An LDAP SDK representation of this search request. 138 */ 139 ReadOnlySearchRequest toLDAPSDKRequest(final SearchResultListener listener); 140 }