/** * Returns {@code true} if LDAP connection pooling should be used when acquiring a connection based on the specified * account principal, {@code false} otherwise. * <p/> * This implementation returns {@code true} only if {@link #isPoolingEnabled()} and the principal equals the * {@link #getSystemUsername()}. The reasoning behind this is that connection pooling is not desirable for * general authentication attempts by application end-users because the probability of re-use for that same * user-specific connection after an authentication attempt is extremely low. * * @param principal the principal under which the connection will be made * @return {@code true} if LDAP connection pooling should be used when acquiring a connection based on the specified * account principal, {@code false} otherwise. */ protected boolean isPoolingConnections(Object principal) { return isPoolingEnabled() && principal != null && principal.equals(getSystemUsername()); }
/** * This implementation delegates to {@link #getLdapContext(Object, Object)} using the * {@link #getSystemUsername() systemUsername} and {@link #getSystemPassword() systemPassword} properties as * arguments. * * @return the system LdapContext * @throws NamingException if there is a problem connecting to the LDAP directory */ public LdapContext getSystemLdapContext() throws NamingException { return getLdapContext((Object)getSystemUsername(), getSystemPassword()); }
/** * Returns {@code true} if LDAP connection pooling should be used when acquiring a connection based on the specified * account principal, {@code false} otherwise. * <p/> * This implementation returns {@code true} only if {@link #isPoolingEnabled()} and the principal equals the * {@link #getSystemUsername()}. The reasoning behind this is that connection pooling is not desirable for * general authentication attempts by application end-users because the probability of re-use for that same * user-specific connection after an authentication attempt is extremely low. * * @param principal the principal under which the connection will be made * @return {@code true} if LDAP connection pooling should be used when acquiring a connection based on the specified * account principal, {@code false} otherwise. */ protected boolean isPoolingConnections(Object principal) { return isPoolingEnabled() && principal != null && principal.equals(getSystemUsername()); }
/** * This implementation delegates to {@link #getLdapContext(Object, Object)} using the * {@link #getSystemUsername() systemUsername} and {@link #getSystemPassword() systemPassword} properties as * arguments. * * @return the system LdapContext * @throws NamingException if there is a problem connecting to the LDAP directory */ public LdapContext getSystemLdapContext() throws NamingException { return getLdapContext((Object)getSystemUsername(), getSystemPassword()); }
/** * Returns {@code true} if LDAP connection pooling should be used when acquiring a connection based on the specified * account principal, {@code false} otherwise. * <p/> * This implementation returns {@code true} only if {@link #isPoolingEnabled()} and the principal equals the * {@link #getSystemUsername()}. The reasoning behind this is that connection pooling is not desirable for * general authentication attempts by application end-users because the probability of re-use for that same * user-specific connection after an authentication attempt is extremely low. * * @param principal the principal under which the connection will be made * @return {@code true} if LDAP connection pooling should be used when acquiring a connection based on the specified * account principal, {@code false} otherwise. */ protected boolean isPoolingConnections(Object principal) { return isPoolingEnabled() && principal != null && principal.equals(getSystemUsername()); }
/** * This implementation delegates to {@link #getLdapContext(Object, Object)} using the * {@link #getSystemUsername() systemUsername} and {@link #getSystemPassword() systemPassword} properties as * arguments. * * @return the system LdapContext * @throws NamingException if there is a problem connecting to the LDAP directory */ public LdapContext getSystemLdapContext() throws NamingException { return getLdapContext((Object)getSystemUsername(), getSystemPassword()); }
private LdapContext getSystemLdapContextUsingStartTls( LdapContextFactory ldapContextFactory ) throws NamingException { JndiLdapContextFactory jndiLdapContextFactory = (JndiLdapContextFactory) ldapContextFactory; return getLdapContextUsingStartTls( ldapContextFactory, jndiLdapContextFactory.getSystemUsername(), jndiLdapContextFactory.getSystemPassword() ); }