FileDocCategorySizeDatePackage
QuitCmdHandler.javaAPI DocApache James 2.3.12811Fri Jan 12 12:56:26 GMT 2007org.apache.james.smtpserver

QuitCmdHandler

public class QuitCmdHandler extends Object implements CommandHandler
Handles QUIT command

Fields Summary
private static final String
COMMAND_NAME
The name of the command handled by the command handler
Constructors Summary
Methods Summary
private voiddoQUIT(SMTPSession session, java.lang.String argument)
Handler method called upon receipt of a QUIT command. This method informs the client that the connection is closing.

param
session SMTP session object
param
argument the argument passed in with the command by the SMTP client


        String responseString = "";
        if ((argument == null) || (argument.length() == 0)) {
            session.getResponseBuffer().append("221 "+DSNStatus.getStatus(DSNStatus.SUCCESS,DSNStatus.UNDEFINED_STATUS)+" ")
                          .append(session.getConfigurationData().getHelloName())
                          .append(" Service closing transmission channel");
            responseString = session.clearResponseBuffer();
        } else {
            responseString = "500 "+DSNStatus.getStatus(DSNStatus.PERMANENT,DSNStatus.DELIVERY_INVALID_ARG)+" Unexpected argument provided with QUIT command";
        }
        session.writeResponse(responseString);
        session.endSession();
    
public voidonCommand(SMTPSession session)
handles QUIT command

see
org.apache.james.smtpserver.CommandHandler#onCommand(SMTPSession)


              
        
        doQUIT(session, session.getCommandArgument());