org.apache.directory.server.ldap.handlers
Class DefaultBindHandler

java.lang.Object
  extended by org.apache.directory.server.ldap.handlers.AbstractLdapHandler
      extended by org.apache.directory.server.ldap.handlers.BindHandler
          extended by org.apache.directory.server.ldap.handlers.DefaultBindHandler
All Implemented Interfaces:
org.apache.mina.handler.demux.MessageHandler

public class DefaultBindHandler
extends BindHandler

A single reply handler for BindRequests. Implements server-side of RFC 2222, sections 4.2 and 4.3.

Version:
$Rev: 669253 $, $Date: 2008-06-18 14:53:31 -0400 (Wed, 18 Jun 2008) $
Author:
Apache Directory Project

Field Summary
 
Fields inherited from interface org.apache.mina.handler.demux.MessageHandler
NOOP
 
Constructor Summary
DefaultBindHandler()
          Creates a new instance of BindHandler.
 
Method Summary
protected  void bindMessageReceived(org.apache.mina.common.IoSession session, org.apache.directory.shared.ldap.message.BindRequest bindRequest)
          Deal with a received BindRequest
 void handleSasl(org.apache.mina.common.IoSession session, org.apache.directory.shared.ldap.message.BindRequest bindRequest)
          Deal with a SASL bind request
 void handleSaslAuth(org.apache.mina.common.IoSession session, java.lang.Object message)
          Handle the SASL authentication.
 void setDirectoryService(DirectoryService directoryService)
           
 void setSaslMechanismHandlers(java.util.Map<java.lang.String,MechanismHandler> handlers)
          Set the mechanisms handler map.
 void setSessionRegistry(SessionRegistry registry)
          Associated a Registry to the handler
 
Methods inherited from class org.apache.directory.server.ldap.handlers.BindHandler
messageReceived
 
Methods inherited from class org.apache.directory.server.ldap.handlers.AbstractLdapHandler
getProtocolProvider, getSessionRegistry, isConfidentialityRequirementSatisfied, setProtocolProvider, setRequestControls
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultBindHandler

public DefaultBindHandler()
Creates a new instance of BindHandler.

Method Detail

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

setSessionRegistry

public void setSessionRegistry(SessionRegistry registry)
Associated a Registry to the handler

Parameters:
registry - The registry to attach

setDirectoryService

public void setDirectoryService(DirectoryService directoryService)
Specified by:
setDirectoryService in class BindHandler

handleSaslAuth

public void handleSaslAuth(org.apache.mina.common.IoSession session,
                           java.lang.Object message)
                    throws java.lang.Exception
Handle the SASL authentication.

Parameters:
session - The associated Session
message - The BindRequest received
Throws:
java.lang.Exception - If the authentication cannot be done

handleSasl

public void handleSasl(org.apache.mina.common.IoSession session,
                       org.apache.directory.shared.ldap.message.BindRequest bindRequest)
                throws java.lang.Exception
Deal with a SASL bind request

Parameters:
session - The IoSession for this Bind Request
bindRequest - The BindRequest received
Throws:
java.lang.Exception - if the mechanism cannot handle the authentication

bindMessageReceived

protected void bindMessageReceived(org.apache.mina.common.IoSession session,
                                   org.apache.directory.shared.ldap.message.BindRequest bindRequest)
                            throws java.lang.Exception
Deal with a received BindRequest

Specified by:
bindMessageReceived in class BindHandler
Parameters:
session - The current session
bindRequest - The received BindRequest
Throws:
java.lang.Exception - If the euthentication cannot be handled


Copyright © 2003-2008 The Apache Software Foundation. All Rights Reserved.