edu.vt.middleware.ldap.auth
Class SearchDnResolver

java.lang.Object
  extended by edu.vt.middleware.ldap.AbstractLdap<AuthenticatorConfig>
      extended by edu.vt.middleware.ldap.auth.SearchDnResolver
All Implemented Interfaces:
DnResolver, BaseLdap, Serializable

public class SearchDnResolver
extends AbstractLdap<AuthenticatorConfig>
implements DnResolver, Serializable

SearchDnResolver looks up a user's DN using an LDAP search.

Version:
$Revision: 1634 $ $Date: 2010-09-29 16:03:09 -0400 (Wed, 29 Sep 2010) $
Author:
Middleware Services
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.vt.middleware.ldap.AbstractLdap
BINDING_COPY_RESULT_HANDLER, config, connectionHandler, COPY_RESULT_HANDLER, logger, NCP_COPY_RESULT_HANDLER, SR_COPY_RESULT_HANDLER
 
Constructor Summary
SearchDnResolver()
          Default constructor.
SearchDnResolver(AuthenticatorConfig authConfig)
          This will create a new SearchDnResolver with the supplied AuthenticatorConfig.
 
Method Summary
 void close()
          This will close the connection to the LDAP.
 AuthenticatorConfig getAuthenticatorConfig()
          This returns the AuthenticatorConfig of the Authenticator.
 String resolve(String user)
          This will attempt to find the dn for the supplied user.
 void setAuthenticatorConfig(AuthenticatorConfig authConfig)
          This will set the config parameters of this Authenticator.
 
Methods inherited from class edu.vt.middleware.ldap.AbstractLdap
compare, connect, create, delete, finalize, getAttributes, getContext, getSchema, list, listBindings, modifyAttributes, modifyAttributes, operationRetry, pagedSearch, reconnect, rename, search, searchAttributes, setLdapConfig, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SearchDnResolver

public SearchDnResolver()
Default constructor.


SearchDnResolver

public SearchDnResolver(AuthenticatorConfig authConfig)
This will create a new SearchDnResolver with the supplied AuthenticatorConfig.

Parameters:
authConfig - AuthenticatorConfig
Method Detail

setAuthenticatorConfig

public void setAuthenticatorConfig(AuthenticatorConfig authConfig)
This will set the config parameters of this Authenticator.

Specified by:
setAuthenticatorConfig in interface DnResolver
Parameters:
authConfig - AuthenticatorConfig

getAuthenticatorConfig

public AuthenticatorConfig getAuthenticatorConfig()
This returns the AuthenticatorConfig of the Authenticator.

Specified by:
getAuthenticatorConfig in interface DnResolver
Returns:
AuthenticatorConfig

resolve

public String resolve(String user)
               throws NamingException
This will attempt to find the dn for the supplied user. AuthenticatorConfig.getUserFilter() or AuthenticatorConfig.getUserField() is used to look up the dn. If a filter is used, the user is provided as the {0} variable filter argument. If a field is used, the filter is built by ORing the fields together. If more than one entry matches the search, the result is controlled by AuthenticatorConfig.setAllowMultipleDns(boolean).

Specified by:
resolve in interface DnResolver
Parameters:
user - String to find dn for
Returns:
String - user's dn
Throws:
NamingException - if the LDAP search fails

close

public void close()
This will close the connection to the LDAP.

Specified by:
close in interface DnResolver
Specified by:
close in interface BaseLdap
Overrides:
close in class AbstractLdap<AuthenticatorConfig>


Copyright © 2003-2010 Virginia Tech. All Rights Reserved.