try (final EntryCursor entryCursor = connection.search(searchBase, filter, SearchScope.SUBTREE,
final Set<String> groups = Sets.newHashSet(); try (final EntryCursor groupSearch = connection.search( groupSearchBase, groupSearchPattern,
/** * {@inheritDoc} */ @Override public EntryCursor search( String baseDn, String filter, SearchScope scope, String... attributes ) throws LdapException { return search( new Dn( baseDn ), filter, scope, attributes ); }
/** * {@inheritDoc} */ @Override public EntryCursor search( String baseDn, String filter, SearchScope scope, String... attributes ) throws LdapException { return search( new Dn( baseDn ), filter, scope, attributes ); }
/** * {@inheritDoc} */ @Override public EntryCursor search( String baseDn, String filter, SearchScope scope, String... attributes ) throws LdapException { return search( new Dn( baseDn ), filter, scope, attributes ); }
try (final EntryCursor entryCursor = connection.search(searchBase, filter, SearchScope.SUBTREE,
/** * {@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 ) ); }
final Set<String> groups = Sets.newHashSet(); try (final EntryCursor groupSearch = connection.search( groupSearchBase, groupSearchPattern,
/** * Executes an ldap search. * * @param conn to search with * @param sr to read properties from * * @return ldap search results * * @throws org.apache.directory.api.ldap.model.exception.LdapException if an error occurs */ protected SearchCursor search(final LdapNetworkConnection conn, final org.ldaptive.SearchRequest sr) throws org.apache.directory.api.ldap.model.exception.LdapException { final SearchRequest apacheSr = getSearchRequest(sr); final Control[] c = config.getControlProcessor().processRequestControls(sr.getControls()); if (c != null) { apacheSr.addAllControls(c); } return conn.search(apacheSr); }
cursor = search( "", LdapConstants.OBJECT_CLASS_STAR, SearchScope.OBJECT, attributes ); if ( cursor.next() )
cursor = search( "", LdapConstants.OBJECT_CLASS_STAR, SearchScope.OBJECT, attributes ); if ( cursor.next() )
cursor = search( "", LdapConstants.OBJECT_CLASS_STAR, SearchScope.OBJECT, attributes ); if ( cursor.next() )
try ( Cursor<Response> cursor = search( searchRequest ) )
try ( Cursor<Response> cursor = search( searchRequest ) )
try ( Cursor<Response> cursor = search( searchRequest ) )
SearchCursor cursor = ldapConnection.search( request );