org.mockftpserver.stub.command
Class PasvCommandHandler

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

public class PasvCommandHandler
extends AbstractStubCommandHandler
implements CommandHandler

CommandHandler for the PASV (Passove Mode) command. Request the Session to switch to passive data connection mode. Return a reply code of 227, along with response text of the form: "Entering Passive Mode. (h1,h2,h3,h4,p1,p2)", where h1..h4 are the 4 bytes of the 32-bit internet host address of the server, and p1..p2 are the 2 bytes of the 16-bit TCP port address of the data connection on the server to which the client must connect. See RFC959 for more information.

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

Version:
$Revision: 194 $ - $Date: 2008-12-07 08:53:58 -0500 (Sun, 07 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
PasvCommandHandler()
          Constructor.
 
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
 
Methods inherited from interface org.mockftpserver.core.command.CommandHandler
handleCommand
 

Constructor Detail

PasvCommandHandler

public PasvCommandHandler()
Constructor. Initialize the replyCode.

Method Detail

handleCommand

public void handleCommand(Command command,
                          Session session,
                          InvocationRecord invocationRecord)
                   throws IOException
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
Throws:
IOException
See Also:
CommandHandler.handleCommand(org.mockftpserver.core.command.Command, org.mockftpserver.core.session.Session)


Copyright © 2014. All rights reserved.