org.apache.james.protocols.smtp.core.esmtp
Class AuthCmdHandler

java.lang.Object
  extended by org.apache.james.protocols.smtp.core.esmtp.AuthCmdHandler
All Implemented Interfaces:
CommandHandler<SMTPSession>, ExtensibleHandler, EhloExtension, MailParametersHook

public class AuthCmdHandler
extends java.lang.Object
implements CommandHandler<SMTPSession>, EhloExtension, ExtensibleHandler, MailParametersHook

handles AUTH command Note: we could extend this to use java5 sasl standard libraries and provide client support against a server implemented via non-james specific hooks. This would allow us to reuse hooks between imap4/pop3/smtp and eventually different system (simple pluggabilty against external authentication services).


Constructor Summary
AuthCmdHandler()
           
 
Method Summary
protected  SMTPResponse calcDefaultSMTPResponse(HookResult result)
          Calculate the SMTPResponse for the given result
 HookResult doMailParameter(SMTPSession session, java.lang.String paramName, java.lang.String paramValue)
          Return the HookResult after run the hook
protected  java.util.List<AuthHook> getHooks()
          Return a list which holds all hooks for the cmdHandler
 java.util.Collection<java.lang.String> getImplCommands()
           
 java.util.List<java.lang.String> getImplementedEsmtpFeatures(SMTPSession session)
           
 java.lang.String[] getMailParamNames()
           
 java.util.List<java.lang.Class<?>> getMarkerInterfaces()
           
 Response onCommand(SMTPSession session, Request request)
          handles AUTH command
 void wireExtensions(java.lang.Class interfaceName, java.util.List extension)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthCmdHandler

public AuthCmdHandler()
Method Detail

onCommand

public Response onCommand(SMTPSession session,
                          Request request)
handles AUTH command

Specified by:
onCommand in interface CommandHandler<SMTPSession>

calcDefaultSMTPResponse

protected SMTPResponse calcDefaultSMTPResponse(HookResult result)
Calculate the SMTPResponse for the given result

Parameters:
result - the HookResult which should converted to SMTPResponse
Returns:
the calculated SMTPResponse for the given HookReslut

getImplCommands

public java.util.Collection<java.lang.String> getImplCommands()
Specified by:
getImplCommands in interface CommandHandler<SMTPSession>
See Also:
org.apache.james.smtpserver.protocol.CommandHandler#getImplCommands()

getImplementedEsmtpFeatures

public java.util.List<java.lang.String> getImplementedEsmtpFeatures(SMTPSession session)
Specified by:
getImplementedEsmtpFeatures in interface EhloExtension
See Also:
EhloExtension.getImplementedEsmtpFeatures(org.apache.james.protocols.smtp.SMTPSession)

getMarkerInterfaces

public java.util.List<java.lang.Class<?>> getMarkerInterfaces()
Specified by:
getMarkerInterfaces in interface ExtensibleHandler
See Also:
ExtensibleHandler.getMarkerInterfaces()

wireExtensions

public void wireExtensions(java.lang.Class interfaceName,
                           java.util.List extension)
                    throws WiringException
Specified by:
wireExtensions in interface ExtensibleHandler
Throws:
WiringException
See Also:
ExtensibleHandler.wireExtensions(java.lang.Class, java.util.List)

getHooks

protected java.util.List<AuthHook> getHooks()
Return a list which holds all hooks for the cmdHandler

Returns:

doMailParameter

public HookResult doMailParameter(SMTPSession session,
                                  java.lang.String paramName,
                                  java.lang.String paramValue)
Description copied from interface: MailParametersHook
Return the HookResult after run the hook

Specified by:
doMailParameter in interface MailParametersHook
Parameters:
session - the SMTPSession
paramName - parameter name
paramValue - parameter value
Returns:
HockResult
See Also:
MailParametersHook.doMailParameter(org.apache.james.protocols.smtp.SMTPSession, java.lang.String, java.lang.String)

getMailParamNames

public java.lang.String[] getMailParamNames()
Specified by:
getMailParamNames in interface MailParametersHook
Returns:
an array of supported parameters
See Also:
MailParametersHook.getMailParamNames()


Copyright © 2010 The Apache Software Foundation. All Rights Reserved.