@Test public void testGetEntries() throws ClientException { Session session = getLDAPDirectory("userDirectory").getSession(); try { DocumentModelList entries = session.getEntries(); assertNotNull(entries); assertEquals(4, entries.size()); List<String> entryIds = new ArrayList<String>(); for (DocumentModel entry : entries) { entryIds.add(entry.getId()); } Collections.sort(entryIds); assertEquals("Administrator", entryIds.get(0)); assertEquals("user1", entryIds.get(1)); assertEquals("user2", entryIds.get(2)); assertEquals("user3", entryIds.get(3)); } finally { session.close(); } }
@Override public DocumentModelList getEntries() throws DirectoryException { try { SearchControls scts = directory.getSearchControls(); if (log.isDebugEnabled()) { log.debug(String.format( "LDAPSession.getEntries(): LDAP search base='%s' filter='%s' " + " args=* scope=%s [%s]", searchBaseDn, directory.getBaseFilter(), scts.getSearchScope(), this)); } NamingEnumeration<SearchResult> results = dirContext.search( searchBaseDn, directory.getBaseFilter(), scts); return ldapResultsToDocumentModels(results, false); } catch (SizeLimitExceededException e) { throw new org.nuxeo.ecm.directory.SizeLimitExceededException(e); } catch (NamingException e) { throw new DirectoryException("getEntries failed", e); } }
LDAPSession extends BaseSession implements EntrySource { @Override public DocumentModelList getEntries() throws DirectoryException { try { SearchControls scts = directory.getSearchControls(); if (log.isDebugEnabled()) { log.debug(String.format( "LDAPSession.getEntries(): LDAP search base='%s' filter='%s' " + " args=* scope=%s [%s]", searchBaseDn, directory.getBaseFilter(), scts.getSearchScope(), this)); } NamingEnumeration<SearchResult> results = dirContext.search( searchBaseDn, directory.getBaseFilter(), scts); return ldapResultsToDocumentModels(results, false); } catch (SizeLimitExceededException e) { throw new org.nuxeo.ecm.directory.SizeLimitExceededException(e); } catch (NamingException e) { throw new DirectoryException("getEntries failed", e); } } }
LDAPSession extends BaseSession implements EntrySource { @Override public DocumentModelList getEntries() throws DirectoryException { try { SearchControls scts = directory.getSearchControls(); if (log.isDebugEnabled()) { log.debug(String.format( "LDAPSession.getEntries(): LDAP search base='%s' filter='%s' " + " args=* scope=%s [%s]", searchBaseDn, directory.getBaseFilter(), scts.getSearchScope(), this)); } NamingEnumeration<SearchResult> results = dirContext.search( searchBaseDn, directory.getBaseFilter(), scts); return ldapResultsToDocumentModels(results, false); } catch (SizeLimitExceededException e) { throw new org.nuxeo.ecm.directory.SizeLimitExceededException(e); } catch (NamingException e) { throw new DirectoryException("getEntries failed", e); } } LDAPSession(LDAPDirectory directory, DirContext dirContext); }
LDAPSession extends BaseSession implements EntrySource { @Override public DocumentModelList getEntries() throws DirectoryException { try { SearchControls scts = directory.getSearchControls(); if (log.isDebugEnabled()) { log.debug(String.format( "LDAPSession.getEntries(): LDAP search base='%s' filter='%s' " + " args=* scope=%s [%s]", searchBaseDn, directory.getBaseFilter(), scts.getSearchScope(), this)); } NamingEnumeration<SearchResult> results = dirContext.search( searchBaseDn, directory.getBaseFilter(), scts); return ldapResultsToDocumentModels(results, false); } catch (SizeLimitExceededException e) { throw new org.nuxeo.ecm.directory.SizeLimitExceededException(e); } catch (NamingException e) { throw new DirectoryException("getEntries failed", e); } } LDAPSession(LDAPDirectory directory, DirContext dirContext); void setSubStringMatchType(String type); Directory getDirectory(); DirContext getContext(); @Override @SuppressWarnings("unchecked") DocumentModel createEntry(Map<String, Object> fieldMap); @Override DocumentModel getEntry(String id); @Override DocumentModel getEntry(String id, boolean fetchReferences); @Override DocumentModel getEntryFromSource(String id, boolean fetchReferences); @Override boolean hasEntry(String id); @Override DocumentModelList getEntries(); @Override @SuppressWarnings("unchecked") void updateEntry(DocumentModel docModel); @Override void deleteEntry(DocumentModel dm); @Override void deleteEntry(String id); @Override void deleteEntry(String id, Map<String, String> map); DocumentModelList query(Map<String, Serializable> filter,
            Set<String> fulltext, boolean fetchReferences,
            Map<String, String> orderBy); @Override DocumentModelList query(Map<String, Serializable> filter); @Override DocumentModelList query(Map<String, Serializable> filter,
            Set<String> fulltext, Map<String, String> orderBy); @Override DocumentModelList query(Map<String, Serializable> filter,
            Set<String> fulltext, Map<String, String> orderBy,
            boolean fetchReferences); @Override DocumentModelList query(Map<String, Serializable> filter,
            Set<String> fulltext); @Override void close(); @Override List<String> getProjection(Map<String, Serializable> filter,
            String columnName); @Override List<String> getProjection(Map<String, Serializable> filter,
            Set<String> fulltext, String columnName); @Override boolean authenticate(String username, String password); @Override String getIdField(); @Override String getPasswordField(); @Override boolean isAuthenticating(); @Override boolean isReadOnly(); boolean rdnMatchesIdField(); @Override // useful for the log function String toString(); @Override DocumentModel createEntry(DocumentModel entry); }
LDAPSession extends BaseSession implements EntrySource { @Override public DocumentModelList getEntries() throws DirectoryException { try { SearchControls scts = directory.getSearchControls(); if (log.isDebugEnabled()) { log.debug(String.format( "LDAPSession.getEntries(): LDAP search base='%s' filter='%s' " + " args=* scope=%s [%s]", searchBaseDn, directory.getBaseFilter(), scts.getSearchScope(), this)); } NamingEnumeration<SearchResult> results = dirContext.search( searchBaseDn, directory.getBaseFilter(), scts); return ldapResultsToDocumentModels(results, false); } catch (SizeLimitExceededException e) { throw new org.nuxeo.ecm.directory.SizeLimitExceededException(e); } catch (NamingException e) { throw new DirectoryException("getEntries failed", e); } } LDAPSession(LDAPDirectory directory, DirContext dirContext); void setSubStringMatchType(String type); Directory getDirectory(); DirContext getContext(); @Override @SuppressWarnings("unchecked") DocumentModel createEntry(Map<String, Object> fieldMap); @Override DocumentModel getEntry(String id); @Override DocumentModel getEntry(String id, boolean fetchReferences); @Override DocumentModel getEntryFromSource(String id, boolean fetchReferences); @Override boolean hasEntry(String id); @Override DocumentModelList getEntries(); @Override @SuppressWarnings("unchecked") void updateEntry(DocumentModel docModel); @Override void deleteEntry(DocumentModel dm); @Override void deleteEntry(String id); @Override void deleteEntry(String id, Map<String, String> map); DocumentModelList query(Map<String, Serializable> filter,
            Set<String> fulltext, boolean fetchReferences,
            Map<String, String> orderBy); @Override DocumentModelList query(Map<String, Serializable> filter); @Override DocumentModelList query(Map<String, Serializable> filter,
            Set<String> fulltext, Map<String, String> orderBy); @Override DocumentModelList query(Map<String, Serializable> filter,
            Set<String> fulltext, Map<String, String> orderBy,
            boolean fetchReferences); @Override DocumentModelList query(Map<String, Serializable> filter,
            Set<String> fulltext); @Override void close(); @Override List<String> getProjection(Map<String, Serializable> filter,
            String columnName); @Override List<String> getProjection(Map<String, Serializable> filter,
            Set<String> fulltext, String columnName); @Override boolean authenticate(String username, String password); @Override String getIdField(); @Override String getPasswordField(); @Override boolean isAuthenticating(); @Override boolean isReadOnly(); boolean rdnMatchesIdField(); @Override // useful for the log function String toString(); @Override DocumentModel createEntry(DocumentModel entry);  }