org.apache.directory.server.ldap.handlers
Class LdapRequestHandler<T extends org.apache.directory.shared.ldap.message.internal.InternalRequest>

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

public abstract class LdapRequestHandler<T extends org.apache.directory.shared.ldap.message.internal.InternalRequest>
extends java.lang.Object
implements org.apache.mina.handler.demux.MessageHandler<T>

A base class for all LDAP request handlers.

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

Field Summary
protected  LdapServer ldapServer
          The reference on the Ldap server instance
 
Fields inherited from interface org.apache.mina.handler.demux.MessageHandler
NOOP
 
Constructor Summary
LdapRequestHandler()
           
 
Method Summary
 LdapServer getLdapServer()
           
abstract  void handle(LdapSession session, T message)
          Handle a Ldap message associated with a session
 void handleException(LdapSession session, org.apache.directory.shared.ldap.message.internal.InternalResultResponseRequest req, java.lang.Exception e)
          Handles processing with referrals without ManageDsaIT control.
 void handleMessage(org.apache.mina.core.session.IoSession session, T message)
          
 boolean isConfidentialityRequirementSatisfied(org.apache.mina.core.session.IoSession session)
          Checks to see if confidentiality requirements are met.
 void rejectWithoutConfidentiality(org.apache.mina.core.session.IoSession session, org.apache.directory.shared.ldap.message.internal.InternalResultResponse resp)
           
 void setLdapServer(LdapServer ldapServer)
          Associates a Ldap server instance to the message handler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ldapServer

protected LdapServer ldapServer
The reference on the Ldap server instance

Constructor Detail

LdapRequestHandler

public LdapRequestHandler()
Method Detail

getLdapServer

public final LdapServer getLdapServer()
Returns:
The associated ldap server instance

setLdapServer

public final void setLdapServer(LdapServer ldapServer)
Associates a Ldap server instance to the message handler

Parameters:
ldapServer - the associated ldap server instance

isConfidentialityRequirementSatisfied

public final boolean isConfidentialityRequirementSatisfied(org.apache.mina.core.session.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

rejectWithoutConfidentiality

public void rejectWithoutConfidentiality(org.apache.mina.core.session.IoSession session,
                                         org.apache.directory.shared.ldap.message.internal.InternalResultResponse resp)

handleMessage

public final void handleMessage(org.apache.mina.core.session.IoSession session,
                                T message)
                         throws java.lang.Exception

Specified by:
handleMessage in interface org.apache.mina.handler.demux.MessageHandler<T extends org.apache.directory.shared.ldap.message.internal.InternalRequest>
Throws:
java.lang.Exception

handle

public abstract void handle(LdapSession session,
                            T message)
                     throws java.lang.Exception
Handle a Ldap message associated with a session

Parameters:
session - The associated session
message - The message we have to handle
Throws:
java.lang.Exception - If there is an error during the processing of this message

handleException

public void handleException(LdapSession session,
                            org.apache.directory.shared.ldap.message.internal.InternalResultResponseRequest req,
                            java.lang.Exception e)
Handles processing with referrals without ManageDsaIT control.



Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.