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, ProtocolHandler, EhloExtension, Hook, MailParametersHook

public class AuthCmdHandler
extends 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, String paramName, String paramValue)
          Return the HookResult after run the hook
protected  List<AuthHook> getHooks()
          Return a list which holds all hooks for the cmdHandler
 Collection<String> getImplCommands()
           
 List<String> getImplementedEsmtpFeatures(SMTPSession session)
           
 String[] getMailParamNames()
           
 List<Class<?>> getMarkerInterfaces()
           
 Response onCommand(SMTPSession session, Request request)
          handles AUTH command
 void wireExtensions(Class interfaceName, 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 Collection<String> getImplCommands()
Specified by:
getImplCommands in interface CommandHandler<SMTPSession>
See Also:
CommandHandler.getImplCommands()

getImplementedEsmtpFeatures

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

getMarkerInterfaces

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

wireExtensions

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

getHooks

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

Returns:
list containing all hooks for the cmd handler

doMailParameter

public HookResult doMailParameter(SMTPSession session,
                                  String paramName,
                                  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 String[] getMailParamNames()
Specified by:
getMailParamNames in interface MailParametersHook
Returns:
an array of supported parameters
See Also:
MailParametersHook.getMailParamNames()


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