org.mockftpserver.stub.command
Class UserCommandHandler

java.lang.Object
  extended by org.mockftpserver.core.command.AbstractCommandHandler
      extended by org.mockftpserver.core.command.AbstractTrackingCommandHandler
          extended by org.mockftpserver.core.command.AbstractStaticReplyCommandHandler
              extended by org.mockftpserver.stub.command.AbstractStubCommandHandler
                  extended by org.mockftpserver.stub.command.UserCommandHandler
All Implemented Interfaces:
CommandHandler, InvocationHistory, ReplyTextBundleAware

public class UserCommandHandler
extends AbstractStubCommandHandler
implements CommandHandler

CommandHandler for the USER command. The passwordRequired property defaults to true, indicating that a password is required following the user name. If true, this command handler returns a reply of 331. If false, return a reply of 230.

Each invocation record stored by this CommandHandler includes the following data element key/values:

Version:
$Revision: 194 $ - $Date: 2008-12-07 08:53:58 -0500 (Sun, 07 Dec 2008) $
Author:
Chris Mair

Field Summary
static String USERNAME_KEY
           
 
Fields inherited from class org.mockftpserver.core.command.AbstractStaticReplyCommandHandler
replyCode, replyMessageKey, replyText
 
Fields inherited from class org.mockftpserver.core.command.AbstractCommandHandler
LOG
 
Constructor Summary
UserCommandHandler()
          Constructor.
 
Method Summary
 void handleCommand(Command command, Session session, InvocationRecord invocationRecord)
          Handle the specified command for the session.
 boolean isPasswordRequired()
          Return true if a password is required at login.
 void setPasswordRequired(boolean passwordRequired)
          Set true to indicate that a password is required.
 
Methods inherited from class org.mockftpserver.core.command.AbstractStaticReplyCommandHandler
sendReply, sendReply, setReplyCode, setReplyMessageKey, setReplyText
 
Methods inherited from class org.mockftpserver.core.command.AbstractTrackingCommandHandler
clearInvocations, getInvocation, handleCommand, numberOfInvocations, sendReply
 
Methods inherited from class org.mockftpserver.core.command.AbstractCommandHandler
assertValidReplyCode, getReplyTextBundle, quotes, setReplyTextBundle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mockftpserver.core.command.CommandHandler
handleCommand
 

Field Detail

USERNAME_KEY

public static final String USERNAME_KEY
See Also:
Constant Field Values
Constructor Detail

UserCommandHandler

public UserCommandHandler()
Constructor.

Method Detail

handleCommand

public void handleCommand(Command command,
                          Session session,
                          InvocationRecord invocationRecord)
Description copied from class: AbstractTrackingCommandHandler
Handle the specified command for the session. This method is declared to throw Exception, allowing CommandHandler implementations to avoid unnecessary exception-handling. All checked exceptions are expected to be wrapped and handled by the caller.

Specified by:
handleCommand in class AbstractTrackingCommandHandler
Parameters:
command - - the Command to be handled
session - - the session on which the Command was submitted
invocationRecord - - the InvocationRecord; CommandHandlers are expected to add handler-specific data to the InvocationRecord, as appropriate
See Also:
CommandHandler.handleCommand(org.mockftpserver.core.command.Command, org.mockftpserver.core.session.Session)

isPasswordRequired

public boolean isPasswordRequired()
Return true if a password is required at login. See setPasswordRequired(boolean).

Returns:
the passwordRequired flag

setPasswordRequired

public void setPasswordRequired(boolean passwordRequired)
Set true to indicate that a password is required. If true, this command handler returns a reply of 331. If false, return a reply of 230.

Parameters:
passwordRequired - - is a password required for login


Copyright © 2014. All rights reserved.