public abstract class AbstractHookableCmdHandler<Hook extends Hook> extends Object implements CommandHandler<SMTPSession>, ExtensibleHandler
| Constructor and Description |
|---|
AbstractHookableCmdHandler() |
| Modifier and Type | Method and Description |
|---|---|
static SMTPResponse |
calcDefaultSMTPResponse(HookResult result)
Convert the HookResult to SMTPResponse using default values.
|
protected abstract HookResult |
callHook(Hook rawHook,
SMTPSession session,
String parameters)
Must be implemented by hookable cmd handlers to make the effective call to an hook.
|
protected abstract Response |
doCoreCmd(SMTPSession session,
String command,
String parameters)
Execute the core commandHandling.
|
protected abstract Response |
doFilterChecks(SMTPSession session,
String command,
String parameters)
Execute Syntax checks and return a SMTPResponse if a syntax error was
detected, otherwise null.
|
protected abstract Class<Hook> |
getHookInterface()
Return the interface which hooks need to implement to hook in
|
protected List<Hook> |
getHooks()
Return a list which holds all hooks for the cmdHandler
|
List<Class<?>> |
getMarkerInterfaces()
Return a List of interfaces of plugins that will
extend this.
|
Response |
onCommand(SMTPSession session,
Request request)
Handle command processing
|
void |
wireExtensions(Class<?> interfaceName,
List<?> extension)
Method called during initialization after all the handlers have been declared
in the ProtocolHandlerChain.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetImplCommandspublic Response onCommand(SMTPSession session, Request request)
onCommand in interface CommandHandler<SMTPSession>#onCommand(org.apache.james.protocols.api.ProtocolSession, Request)protected abstract HookResult callHook(Hook rawHook, SMTPSession session, String parameters)
rawHook - the hooksession - the sessionparameters - the parameterspublic static SMTPResponse calcDefaultSMTPResponse(HookResult result)
result - HookResultprotected abstract Response doFilterChecks(SMTPSession session, String command, String parameters)
session - command - parameters - nullprotected abstract Response doCoreCmd(SMTPSession session, String command, String parameters)
session - command - parameters - public List<Class<?>> getMarkerInterfaces()
ExtensibleHandlergetMarkerInterfaces in interface ExtensibleHandlerExtensibleHandler.getMarkerInterfaces()protected abstract Class<Hook> getHookInterface()
public void wireExtensions(Class<?> interfaceName, List<?> extension)
ExtensibleHandlerwireExtensions in interface ExtensibleHandlerextension - a list of objects implementing the marker interfaceExtensibleHandler.wireExtensions(java.lang.Class,
java.util.List)Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.