|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ftpserver.FtpServer
public class FtpServer
This is the starting point of all the servers. It invokes a new listener
thread. Server
implementation is used to create the server
socket and handle client connection.
Constructor Summary | |
---|---|
FtpServer()
Creates a server with the default configuration |
|
FtpServer(FtpServerContext serverContext)
Constructor. |
Method Summary | |
---|---|
void |
addListener(java.lang.String name,
Listener listener)
|
CommandFactory |
getCommandFactory()
Retrieve the command factory used with this server |
ConnectionConfig |
getConnectionConfig()
Retrieve the connection configuration this server |
FileSystemManager |
getFileSystem()
Retrieve the file system used with this server |
java.util.Map<java.lang.String,Ftplet> |
getFtplets()
Get all Ftplet s registered at this server |
Listener |
getListener(java.lang.String name)
Get a specific listener identified by its name |
java.util.Map<java.lang.String,Listener> |
getListeners()
Get all listeners available one this server |
MessageResource |
getMessageResource()
Retrieve the message resource used with this server |
FtpServerContext |
getServerContext()
Get the root server context. |
UserManager |
getUserManager()
Retrieve the user manager used with this server |
boolean |
isStopped()
Get the server status. |
boolean |
isSuspended()
Is the server suspended |
void |
resume()
Resume the server handler |
void |
setCommandFactory(CommandFactory commandFactory)
Set the command factory to be used for this server |
void |
setConnectionConfig(ConnectionConfig connectionConfig)
Set the message resource to be used with this server |
void |
setFileSystem(FileSystemManager fileSystem)
Set the file system to be used for this server |
void |
setFtplets(java.util.Map<java.lang.String,Ftplet> ftplets)
Set the Ftplet s to be active for this server. |
void |
setListeners(java.util.Map<java.lang.String,Listener> listeners)
Set the listeners for this server, replaces existing listeners |
void |
setMessageResource(MessageResource messageResource)
Set the message resource to be used with this server |
void |
setServerContext(FtpServerContext serverContext)
Set a custom server context to be used for this server |
void |
setUserManager(UserManager userManager)
Set the user manager to be used for this server |
void |
start()
Start the server. |
void |
stop()
Stop the server. |
void |
suspend()
Suspend further requests |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FtpServer() throws java.lang.Exception
java.lang.Exception
public FtpServer(FtpServerContext serverContext) throws java.lang.Exception
java.lang.Exception
- TODO consider removingMethod Detail |
---|
public void start() throws java.lang.Exception
java.lang.Exception
public void stop()
public boolean isStopped()
public void suspend()
public void resume()
public boolean isSuspended()
public FtpServerContext getServerContext()
public void setServerContext(FtpServerContext serverContext)
serverContext
- The custom server contextpublic java.util.Map<java.lang.String,Listener> getListeners()
public Listener getListener(java.lang.String name)
name
- The name of the listener
Listener
matching the provided namepublic void addListener(java.lang.String name, Listener listener)
public void setListeners(java.util.Map<java.lang.String,Listener> listeners)
listeners
- The listeners to use for this server with the name as the key
and the listener as the value
java.lang.IllegalStateException
- If a custom server context has been setpublic java.util.Map<java.lang.String,Ftplet> getFtplets()
Ftplet
s registered at this server
Ftplet
spublic void setFtplets(java.util.Map<java.lang.String,Ftplet> ftplets)
Ftplet
s to be active for this server. Replaces existing Ftplet
s
ftplets
- Ftplets as a map with the name as the key and the Ftplet as the value
java.lang.IllegalStateException
- If a custom server context has been setpublic UserManager getUserManager()
public void setUserManager(UserManager userManager)
userManager
- The UserManager
java.lang.IllegalStateException
- If a custom server context has been setpublic FileSystemManager getFileSystem()
FileSystemManager
public void setFileSystem(FileSystemManager fileSystem)
fileSystem
- The FileSystemManager
java.lang.IllegalStateException
- If a custom server context has been setpublic CommandFactory getCommandFactory()
CommandFactory
public void setCommandFactory(CommandFactory commandFactory)
commandFactory
- The CommandFactory
java.lang.IllegalStateException
- If a custom server context has been setpublic MessageResource getMessageResource()
MessageResource
public void setMessageResource(MessageResource messageResource)
messageResource
- The MessageResource
java.lang.IllegalStateException
- If a custom server context has been setpublic ConnectionConfig getConnectionConfig()
MessageResource
public void setConnectionConfig(ConnectionConfig connectionConfig)
messageResource
- The MessageResource
java.lang.IllegalStateException
- If a custom server context has been set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |