Package edu.vt.middleware.ldap.auth
Class SearchDnResolver
- java.lang.Object
-
- edu.vt.middleware.ldap.AbstractLdap<AuthenticatorConfig>
-
- edu.vt.middleware.ldap.auth.SearchDnResolver
-
- All Implemented Interfaces:
DnResolver,BaseLdap,java.io.Serializable
public class SearchDnResolver extends AbstractLdap<AuthenticatorConfig> implements DnResolver, java.io.Serializable
SearchDnResolverlooks up a user's DN using an LDAP search.- Version:
- $Revision: 1634 $ $Date: 2010-09-29 22:03:09 +0200 (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
Constructors Constructor Description SearchDnResolver()Default constructor.SearchDnResolver(AuthenticatorConfig authConfig)This will create a newSearchDnResolverwith the suppliedAuthenticatorConfig.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()This will close the connection to the LDAP.AuthenticatorConfiggetAuthenticatorConfig()This returns theAuthenticatorConfigof theAuthenticator.java.lang.Stringresolve(java.lang.String user)This will attempt to find the dn for the supplied user.voidsetAuthenticatorConfig(AuthenticatorConfig authConfig)This will set the config parameters of thisAuthenticator.-
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
-
-
-
-
Constructor Detail
-
SearchDnResolver
public SearchDnResolver()
Default constructor.
-
SearchDnResolver
public SearchDnResolver(AuthenticatorConfig authConfig)
This will create a newSearchDnResolverwith the suppliedAuthenticatorConfig.- Parameters:
authConfig-AuthenticatorConfig
-
-
Method Detail
-
setAuthenticatorConfig
public void setAuthenticatorConfig(AuthenticatorConfig authConfig)
This will set the config parameters of thisAuthenticator.- Specified by:
setAuthenticatorConfigin interfaceDnResolver- Parameters:
authConfig-AuthenticatorConfig
-
getAuthenticatorConfig
public AuthenticatorConfig getAuthenticatorConfig()
This returns theAuthenticatorConfigof theAuthenticator.- Specified by:
getAuthenticatorConfigin interfaceDnResolver- Returns:
AuthenticatorConfig
-
resolve
public java.lang.String resolve(java.lang.String user) throws javax.naming.NamingExceptionThis will attempt to find the dn for the supplied user.AuthenticatorConfig.getUserFilter()orAuthenticatorConfig.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 byAuthenticatorConfig.setAllowMultipleDns(boolean).- Specified by:
resolvein interfaceDnResolver- Parameters:
user-Stringto find dn for- Returns:
String- user's dn- Throws:
javax.naming.NamingException- if the LDAP search fails
-
close
public void close()
This will close the connection to the LDAP.- Specified by:
closein interfaceBaseLdap- Specified by:
closein interfaceDnResolver- Overrides:
closein classAbstractLdap<AuthenticatorConfig>
-
-