Package org.ldaptive.auth
Class AbstractAuthenticationHandler
java.lang.Object
org.ldaptive.AbstractFreezable
org.ldaptive.auth.AbstractAuthenticationHandler
- All Implemented Interfaces:
AuthenticationHandler,ConnectionFactoryManager,Freezable
- Direct Known Subclasses:
CompareAuthenticationHandler,SimpleBindAuthenticationHandler
public abstract class AbstractAuthenticationHandler
extends AbstractFreezable
implements AuthenticationHandler, ConnectionFactoryManager
Base class for an LDAP authentication implementations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate RequestControl[]controls used by this handler.private ConnectionFactoryConnection factory.protected final LoggerLogger for this class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionPerform an ldap authentication.protected abstract AuthenticationHandlerResponseauthenticateInternal(Connection c, AuthenticationCriteria criteria) Authenticate on the supplied connection using the supplied criteria.voidfreeze()Freezes this object, making it immutable.final RequestControl[]Returns the controls for this authentication handler.final ConnectionFactoryReturns the connection factory.protected RequestControl[]processRequestControls(AuthenticationCriteria criteria) Combines request controls in theAuthenticationRequestwithauthenticationControls.final voidsetAuthenticationControls(RequestControl... cntrls) Sets the controls for this authentication handler.final voidSets the connection factory.toString()Methods inherited from class org.ldaptive.AbstractFreezable
assertMutable, freeze, freeze, isFrozen
-
Field Details
-
logger
Logger for this class. -
factory
Connection factory. -
authenticationControls
controls used by this handler.
-
-
Constructor Details
-
AbstractAuthenticationHandler
public AbstractAuthenticationHandler()
-
-
Method Details
-
freeze
public void freeze()Description copied from interface:FreezableFreezes this object, making it immutable.- Specified by:
freezein interfaceFreezable- Overrides:
freezein classAbstractFreezable
-
getConnectionFactory
Description copied from interface:ConnectionFactoryManagerReturns the connection factory.- Specified by:
getConnectionFactoryin interfaceConnectionFactoryManager- Returns:
- connection factory
-
setConnectionFactory
Description copied from interface:ConnectionFactoryManagerSets the connection factory.- Specified by:
setConnectionFactoryin interfaceConnectionFactoryManager- Parameters:
cf- connection factory
-
getAuthenticationControls
Returns the controls for this authentication handler.- Returns:
- controls
-
setAuthenticationControls
Sets the controls for this authentication handler.- Parameters:
cntrls- controls to set
-
authenticate
Description copied from interface:AuthenticationHandlerPerform an ldap authentication.- Specified by:
authenticatein interfaceAuthenticationHandler- Parameters:
ac- to perform the authentication with- Returns:
- authentication handler response
- Throws:
LdapException- if ldap operation fails
-
authenticateInternal
protected abstract AuthenticationHandlerResponse authenticateInternal(Connection c, AuthenticationCriteria criteria) throws LdapException Authenticate on the supplied connection using the supplied criteria.- Parameters:
c- to authenticate oncriteria- criteria to authenticate with- Returns:
- authentication handler response
- Throws:
LdapException- if the authentication fails
-
processRequestControls
Combines request controls in theAuthenticationRequestwithauthenticationControls.- Parameters:
criteria- containing request controls- Returns:
- combined request controls or null
-
toString
-