org.apache.james.protocols.smtp.core
Class MailCmdHandler

java.lang.Object
  extended by org.apache.james.protocols.smtp.core.AbstractHookableCmdHandler<MailHook>
      extended by org.apache.james.protocols.smtp.core.MailCmdHandler
All Implemented Interfaces:
CommandHandler<SMTPSession>, ExtensibleHandler, ProtocolHandler

public class MailCmdHandler
extends AbstractHookableCmdHandler<MailHook>

Handles MAIL command


Constructor Summary
MailCmdHandler()
           
 
Method Summary
protected  HookResult callHook(MailHook rawHook, SMTPSession session, String parameters)
          Must be implemented by hookable cmd handlers to make the effective call to an hook.
protected  SMTPResponse doCoreCmd(SMTPSession session, String command, String parameters)
          Execute the core commandHandling.
protected  SMTPResponse doFilterChecks(SMTPSession session, String command, String parameters)
          Execute Syntax checks and return a SMTPResponse if a syntax error was detected, otherwise null.
protected  String getDefaultDomain()
          Return the default domain to append if the sender contains none
protected  Class<MailHook> getHookInterface()
          Return the interface which hooks need to implement to hook in
 Collection<String> getImplCommands()
           
 List<Class<?>> getMarkerInterfaces()
           
 Response onCommand(SMTPSession session, Request request)
          Handle command processing
 void wireExtensions(Class interfaceName, List extension)
           
 
Methods inherited from class org.apache.james.protocols.smtp.core.AbstractHookableCmdHandler
calcDefaultSMTPResponse, getHooks
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailCmdHandler

public MailCmdHandler()
Method Detail

onCommand

public Response onCommand(SMTPSession session,
                          Request request)
Description copied from class: AbstractHookableCmdHandler
Handle command processing

Specified by:
onCommand in interface CommandHandler<SMTPSession>
Overrides:
onCommand in class AbstractHookableCmdHandler<MailHook>
See Also:
#onCommand(SMTPSession, Request)

getImplCommands

public Collection<String> getImplCommands()
See Also:
CommandHandler.getImplCommands()

doCoreCmd

protected SMTPResponse doCoreCmd(SMTPSession session,
                                 String command,
                                 String parameters)
Description copied from class: AbstractHookableCmdHandler
Execute the core commandHandling.

Specified by:
doCoreCmd in class AbstractHookableCmdHandler<MailHook>
Returns:
smtp response
See Also:
AbstractHookableCmdHandler.doCoreCmd(org.apache.james.protocols.smtp.SMTPSession, java.lang.String, java.lang.String)

doFilterChecks

protected SMTPResponse doFilterChecks(SMTPSession session,
                                      String command,
                                      String parameters)
Description copied from class: AbstractHookableCmdHandler
Execute Syntax checks and return a SMTPResponse if a syntax error was detected, otherwise null.

Specified by:
doFilterChecks in class AbstractHookableCmdHandler<MailHook>
Returns:
smtp response if a syntax error was detected, otherwise null
See Also:
AbstractHookableCmdHandler.doFilterChecks(org.apache.james.protocols.smtp.SMTPSession, java.lang.String, java.lang.String)

getHookInterface

protected Class<MailHook> getHookInterface()
Description copied from class: AbstractHookableCmdHandler
Return the interface which hooks need to implement to hook in

Specified by:
getHookInterface in class AbstractHookableCmdHandler<MailHook>
Returns:
interface
See Also:
AbstractHookableCmdHandler.getHookInterface()

callHook

protected HookResult callHook(MailHook rawHook,
                              SMTPSession session,
                              String parameters)
Must be implemented by hookable cmd handlers to make the effective call to an hook.

Specified by:
callHook in class AbstractHookableCmdHandler<MailHook>
Parameters:
rawHook - the hook
session - the session
parameters - the parameters
Returns:
the HookResult, will be calculated using HookResultToSMTPResponse.

getMarkerInterfaces

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

wireExtensions

public void wireExtensions(Class interfaceName,
                           List extension)
Specified by:
wireExtensions in interface ExtensibleHandler
Overrides:
wireExtensions in class AbstractHookableCmdHandler<MailHook>
See Also:
AbstractHookableCmdHandler.wireExtensions(java.lang.Class, java.util.List)

getDefaultDomain

protected String getDefaultDomain()
Return the default domain to append if the sender contains none

Returns:
defaultDomain


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