org.apache.directory.server.ldap.handlers
Class BindHandler
java.lang.Object
org.apache.directory.server.ldap.handlers.LdapRequestHandler<org.apache.directory.shared.ldap.message.BindRequest>
org.apache.directory.server.ldap.handlers.BindHandler
- All Implemented Interfaces:
- org.apache.mina.handler.demux.MessageHandler<org.apache.directory.shared.ldap.message.BindRequest>
public class BindHandler
- extends LdapRequestHandler<org.apache.directory.shared.ldap.message.BindRequest>
A single reply handler for BindRequest
s.
Implements server-side of RFC 2222, sections 4.2 and 4.3.
- Version:
- $Rev: 664302 $, $Date: 2008-06-07 04:44:00 -0400 (Sat, 07 Jun 2008) $
- Author:
- Apache Directory Project
Fields inherited from interface org.apache.mina.handler.demux.MessageHandler |
NOOP |
Method Summary |
void |
handle(LdapSession ldapSession,
org.apache.directory.shared.ldap.message.BindRequest bindRequest)
Deal with a received BindRequest |
void |
handleSaslAuth(LdapSession ldapSession,
org.apache.directory.shared.ldap.message.BindRequest bindRequest)
Handle the SASL authentication. |
void |
handleSimpleAuth(LdapSession ldapSession,
org.apache.directory.shared.ldap.message.BindRequest bindRequest)
Handle the Simple authentication. |
void |
setSaslMechanismHandlers(java.util.Map<java.lang.String,MechanismHandler> handlers)
Set the mechanisms handler map. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BindHandler
public BindHandler()
setSaslMechanismHandlers
public void setSaslMechanismHandlers(java.util.Map<java.lang.String,MechanismHandler> handlers)
- Set the mechanisms handler map.
- Parameters:
handlers
- The associations btween a machanism and its handler
handleSimpleAuth
public void handleSimpleAuth(LdapSession ldapSession,
org.apache.directory.shared.ldap.message.BindRequest bindRequest)
throws java.lang.Exception
- Handle the Simple authentication.
- Parameters:
session
- The associated Sessionmessage
- The BindRequest received
- Throws:
java.lang.Exception
- If the authentication cannot be done
handleSaslAuth
public void handleSaslAuth(LdapSession ldapSession,
org.apache.directory.shared.ldap.message.BindRequest bindRequest)
throws java.lang.Exception
- Handle the SASL authentication. If the mechanism is known, we are
facing three cases :
- The user does not has a session yet
- The user already has a session
- The user has started a SASL negotiation
In the first case, we initiate a SaslBind session, which will be used all
along the negotiation.
In the second case, we first have to unbind the user, and initiate a new
SaslBind session.
In the third case, we have sub cases :
- The mechanism is not provided : that means the user want to reset the
current negotiation. We move back to an Anonymous state
- The mechanism is provided : the user is initializing a new negotiation
with another mechanism. The current SaslBind session is reinitialized
- Parameters:
session
- The associated Sessionmessage
- The BindRequest received
- Throws:
java.lang.Exception
- If the authentication cannot be done
handle
public void handle(LdapSession ldapSession,
org.apache.directory.shared.ldap.message.BindRequest bindRequest)
throws java.lang.Exception
- Deal with a received BindRequest
- Specified by:
handle
in class LdapRequestHandler<org.apache.directory.shared.ldap.message.BindRequest>
- Parameters:
session
- The current sessionbindRequest
- The received BindRequest
- Throws:
java.lang.Exception
- If the authentication cannot be handled
Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.