/** * {@inheritDoc} */ @Override public <T> List<T> search( SearchRequest searchRequest, EntryMapper<T> entryMapper ) { List<T> entries = new ArrayList<>(); LdapConnection connection = null; try { connection = connectionPool.getConnection(); for ( Entry entry : new EntryCursorImpl( connection.search( searchRequest ) ) ) { entries.add( entryMapper.map( entry ) ); } } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } return entries; }
while ( next() && !( response instanceof SearchResultDone ) );
close( ldapException );
while ( next() && !( response instanceof SearchResultDone ) );
close( ldapException );
/** * {@inheritDoc} */ @Override public <T> List<T> search( SearchRequest searchRequest, EntryMapper<T> entryMapper ) { List<T> entries = new ArrayList<>(); LdapConnection connection = null; try { connection = connectionPool.getConnection(); for ( Entry entry : new EntryCursorImpl( connection.search( searchRequest ) ) ) { entries.add( entryMapper.map( entry ) ); } } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } return entries; }
while ( next() && !( response instanceof SearchResultDone ) );
close( ldapException );
/** * {@inheritDoc} */ @Override public <T> List<T> search( SearchRequest searchRequest, EntryMapper<T> entryMapper ) { List<T> entries = new ArrayList<>(); LdapConnection connection = null; try { connection = connectionPool.getConnection(); for ( Entry entry : new EntryCursorImpl( connection.search( searchRequest ) ) ) { entries.add( entryMapper.map( entry ) ); } } catch ( LdapException e ) { throw new LdapRuntimeException( e ); } finally { returnLdapConnection( connection ); } return entries; }
/** * {@inheritDoc} */ @Override public EntryCursor search( Dn baseDn, String filter, SearchScope scope, String... attributes ) throws LdapException { if ( baseDn == null ) { LOG.debug( "received a null dn for a search" ); throw new IllegalArgumentException( "The base Dn cannot be null" ); } // generate some random operation number SearchRequest searchRequest = new SearchRequestImpl(); searchRequest.setBase( baseDn ); searchRequest.setFilter( filter ); searchRequest.setScope( scope ); searchRequest.addAttributes( attributes ); searchRequest.setDerefAliases( AliasDerefMode.DEREF_ALWAYS ); return new EntryCursorImpl( search( searchRequest ) ); }
/** * {@inheritDoc} */ @Override public EntryCursor search( Dn baseDn, String filter, SearchScope scope, String... attributes ) throws LdapException { if ( baseDn == null ) { if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_04138_NULL_DN_SEARCH ) ); } throw new IllegalArgumentException( I18n.err( I18n.ERR_04129_NULL_BASE_DN ) ); } // Create a new SearchRequest object SearchRequest searchRequest = new SearchRequestImpl(); searchRequest.setBase( baseDn ); searchRequest.setFilter( filter ); searchRequest.setScope( scope ); searchRequest.addAttributes( attributes ); searchRequest.setDerefAliases( AliasDerefMode.DEREF_ALWAYS ); // Process the request in blocking mode return new EntryCursorImpl( search( searchRequest ) ); }
/** * {@inheritDoc} */ @Override public EntryCursor search( Dn baseDn, String filter, SearchScope scope, String... attributes ) throws LdapException { if ( baseDn == null ) { if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_04138_NULL_DN_SEARCH ) ); } throw new IllegalArgumentException( I18n.err( I18n.ERR_04129_NULL_BASE_DN ) ); } // Create a new SearchRequest object SearchRequest searchRequest = new SearchRequestImpl(); searchRequest.setBase( baseDn ); searchRequest.setFilter( filter ); searchRequest.setScope( scope ); searchRequest.addAttributes( attributes ); searchRequest.setDerefAliases( AliasDerefMode.DEREF_ALWAYS ); // Process the request in blocking mode return new EntryCursorImpl( search( searchRequest ) ); }
/** * {@inheritDoc} */ @Override public EntryCursor search( Dn baseDn, String filter, SearchScope scope, String... attributes ) throws LdapException { if ( baseDn == null ) { if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_04138_NULL_DN_SEARCH ) ); } throw new IllegalArgumentException( I18n.err( I18n.ERR_04129_NULL_BASE_DN ) ); } // Create a new SearchRequest object SearchRequest searchRequest = new SearchRequestImpl(); searchRequest.setBase( baseDn ); searchRequest.setFilter( filter ); searchRequest.setScope( scope ); searchRequest.addAttributes( attributes ); searchRequest.setDerefAliases( AliasDerefMode.DEREF_ALWAYS ); // Process the request in blocking mode return new EntryCursorImpl( search( searchRequest ) ); }