1 20 21 package org.apache.directory.ldapstudio.browser.core.model; 22 23 24 import java.io.Serializable ; 25 26 27 34 public class SearchParameter implements Serializable  35 { 36 37 38 private static final long serialVersionUID = 2447490121520960805L; 39 40 41 private String name; 42 43 44 private DN searchBase; 45 46 47 private String filter; 48 49 50 private String [] returningAttributes; 51 52 53 private int scope; 54 55 56 private int timeLimit; 57 58 59 private int countLimit; 60 61 62 private int aliasesDereferencingMethod; 63 64 65 private int referralsHandlingMethod; 66 67 68 private Control[] controls; 69 70 71 private boolean initHasChildrenFlag; 72 73 74 private boolean initAliasAndReferralFlag; 75 76 77 94 public SearchParameter() 95 { 96 name = null; 97 searchBase = null; 98 filter = ISearch.FILTER_TRUE; 99 returningAttributes = ISearch.NO_ATTRIBUTES; 100 scope = ISearch.SCOPE_ONELEVEL; 101 timeLimit = 0; 102 countLimit = 0; 103 aliasesDereferencingMethod = IConnection.DEREFERENCE_ALIASES_NEVER; 104 referralsHandlingMethod = IConnection.HANDLE_REFERRALS_IGNORE; 105 controls = null; 106 initHasChildrenFlag = false; 107 initAliasAndReferralFlag = false; 108 } 109 110 111 116 public int getCountLimit() 117 { 118 return countLimit; 119 } 120 121 122 127 public void setCountLimit( int countLimit ) 128 { 129 this.countLimit = countLimit; 130 } 131 132 133 138 public String getFilter() 139 { 140 return filter; 141 } 142 143 144 150 public void setFilter( String filter ) 151 { 152 if ( filter == null || "".equals( filter ) ) { 154 filter = ISearch.FILTER_TRUE; 155 } 156 this.filter = filter; 157 } 158 159 160 165 public String getName() 166 { 167 return name; 168 } 169 170 171 176 public void setName( String name ) 177 { 178 this.name = name; 179 } 180 181 182 187 public String [] getReturningAttributes() 188 { 189 return returningAttributes; 190 } 191 192 193 199 public void setReturningAttributes( String [] returningAttributes ) 200 { 201 if ( returningAttributes == null ) 202 { 203 returningAttributes = new String [] 204 { ISearch.ALL_USER_ATTRIBUTES }; 205 } 206 this.returningAttributes = returningAttributes; 207 } 208 209 210 216 public int getScope() 217 { 218 return scope; 219 } 220 221 222 228 public void setScope( int scope ) 229 { 230 this.scope = scope; 231 } 232 233 234 241 public int getAliasesDereferencingMethod() 242 { 243 return aliasesDereferencingMethod; 244 } 245 246 247 254 public void setAliasesDereferencingMethod( int aliasesDereferencingMethod ) 255 { 256 this.aliasesDereferencingMethod = aliasesDereferencingMethod; 257 } 258 259 260 266 public int getReferralsHandlingMethod() 267 { 268 return referralsHandlingMethod; 269 } 270 271 272 278 public void setReferralsHandlingMethod( int referralsHandlingMethod ) 279 { 280 this.referralsHandlingMethod = referralsHandlingMethod; 281 } 282 283 284 289 public DN getSearchBase() 290 { 291 return searchBase; 292 } 293 294 295 300 public void setSearchBase( DN searchBase ) 301 { 302 assert searchBase != null; 303 this.searchBase = searchBase; 304 } 305 306 307 312 public int getTimeLimit() 313 { 314 return timeLimit; 315 } 316 317 318 323 public void setTimeLimit( int timeLimit ) 324 { 325 this.timeLimit = timeLimit; 326 } 327 328 329 332 public Object clone() 333 { 334 SearchParameter clone = new SearchParameter(); 335 clone.setName( getName() ); 336 clone.setSearchBase( getSearchBase() ); 337 clone.setFilter( getFilter() ); 338 clone.setReturningAttributes( getReturningAttributes() ); 339 clone.setScope( getScope() ); 340 clone.setTimeLimit( getTimeLimit() ); 341 clone.setCountLimit( getCountLimit() ); 342 clone.setAliasesDereferencingMethod( getAliasesDereferencingMethod() ); 343 clone.setReferralsHandlingMethod( getReferralsHandlingMethod() ); 344 clone.setInitHasChildrenFlag( isInitHasChildrenFlag() ); 345 clone.setInitAliasAndReferralFlag( isInitAliasAndReferralFlag() ); 346 clone.setControls( getControls() ); 347 return clone; 348 } 349 350 351 356 public boolean isInitAliasAndReferralFlag() 357 { 358 return initAliasAndReferralFlag; 359 } 360 361 362 367 public void setInitAliasAndReferralFlag( boolean initAliasAndReferralFlag ) 368 { 369 this.initAliasAndReferralFlag = initAliasAndReferralFlag; 370 } 371 372 373 378 public boolean isInitHasChildrenFlag() 379 { 380 return initHasChildrenFlag; 381 } 382 383 384 389 public void setInitHasChildrenFlag( boolean initHasChildrenFlag ) 390 { 391 this.initHasChildrenFlag = initHasChildrenFlag; 392 } 393 394 395 400 public Control[] getControls() 401 { 402 return controls; 403 } 404 405 406 411 public void setControls( Control[] controls ) 412 { 413 this.controls = controls; 414 } 415 416 } 417 | Popular Tags |