public class DefaultFtpletContainer extends Object implements FtpletContainer
Constructor and Description |
---|
DefaultFtpletContainer() |
DefaultFtpletContainer(Map<String,Ftplet> ftplets) |
Modifier and Type | Method and Description |
---|---|
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()
Destroy all ftplets.
|
Ftplet |
getFtplet(String name)
Get Ftplet for the given name.
|
Map<String,Ftplet> |
getFtplets()
Retrive all Ftplets registered with this container
|
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)
Call ftplet onConnect.
|
FtpletResult |
onDisconnect(FtpSession session)
Call ftplet onDisconnect.
|
public Ftplet getFtplet(String name)
getFtplet
in interface FtpletContainer
name
- The name of the Ftplet to retrivepublic void init(FtpletContext ftpletContext) throws FtpException
Ftplet
init
in interface Ftplet
ftpletContext
- The current FtpletContext
FtpException
public Map<String,Ftplet> getFtplets()
FtpletContainer
getFtplets
in interface FtpletContainer
FtpletContainer.getFtplets()
public FtpletResult onConnect(FtpSession session) throws FtpException, IOException
onConnect
in interface Ftplet
session
- The current FtpSession
FtpException
IOException
public FtpletResult onDisconnect(FtpSession session) throws FtpException, IOException
onDisconnect
in interface Ftplet
session
- The current FtpSession
FtpException
IOException
public FtpletResult afterCommand(FtpSession session, FtpRequest request, FtpReply reply) throws FtpException, IOException
Ftplet
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
afterCommand
in interface Ftplet
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
public FtpletResult beforeCommand(FtpSession session, FtpRequest request) throws FtpException, IOException
Ftplet
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
beforeCommand
in interface Ftplet
session
- The current sessionrequest
- The current requestFtpException
IOException
Copyright © 2003–2016 The Apache Software Foundation. All rights reserved.