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
SearchDnResolver
looks 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 newSearchDnResolver
with the suppliedAuthenticatorConfig
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
This will close the connection to the LDAP.AuthenticatorConfig
getAuthenticatorConfig()
This returns theAuthenticatorConfig
of theAuthenticator
.java.lang.String
resolve(java.lang.String user)
This will attempt to find the dn for the supplied user.void
setAuthenticatorConfig(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 newSearchDnResolver
with the suppliedAuthenticatorConfig
.- Parameters:
authConfig
-AuthenticatorConfig
-
-
Method Detail
-
setAuthenticatorConfig
public void setAuthenticatorConfig(AuthenticatorConfig authConfig)
This will set the config parameters of thisAuthenticator
.- Specified by:
setAuthenticatorConfig
in interfaceDnResolver
- Parameters:
authConfig
-AuthenticatorConfig
-
getAuthenticatorConfig
public AuthenticatorConfig getAuthenticatorConfig()
This returns theAuthenticatorConfig
of theAuthenticator
.- Specified by:
getAuthenticatorConfig
in interfaceDnResolver
- Returns:
AuthenticatorConfig
-
resolve
public java.lang.String resolve(java.lang.String user) throws javax.naming.NamingException
This 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:
resolve
in interfaceDnResolver
- Parameters:
user
-String
to 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:
close
in interfaceBaseLdap
- Specified by:
close
in interfaceDnResolver
- Overrides:
close
in classAbstractLdap<AuthenticatorConfig>
-
-