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

java.lang.Object
  extended by org.apache.directory.server.ldap.handlers.AbstractLdapHandler
All Implemented Interfaces:
org.apache.mina.handler.demux.MessageHandler
Direct Known Subclasses:
AbandonHandler, AddHandler, BindHandler, CompareHandler, DeleteHandler, ExtendedHandler, ModifyDnHandler, ModifyHandler, SearchHandler, UnbindHandler

public abstract class AbstractLdapHandler
extends java.lang.Object
implements org.apache.mina.handler.demux.MessageHandler

An abstract class to handle common methods used by all the handlers

Version:
$Rev: 541827 $
Author:
Apache Directory Project

Field Summary
 
Fields inherited from interface org.apache.mina.handler.demux.MessageHandler
NOOP
 
Constructor Summary
AbstractLdapHandler()
           
 
Method Summary
 LdapServer getProtocolProvider()
           
 SessionRegistry getSessionRegistry()
           
 boolean isConfidentialityRequirementSatisfied(org.apache.mina.common.IoSession session)
          Checks to see if confidentiality requirements are met.
 void setProtocolProvider(LdapServer provider)
           
protected  void setRequestControls(javax.naming.ldap.LdapContext context, org.apache.directory.shared.ldap.message.Message message)
          Return an array containing the controls for this message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.mina.handler.demux.MessageHandler
messageReceived
 

Constructor Detail

AbstractLdapHandler

public AbstractLdapHandler()
Method Detail

getProtocolProvider

public final LdapServer getProtocolProvider()

setProtocolProvider

public final void setProtocolProvider(LdapServer provider)

isConfidentialityRequirementSatisfied

public final boolean isConfidentialityRequirementSatisfied(org.apache.mina.common.IoSession session)
Checks to see if confidentiality requirements are met. If the LdapServer requires confidentiality and the SSLFilter is engaged this will return true. If confidentiality is not required this will return true. If confidentially is required and the SSLFilter is not engaged in the IoFilterChain this will return false. This method is used by handlers to determine whether to send back ResultCodeEnum.CONFIDENTIALITY_REQUIRED error responses back to clients.

Parameters:
session - the MINA IoSession to check for TLS security
Returns:
true if confidentiality requirement is met, false otherwise

getSessionRegistry

public final SessionRegistry getSessionRegistry()

setRequestControls

protected void setRequestControls(javax.naming.ldap.LdapContext context,
                                  org.apache.directory.shared.ldap.message.Message message)
                           throws javax.naming.NamingException
Return an array containing the controls for this message.

Parameters:
context - The context in which we will store teh found controls
message - The message for which we want to extract the controls
Throws:
javax.naming.NamingException


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