public class CommandHandler extends Object
| Constructor and Description |
|---|
CommandHandler(DataOutputStream outToClient,
Scanner inFromClient)
Creates a new CommandHandler
|
| Modifier and Type | Method and Description |
|---|---|
AuthStatus |
handleAuth(String fullAuth)
Handles the AUTH command
|
void |
handleData()
Handles the DATA command
|
void |
handleEHLO(String fullEHLO)
Handles the EHLO command
|
void |
handleMAIL(String fullMAIL)
Handles the Mail command
|
void |
handleNotImplemented(String cmd)
Handles any command not implemented (missing) or not valid
|
void |
handleQuit()
Handles the QUIT command
|
void |
handleRCPT(String fullCmd)
Handles the RCPT command
|
void |
handleResponse(String response)
Handles the response to the client
|
void |
handleRSET()
Handles the RSET command
|
SSLSocket |
handleSTARTTLS(Socket old)
Handles the STARTTLS command
|
void |
setInAndOutFromClient(Scanner in,
DataOutputStream out)
Sets the in and out streams to and from the client
|
public CommandHandler(DataOutputStream outToClient, Scanner inFromClient)
outToClient - A stream that goes out to the clientinFromClient - A stream that comes in from the clientpublic AuthStatus handleAuth(String fullAuth)
fullAuth - The full auth commandpublic void handleData()
public void handleEHLO(String fullEHLO)
fullEHLO - The full line of the command from clientpublic void handleMAIL(String fullMAIL)
fullMAIL - The full line of the command from the clientpublic void handleRCPT(String fullCmd)
fullCmd - The full line of the RCPT commandpublic void handleRSET()
public SSLSocket handleSTARTTLS(Socket old) throws IOException
old - The old non-ssl socketIOException - Input or Output failedpublic void handleQuit()
public void handleNotImplemented(String cmd)
cmd - The command that is not implementedpublic void handleResponse(String response)
response - The response to send to the clientpublic void setInAndOutFromClient(Scanner in, DataOutputStream out)
in - The stream in from the clientout - The stream out to the clientCopyright © 2019. All rights reserved.