protocol
Class FtpProtocol

java.lang.Object
  extended by protocol.FtpProtocol
All Implemented Interfaces:
LIProtocol

public class FtpProtocol
extends java.lang.Object
implements LIProtocol

FTP protocol implementation for HoneyRJ

Author:
Todd Schiller

Constructor Summary
FtpProtocol()
           
 
Method Summary
 int getPort()
          Return the port the protocol listens for connections on ie 80 for HTTP
 boolean isConnectionOver()
          return true if the server believes the connection to be over for whatever reason
 java.util.Vector<java.lang.String> processInput(java.lang.String msg)
          Each time a message is received on the socket from the client, this method is called.
 java.lang.String toString()
          return a textual representation of the protocol name use for use in logs ie HTTP, FTP, etc
 TALK_FIRST whoTalksFirst()
          The return value of this method specifies if the server sends the first message in the protocol (SVR_FIRST) or if the client does (CLIENT_FIRST) The first message is defined as the first person to transmit a String over the network after the TCP handshake/Java socket setup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FtpProtocol

public FtpProtocol()
Method Detail

getPort

public int getPort()
Description copied from interface: LIProtocol
Return the port the protocol listens for connections on ie 80 for HTTP

Specified by:
getPort in interface LIProtocol
Returns:
int that is the port this protocol listens on

isConnectionOver

public boolean isConnectionOver()
Description copied from interface: LIProtocol
return true if the server believes the connection to be over for whatever reason

Specified by:
isConnectionOver in interface LIProtocol
Returns:
true if the protocol is done talking to the client and does not want to receive or send any more messages

processInput

public java.util.Vector<java.lang.String> processInput(java.lang.String msg)
Description copied from interface: LIProtocol
Each time a message is received on the socket from the client, this method is called. The messageFromClient should be processed as needed and a Vector of String messages should be returned. Each message will be sent as a separate line to the client.

Specified by:
processInput in interface LIProtocol
Parameters:
msg - String received on the socket from the client
Returns:
Vector to send to the client on the socket.
See Also:
LIHelper.vectorFromString(String)

whoTalksFirst

public TALK_FIRST whoTalksFirst()
Description copied from interface: LIProtocol
The return value of this method specifies if the server sends the first message in the protocol (SVR_FIRST) or if the client does (CLIENT_FIRST) The first message is defined as the first person to transmit a String over the network after the TCP handshake/Java socket setup.

Specified by:
whoTalksFirst in interface LIProtocol
Returns:
SVR_FIRST if the server sends the first message (ie SMTP)

toString

public java.lang.String toString()
Description copied from interface: LIProtocol
return a textual representation of the protocol name use for use in logs ie HTTP, FTP, etc

Specified by:
toString in interface LIProtocol
Overrides:
toString in class java.lang.Object
Returns:
String containing the name of the protocol as it should appear in a log file.