Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2007 The JA-SIG Collaborative. All rights reserved. See license
  * distributed with this file and available online at
  * http://www.ja-sig.org/products/cas/overview/license/
  */
 package org.jasig.cas.adaptors.ldap;
 
Abstract class to handle common LDAP functionality.

Author(s):
Scott Battaglia
Version:
$Revision: 21761 $ $Date: 2010-09-25 15:03:45 -0400 (Sat, 25 Sep 2010) $
Since:
3.0.3
public abstract class AbstractLdapUsernamePasswordAuthenticationHandler extends
LdapTemplate to execute ldap queries.
    @NotNull
    private LdapTemplate ldapTemplate;
    
    
Instance of ContextSource
    @NotNull
    private ContextSource contextSource;

    
The filter path to the uid of the user.
    @NotNull
    private String filter;
    
    
Whether the LdapTemplate should ignore partial results.
    private boolean ignorePartialResultException = false;

    
Method to set the datasource and generate a JdbcTemplate.

Parameters:
contextSource the datasource to use.
    public final void setContextSource(final ContextSource contextSource) {
        this. = contextSource;
        this. = new LdapTemplate(contextSource);
    }
    
    public final void setIgnorePartialResultException(final boolean ignorePartialResultException) {
        this. = ignorePartialResultException;
    }

    
Method to return the LdapTemplate

Returns:
a fully created LdapTemplate.
    protected final LdapTemplate getLdapTemplate() {
        return this.;
    }
    protected final ContextSource getContextSource() {
        return this.;
    }
    protected final String getFilter() {
        return this.;
    }
    public final void afterPropertiesSet() throws Exception {
        Assert.isTrue(this..contains("%u") || this..contains("%U"), "filter must contain %u or %U");
    }

    

Parameters:
filter The filter to set.
    public final void setFilter(final String filter) {
        this. = filter;
    }
New to GrepCode? Check out our FAQ X