/** * Sets the scope. Must be one of {@link SearchScope.OBJECT}, * {@link SearchScope.ONELEVEL} or {@link SearchScope.SUBTREE}, * otherwise {@link SearchScope.OBJECT} is assumed as default. * * @param scope the new scope */ public void setScope( int scope ) { try { this.scope = SearchScope.getSearchScope( scope ); } catch ( IllegalArgumentException iae ) { this.scope = SearchScope.OBJECT; } }
searchRequest.setScope( SearchScope.getSearchScope( scope ) );
public static SearchParams toSearchParams( SearchControls searchControls, AliasDerefMode aliasDerefMode ) { SearchParams searchParams = new SearchParams(); searchParams.setAliasDerefMode( aliasDerefMode ); searchParams.setTimeLimit( searchControls.getTimeLimit() ); searchParams.setSizeLimit( searchControls.getCountLimit() ); searchParams.setScope( SearchScope.getSearchScope( searchControls.getSearchScope() ) ); searchParams.setTypesOnly( searchControls.getReturningObjFlag() ); if ( searchControls.getReturningAttributes() != null ) { for ( String returningAttribute : searchControls.getReturningAttributes() ) { searchParams.addReturningAttributes( returningAttribute ); } } searchParams.searchControls = searchControls; return searchParams; }