org.mockftpserver.core.command
Class StaticReplyCommandHandler

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.core.command.StaticReplyCommandHandler
All Implemented Interfaces:
CommandHandler, InvocationHistory, ReplyTextBundleAware

public final class StaticReplyCommandHandler
extends AbstractStaticReplyCommandHandler

CommandHandler that sends back the configured reply code and text. You can customize the returned reply code by setting the required replyCode property. If only the replyCode property is set, then the default reply text corresponding to that reply code is used in the response. You can optionally configure the reply text by setting the replyMessageKey or replyText property.

Each invocation record stored by this CommandHandler contains no data elements.

Version:
$Revision: 184 $ - $Date: 2008-12-03 17:52:39 -0500 (Wed, 03 Dec 2008) $
Author:
Chris Mair

Field Summary
 
Fields inherited from class org.mockftpserver.core.command.AbstractStaticReplyCommandHandler
replyCode, replyMessageKey, replyText
 
Fields inherited from class org.mockftpserver.core.command.AbstractCommandHandler
LOG
 
Constructor Summary
StaticReplyCommandHandler()
          Create a new uninitialized instance
StaticReplyCommandHandler(int replyCode)
          Create a new instance with the specified replyCode
StaticReplyCommandHandler(int replyCode, String replyText)
          Create a new instance with the specified replyCode and replyText
 
Method Summary
 void handleCommand(Command command, Session session, InvocationRecord invocationRecord)
          Handle the specified command for the session.
 
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
 

Constructor Detail

StaticReplyCommandHandler

public StaticReplyCommandHandler()
Create a new uninitialized instance


StaticReplyCommandHandler

public StaticReplyCommandHandler(int replyCode)
Create a new instance with the specified replyCode

Parameters:
replyCode - - the replyCode to use
Throws:
AssertFailedException - - if the replyCode is null

StaticReplyCommandHandler

public StaticReplyCommandHandler(int replyCode,
                                 String replyText)
Create a new instance with the specified replyCode and replyText

Parameters:
replyCode - - the replyCode to use
replyText - - the replyText
Throws:
AssertFailedException - - if the replyCode is null
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:
AbstractTrackingCommandHandler.handleCommand(Command, org.mockftpserver.core.session.Session, InvocationRecord)


Copyright © 2014. All rights reserved.