org.apache.ftpserver
Class FtpServerFactory

java.lang.Object
  extended by org.apache.ftpserver.FtpServerFactory

public class FtpServerFactory
extends java.lang.Object

This is the starting point of all the servers. Creates server instances based on the provided configuration.

Version:
$Rev: 701885 $, $Date: 2008-10-05 22:51:37 +0200 (Sun, 05 Oct 2008) $
Author:
The Apache MINA Project (dev@mina.apache.org)

Constructor Summary
FtpServerFactory()
          Creates a server with the default configuration
 
Method Summary
 void addListener(java.lang.String name, Listener listener)
          Add a Listener to this factory
 FtpServer createServer()
          Create a DefaultFtpServer instance based on the provided configuration
 CommandFactory getCommandFactory()
          Retrieve the command factory used by servers created by this factory
 ConnectionConfig getConnectionConfig()
          Retrieve the connection configuration this server
 FileSystemFactory getFileSystem()
          Retrieve the file system used by servers created by this factory
 java.util.Map<java.lang.String,Ftplet> getFtplets()
          Get all Ftplets registered by servers created by this factory
 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 on servers created by this factory
 MessageResource getMessageResource()
          Retrieve the message resource used by servers created by this factory
 UserManager getUserManager()
          Retrieve the user manager used by servers created by this factory
 void setCommandFactory(CommandFactory commandFactory)
          Set the command factory to be used by servers created by this factory
 void setConnectionConfig(ConnectionConfig connectionConfig)
          Set the message resource to be used with this server
 void setFileSystem(FileSystemFactory fileSystem)
          Set the file system to be used by servers created by this factory
 void setFtplets(java.util.Map<java.lang.String,Ftplet> ftplets)
          Set the Ftplets to be active by servers created by this factory.
 void setListeners(java.util.Map<java.lang.String,Listener> listeners)
          Set the listeners for servers created by this factory, replaces existing listeners
 void setMessageResource(MessageResource messageResource)
          Set the message resource to be used with by servers created by this factory
 void setUserManager(UserManager userManager)
          Set the user manager to be used by servers created by this factory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FtpServerFactory

public FtpServerFactory()
Creates a server with the default configuration

Throws:
java.lang.Exception
Method Detail

createServer

public FtpServer createServer()
Create a DefaultFtpServer instance based on the provided configuration

Returns:
The DefaultFtpServer instance

getListeners

public java.util.Map<java.lang.String,Listener> getListeners()
Get all listeners available on servers created by this factory

Returns:
The current listeners

getListener

public Listener getListener(java.lang.String name)
Get a specific Listener identified by its name

Parameters:
name - The name of the listener
Returns:
The Listener matching the provided name

addListener

public void addListener(java.lang.String name,
                        Listener listener)
Add a Listener to this factory

Parameters:
name - The name of the listener
listener - The Listener

setListeners

public void setListeners(java.util.Map<java.lang.String,Listener> listeners)
Set the listeners for servers created by this factory, replaces existing listeners

Parameters:
listeners - The listeners to use for this server with the name as the key and the listener as the value
Throws:
java.lang.IllegalStateException - If a custom server context has been set

getFtplets

public java.util.Map<java.lang.String,Ftplet> getFtplets()
Get all Ftplets registered by servers created by this factory

Returns:
All Ftplets

setFtplets

public void setFtplets(java.util.Map<java.lang.String,Ftplet> ftplets)
Set the Ftplets to be active by servers created by this factory. Replaces existing Ftplets

Parameters:
ftplets - Ftplets as a map with the name as the key and the Ftplet as the value. The Ftplet container will iterate over the map in the order provided by the Map. If invocation order of Ftplets is of importance, make sure to provide a ordered Map, for example LinkedHashMap.
Throws:
java.lang.IllegalStateException - If a custom server context has been set

getUserManager

public UserManager getUserManager()
Retrieve the user manager used by servers created by this factory

Returns:
The user manager

setUserManager

public void setUserManager(UserManager userManager)
Set the user manager to be used by servers created by this factory

Parameters:
userManager - The UserManager
Throws:
java.lang.IllegalStateException - If a custom server context has been set

getFileSystem

public FileSystemFactory getFileSystem()
Retrieve the file system used by servers created by this factory

Returns:
The FileSystemFactory

setFileSystem

public void setFileSystem(FileSystemFactory fileSystem)
Set the file system to be used by servers created by this factory

Parameters:
fileSystem - The FileSystemFactory
Throws:
java.lang.IllegalStateException - If a custom server context has been set

getCommandFactory

public CommandFactory getCommandFactory()
Retrieve the command factory used by servers created by this factory

Returns:
The CommandFactory

setCommandFactory

public void setCommandFactory(CommandFactory commandFactory)
Set the command factory to be used by servers created by this factory

Parameters:
commandFactory - The CommandFactory
Throws:
java.lang.IllegalStateException - If a custom server context has been set

getMessageResource

public MessageResource getMessageResource()
Retrieve the message resource used by servers created by this factory

Returns:
The MessageResource

setMessageResource

public void setMessageResource(MessageResource messageResource)
Set the message resource to be used with by servers created by this factory

Parameters:
messageResource - The MessageResource
Throws:
java.lang.IllegalStateException - If a custom server context has been set

getConnectionConfig

public ConnectionConfig getConnectionConfig()
Retrieve the connection configuration this server

Returns:
The MessageResource

setConnectionConfig

public void setConnectionConfig(ConnectionConfig connectionConfig)
Set the message resource to be used with this server

Parameters:
connectionConfig - The ConnectionConfig to be used by servers created by this factory
messageResource - The MessageResource
Throws:
java.lang.IllegalStateException - If a custom server context has been set


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.