|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.abstracthorizon.danube.service.server.ServerConnectionHandler
org.abstracthorizon.mercury.smtp.command.SMTPCommandFactory
public class SMTPCommandFactory
SMTP command factory. This class is implementing parsing commands and invoking them.
| Field Summary | |
|---|---|
protected Map<String,SMTPCommand> |
commands
Map of commands |
static String |
DATA
DATA command |
static String |
EHLO
EHLO command |
static String |
EXPN
EXPN command |
static String |
HELO
HELO commmand |
protected int |
inactivityTimeout
Inactivity timeout |
protected static org.slf4j.Logger |
logger
Logger |
static String |
MAIL
MAIL command |
static String |
NOOP
NOOP commmand |
static String |
QUIT
QUIT command |
static String |
RCPT
RCPT command |
static String |
RSET
RSET (reset) command |
static String |
VRFY
VRFY command |
| Fields inherited from class org.abstracthorizon.danube.service.server.ServerConnectionHandler |
|---|
connectionHandler |
| Constructor Summary | |
|---|---|
SMTPCommandFactory()
Constructor. |
|
| Method Summary | |
|---|---|
protected org.abstracthorizon.danube.connection.Connection |
decorateConnection(org.abstracthorizon.danube.connection.Connection connection)
Sets state to SMTPSession.STATE_READY |
protected void |
finishProcessingConnection(org.abstracthorizon.danube.connection.Connection connection,
boolean closedConnection)
Does nothing |
SMTPCommand |
getCommand(String mnemonic)
Returns a command from the map of commands |
Map<String,SMTPCommand> |
getCommands()
Returns commands |
int |
getInactivityTimeout()
Returns inactivity timeout |
void |
invokeCommand(SMTPSession smtpConnection,
String commandName,
SMTPCommand command)
Invokes command |
protected boolean |
postProcessing(org.abstracthorizon.danube.connection.Connection connection)
Returns false only if state of connection is SMTPSession.STATE_CONNECTED |
protected void |
processConnection(org.abstracthorizon.danube.connection.Connection connection)
Processes keywords |
void |
processKeywords(SMTPSession smtpConnection)
Checks all defined commands in map of commands. |
void |
setCommands(Map<String,SMTPCommand> commands)
Sets map of commands |
void |
setInactivityTimeout(int timeout)
Sets inactivity timeout |
| Methods inherited from class org.abstracthorizon.danube.service.server.ServerConnectionHandler |
|---|
closeConnection, getConnectionHandler, handleConnection, setConnectionHandler |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static String HELO
public static String EHLO
public static String MAIL
public static String RCPT
public static String DATA
public static String NOOP
public static String RSET
public static String QUIT
public static String VRFY
public static String EXPN
protected static final org.slf4j.Logger logger
protected Map<String,SMTPCommand> commands
protected int inactivityTimeout
| Constructor Detail |
|---|
public SMTPCommandFactory()
| Method Detail |
|---|
public Map<String,SMTPCommand> getCommands()
public void setCommands(Map<String,SMTPCommand> commands)
commands - commandspublic void setInactivityTimeout(int timeout)
timeout - timeoutpublic int getInactivityTimeout()
protected void processConnection(org.abstracthorizon.danube.connection.Connection connection)
processConnection in class org.abstracthorizon.danube.service.server.ServerConnectionHandlerconnection - connectionprotected org.abstracthorizon.danube.connection.Connection decorateConnection(org.abstracthorizon.danube.connection.Connection connection)
SMTPSession.STATE_READY
decorateConnection in class org.abstracthorizon.danube.service.server.ServerConnectionHandlerconnection - connectionprotected boolean postProcessing(org.abstracthorizon.danube.connection.Connection connection)
false only if state of connection is SMTPSession.STATE_CONNECTED
postProcessing in class org.abstracthorizon.danube.service.server.ServerConnectionHandlerconnection - connection
protected void finishProcessingConnection(org.abstracthorizon.danube.connection.Connection connection,
boolean closedConnection)
finishProcessingConnection in class org.abstracthorizon.danube.service.server.ServerConnectionHandlerconnection - connectionclosedConnection - is connection already closed.
public SMTPCommand getCommand(String mnemonic)
throws CommandException
mnemonic - command name
null
CommandException
public void processKeywords(SMTPSession smtpConnection)
throws IOException
smtpConnection - smtp connection
IOException
public void invokeCommand(SMTPSession smtpConnection,
String commandName,
SMTPCommand command)
throws IOException
smtpConnection - smtp connectioncommandName - command namecommand - command itself
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||