37 * 38 * @author Rosanna Lee 39 * @author Scott Seligman 40 * @since 1.3 41 */ 42 43 public class SearchControls implements java.io.Serializable { 44 /** 45 * Search the named object. 46 *<p> 47 * The NamingEnumeration that results from search() 48 * using OBJECT_SCOPE will contain one or zero element. 49 * The enumeration contains one element if the named object satisfies 50 * the search filter specified in search(). 51 * The element will have as its name the empty string because the names 52 * of elements in the NamingEnumeration are relative to the 53 * target context--in this case, the target context is the named object. 54 * It contains zero element if the named object does not satisfy 55 * the search filter specified in search(). 56 * <p> 57 * The value of this constant is <tt>0</tt>. 58 */ 59 public final static int OBJECT_SCOPE = 0; 60 61 /** 62 * Search one level of the named context. 63 *<p> 64 * The NamingEnumeration that results from search() 65 * using ONELEVEL_SCOPE contains elements with 66 * objects in the named context that satisfy 67 * the search filter specified in search(). 68 * The names of elements in the NamingEnumeration are atomic names 69 * relative to the named context. 70 * <p> 71 * The value of this constant is <tt>1</tt>. 72 */ 73 public final static int ONELEVEL_SCOPE = 1; 74 /** 75 * Search the entire subtree rooted at the named object. 76 *<p> 77 * If the named object is not a DirContext, search only the object. 78 * If the named object is a DirContext, search the subtree 79 * rooted at the named object, including the named object itself. 80 *<p> 81 * The search will not cross naming system boundaries. 82 *<p> 83 * The NamingEnumeration that results from search() 84 * using SUBTREE_SCOPE contains elements of objects 85 * from the subtree (including the named context) 86 * that satisfy the search filter specified in search(). 87 * The names of elements in the NamingEnumeration are either 88 * relative to the named context or is a URL string. 89 * If the named context satisfies the search filter, it is 90 * included in the enumeration with the empty string as 91 * its name. 92 * <p> 93 * The value of this constant is <tt>2</tt>. 94 */ 95 public final static int SUBTREE_SCOPE = 2; 96 97 /** 98 * Contains the scope with which to apply the search. One of 99 * <tt>ONELEVEL_SCOPE</tt>, <tt>OBJECT_SCOPE</tt>, or 100 * <tt>SUBTREE_SCOPE</tt>. 101 * @serial 102 */ 103 private int searchScope; 104 105 /** 106 * Contains the milliseconds to wait before returning 107 * from search. 108 * @serial 109 */ 110 private int timeLimit; 111 112 /** 113 * Indicates whether JNDI links are dereferenced during 114 * search. 115 * @serial 116 */ 117 private boolean derefLink; 118 119 /** 120 * Indicates whether object is returned in <tt>SearchResult</tt>. 121 * @serial 122 */ 123 private boolean returnObj; 124 125 /** 126 * Contains the maximum number of SearchResults to return. 127 * @serial 128 */ 129 private long countLimit; 130 131 /** 132 * Contains the list of attributes to be returned in 133 * <tt>SearchResult</tt> for each matching entry of search. <tt>null</tt> 134 * indicates that all attributes are to be returned. 135 * @serial 136 */ 137 private String[] attributesToReturn; 138 139 /** 140 * Constructs a search constraints using defaults. 141 *<p> 142 * The defaults are: 143 * <ul> 144 * <li>search one level 145 * <li>no maximum return limit for search results 146 * <li>no time limit for search 147 * <li>return all attributes associated with objects that satisfy 148 * the search filter. 149 * <li>do not return named object (return only name and class) 150 * <li>do not dereference links during search 151 *</ul> 152 */ 153 public SearchControls() { | 37 * 38 * @author Rosanna Lee 39 * @author Scott Seligman 40 * @since 1.3 41 */ 42 43 public class SearchControls implements java.io.Serializable { 44 /** 45 * Search the named object. 46 *<p> 47 * The NamingEnumeration that results from search() 48 * using OBJECT_SCOPE will contain one or zero element. 49 * The enumeration contains one element if the named object satisfies 50 * the search filter specified in search(). 51 * The element will have as its name the empty string because the names 52 * of elements in the NamingEnumeration are relative to the 53 * target context--in this case, the target context is the named object. 54 * It contains zero element if the named object does not satisfy 55 * the search filter specified in search(). 56 * <p> 57 * The value of this constant is {@code 0}. 58 */ 59 public final static int OBJECT_SCOPE = 0; 60 61 /** 62 * Search one level of the named context. 63 *<p> 64 * The NamingEnumeration that results from search() 65 * using ONELEVEL_SCOPE contains elements with 66 * objects in the named context that satisfy 67 * the search filter specified in search(). 68 * The names of elements in the NamingEnumeration are atomic names 69 * relative to the named context. 70 * <p> 71 * The value of this constant is {@code 1}. 72 */ 73 public final static int ONELEVEL_SCOPE = 1; 74 /** 75 * Search the entire subtree rooted at the named object. 76 *<p> 77 * If the named object is not a DirContext, search only the object. 78 * If the named object is a DirContext, search the subtree 79 * rooted at the named object, including the named object itself. 80 *<p> 81 * The search will not cross naming system boundaries. 82 *<p> 83 * The NamingEnumeration that results from search() 84 * using SUBTREE_SCOPE contains elements of objects 85 * from the subtree (including the named context) 86 * that satisfy the search filter specified in search(). 87 * The names of elements in the NamingEnumeration are either 88 * relative to the named context or is a URL string. 89 * If the named context satisfies the search filter, it is 90 * included in the enumeration with the empty string as 91 * its name. 92 * <p> 93 * The value of this constant is {@code 2}. 94 */ 95 public final static int SUBTREE_SCOPE = 2; 96 97 /** 98 * Contains the scope with which to apply the search. One of 99 * {@code ONELEVEL_SCOPE}, {@code OBJECT_SCOPE}, or 100 * {@code SUBTREE_SCOPE}. 101 * @serial 102 */ 103 private int searchScope; 104 105 /** 106 * Contains the milliseconds to wait before returning 107 * from search. 108 * @serial 109 */ 110 private int timeLimit; 111 112 /** 113 * Indicates whether JNDI links are dereferenced during 114 * search. 115 * @serial 116 */ 117 private boolean derefLink; 118 119 /** 120 * Indicates whether object is returned in {@code SearchResult}. 121 * @serial 122 */ 123 private boolean returnObj; 124 125 /** 126 * Contains the maximum number of SearchResults to return. 127 * @serial 128 */ 129 private long countLimit; 130 131 /** 132 * Contains the list of attributes to be returned in 133 * {@code SearchResult} for each matching entry of search. {@code null} 134 * indicates that all attributes are to be returned. 135 * @serial 136 */ 137 private String[] attributesToReturn; 138 139 /** 140 * Constructs a search constraints using defaults. 141 *<p> 142 * The defaults are: 143 * <ul> 144 * <li>search one level 145 * <li>no maximum return limit for search results 146 * <li>no time limit for search 147 * <li>return all attributes associated with objects that satisfy 148 * the search filter. 149 * <li>do not return named object (return only name and class) 150 * <li>do not dereference links during search 151 *</ul> 152 */ 153 public SearchControls() { |