|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Ftplet
Defines methods that all ftplets must implement. A ftplet is a small Java program that runs within an FTP server. Ftplets receive and respond to requests from FTP clients. This interface defines methods to initialize a ftplet, to service requests, and to remove a ftplet from the server. These are known as life-cycle methods and are called in the following sequence:
Method Summary | |
---|---|
FtpletResult |
afterCommand(FtpSession session,
FtpRequest request,
FtpReply reply)
Called by the ftplet container after a command has been executed by the server. |
FtpletResult |
beforeCommand(FtpSession session,
FtpRequest request)
Called by the ftplet container before a command is executed by the server. |
void |
destroy()
Called by the Ftplet container to indicate to a ftplet that the ftplet is being taken out of service. |
void |
init(FtpletContext ftpletContext)
Called by the ftplet container to indicate to a ftplet that the ftplet is being placed into service. |
FtpletResult |
onConnect(FtpSession session)
Client connect notification method. |
FtpletResult |
onDisconnect(FtpSession session)
Client disconnect notification method. |
Method Detail |
---|
void init(FtpletContext ftpletContext) throws FtpException
ftpletContext
- The current FtpletContext
FtpException
void destroy()
FtpletResult beforeCommand(FtpSession session, FtpRequest request) throws FtpException, IOException
FtpletResult.DEFAULT
: The server continues as normal and
executes the commandFtpletResult.NO_FTPLET
: The server does not call any more
Ftplets before this command but continues execution of the command as
usualFtpletResult.SKIP
: The server skips over execution of the
command. Note that the Ftplet is responsible for returning the
appropriate reply to the client, or the client might deadlock.FtpletResult.DISCONNECT
: The server will immediately
disconnect the client.FtpletResult.DISCONNECT
session
- The current sessionrequest
- The current request
FtpException
IOException
FtpletResult afterCommand(FtpSession session, FtpRequest request, FtpReply reply) throws FtpException, IOException
FtpletResult.DEFAULT
: The server continues as normalFtpletResult.NO_FTPLET
: The server does not call any more
Ftplets before this command but continues as normalFtpletResult.SKIP
: Same as FtpletResult.DEFAULT
FtpletResult.DISCONNECT
: The server will immediately
disconnect the client.FtpletResult.DISCONNECT
session
- The current sessionrequest
- The current requestreply
- the reply that was sent for this command. Implementations can
use this to check the reply code and thus determine if the
command was successfully processed or not.
FtpException
IOException
FtpletResult onConnect(FtpSession session) throws FtpException, IOException
session
- The current FtpSession
FtpException
IOException
FtpletResult onDisconnect(FtpSession session) throws FtpException, IOException
session
- The current FtpSession
FtpException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |