SearchOperationContext searchContext = new SearchOperationContext( session, target, SearchScope.ONELEVEL, filter, SchemaConstants.ALL_USER_ATTRIBUTES_ARRAY );
searchContext.addRequestControls( convertControls( true, requestControls ) );
// execute search operation
OperationManager operationManager = service.getOperationManager();
EntryFilteringCursor results = operationManager.search( searchContext );
// clear the request controls and set the response controls
requestControls = EMPTY_CONTROLS;
responseControls = JndiUtils.toJndiControls( getDirectoryService().getLdapCodecService(),
searchContext.getResponseControls() );