@Test public void testDirectoryContextLazyLoading() { try (LDAPSession session = userDir.getSession()) { assertNull(session.dirContext); assertNotNull(session.getContext()); assertNotNull(session.dirContext); } }
public DirContext getContext() { if (dirContext == null) { LDAPDirectory ldapDirectory = (LDAPDirectory) directory; ContextProvider testServer = ldapDirectory.getTestServer(); DirContext context = testServer == null ? ldapDirectory.createContext() : testServer.getContext(); dirContext = LdapRetryHandler.wrap(context, ldapDirectory.getServer().getRetries()); } return dirContext; }
LDAPSession extends BaseSession { public DirContext getContext() { if (dirContext == null) { LDAPDirectory ldapDirectory = (LDAPDirectory) directory; ContextProvider testServer = ldapDirectory.getTestServer(); DirContext context = testServer == null ? ldapDirectory.createContext() : testServer.getContext(); dirContext = LdapRetryHandler.wrap(context, ldapDirectory.getServer().getRetries()); } return dirContext; } }
LDAPSession extends BaseSession { public DirContext getContext() { if (dirContext == null) { LDAPDirectory ldapDirectory = (LDAPDirectory) directory; ContextProvider testServer = ldapDirectory.getTestServer(); DirContext context = testServer == null ? ldapDirectory.createContext() : testServer.getContext(); dirContext = LdapRetryHandler.wrap(context, ldapDirectory.getServer().getRetries()); } return dirContext; } LDAPSession(LDAPDirectory directory); }
LDAPSession extends BaseSession { public DirContext getContext() { if (dirContext == null) { LDAPDirectory ldapDirectory = (LDAPDirectory) directory; ContextProvider testServer = ldapDirectory.getTestServer(); DirContext context = testServer == null ? ldapDirectory.createContext() : testServer.getContext(); dirContext = LdapRetryHandler.wrap(context, ldapDirectory.getServer().getRetries()); } return dirContext; } LDAPSession(LDAPDirectory directory); @Override LDAPDirectory getDirectory(); DirContext getContext(); @Override void deleteEntryWithoutReferences(String id); @Override boolean hasEntry(String id); @Override void deleteEntry(String id, Map<String, String> map); @Override DocumentModel getEntryFromSource(String id, boolean fetchReferences); @Override DocumentModelList query(Map<String, Serializable> filter, Set<String> fulltext, Map<String, String> orderBy,
            boolean fetchReferences, int limit, int offset); @Override DocumentModelList query(QueryBuilder queryBuilder, boolean fetchReferences); @Override List<String> queryIds(QueryBuilder queryBuilder); @Override void close(); @Override boolean authenticate(String username, String password); @Override boolean isAuthenticating(); boolean rdnMatchesIdField(); @Override // useful for the log function String toString(); @Override DocumentModel createEntry(DocumentModel entry); }
LDAPSession extends BaseSession { public DirContext getContext() { if (dirContext == null) { LDAPDirectory ldapDirectory = (LDAPDirectory) directory; ContextProvider testServer = ldapDirectory.getTestServer(); DirContext context = testServer == null ? ldapDirectory.createContext() : testServer.getContext(); dirContext = LdapRetryHandler.wrap(context, ldapDirectory.getServer().getRetries()); } return dirContext; } LDAPSession(LDAPDirectory directory); @Override LDAPDirectory getDirectory(); DirContext getContext(); @Override void deleteEntryWithoutReferences(String id); @Override boolean hasEntry(String id); @Override void deleteEntry(String id, Map<String, String> map); @Override DocumentModel getEntryFromSource(String id, boolean fetchReferences); @Override DocumentModelList query(Map<String, Serializable> filter, Set<String> fulltext, Map<String, String> orderBy,
            boolean fetchReferences, int limit, int offset); @Override DocumentModelList query(QueryBuilder queryBuilder, boolean fetchReferences); @Override List<String> queryIds(QueryBuilder queryBuilder); @Override void close(); @Override boolean authenticate(String username, String password); @Override boolean isAuthenticating(); boolean rdnMatchesIdField(); @Override // useful for the log function String toString(); @Override DocumentModel createEntry(DocumentModel entry);  }