org.apache.ftpserver.usermanager
Class DbUserManagerFactory

java.lang.Object
  extended by org.apache.ftpserver.usermanager.DbUserManagerFactory
All Implemented Interfaces:
UserManagerFactory

public class DbUserManagerFactory
extends Object
implements UserManagerFactory

Factory for database backed UserManager instances.

Author:
Apache MINA Project

Constructor Summary
DbUserManagerFactory()
           
 
Method Summary
 UserManager createUserManager()
          Create an UserManager instance based on the configuration on the factory
 String getAdminName()
          Get the admin name.
 DataSource getDataSource()
          Retrive the data source used by the user manager
 PasswordEncryptor getPasswordEncryptor()
          Retrieve the password encryptor used for this user manager
 String getSqlUserAdmin()
          Get the SQL SELECT statement used to find whether an user is admin or not.
 String getSqlUserAuthenticate()
          Get the SQL SELECT statement used to authenticate user.
 String getSqlUserDelete()
          Get the SQL DELETE statement used to delete an existing user.
 String getSqlUserInsert()
          Get the SQL INSERT statement used to add a new user.
 String getSqlUserSelect()
          Get the SQL SELECT statement used to select an existing user.
 String getSqlUserSelectAll()
          Get the SQL SELECT statement used to select all user ids.
 String getSqlUserUpdate()
          Get the SQL UPDATE statement used to update an existing user.
 void setAdminName(String adminName)
          Set the name to use as the administrator of the server.
 void setDataSource(DataSource dataSource)
          Set the data source to be used by the user manager
 void setPasswordEncryptor(PasswordEncryptor passwordEncryptor)
          Set the password encryptor to use for this user manager
 void setSqlUserAdmin(String sql)
          Set the SQL SELECT statement used to find whether an user is admin or not.
 void setSqlUserAuthenticate(String sql)
          Set the SQL SELECT statement used to authenticate user.
 void setSqlUserDelete(String sql)
          Set the SQL DELETE statement used to delete an existing user.
 void setSqlUserInsert(String sql)
          Set the SQL INSERT statement used to add a new user.
 void setSqlUserSelect(String sql)
          Set the SQL SELECT statement used to select an existing user.
 void setSqlUserSelectAll(String sql)
          Set the SQL SELECT statement used to select all user ids.
 void setSqlUserUpdate(String sql)
          Set the SQL UPDATE statement used to update an existing user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbUserManagerFactory

public DbUserManagerFactory()
Method Detail

createUserManager

public UserManager createUserManager()
Description copied from interface: UserManagerFactory
Create an UserManager instance based on the configuration on the factory

Specified by:
createUserManager in interface UserManagerFactory
Returns:
The UserManager

getAdminName

public String getAdminName()
Get the admin name.

Returns:
The admin user name

setAdminName

public void setAdminName(String adminName)
Set the name to use as the administrator of the server. The default value is "admin".

Parameters:
adminName - The administrator user name

getDataSource

public DataSource getDataSource()
Retrive the data source used by the user manager

Returns:
The current data source

setDataSource

public void setDataSource(DataSource dataSource)
Set the data source to be used by the user manager

Parameters:
dataSource - The data source to use

getSqlUserInsert

public String getSqlUserInsert()
Get the SQL INSERT statement used to add a new user.

Returns:
The SQL statement

setSqlUserInsert

public void setSqlUserInsert(String sql)
Set the SQL INSERT statement used to add a new user. All the dynamic values will be replaced during runtime.

Parameters:
sql - The SQL statement

getSqlUserDelete

public String getSqlUserDelete()
Get the SQL DELETE statement used to delete an existing user.

Returns:
The SQL statement

setSqlUserDelete

public void setSqlUserDelete(String sql)
Set the SQL DELETE statement used to delete an existing user. All the dynamic values will be replaced during runtime.

Parameters:
sql - The SQL statement

getSqlUserUpdate

public String getSqlUserUpdate()
Get the SQL UPDATE statement used to update an existing user.

Returns:
The SQL statement

setSqlUserUpdate

public void setSqlUserUpdate(String sql)
Set the SQL UPDATE statement used to update an existing user. All the dynamic values will be replaced during runtime.

Parameters:
sql - The SQL statement

getSqlUserSelect

public String getSqlUserSelect()
Get the SQL SELECT statement used to select an existing user.

Returns:
The SQL statement

setSqlUserSelect

public void setSqlUserSelect(String sql)
Set the SQL SELECT statement used to select an existing user. All the dynamic values will be replaced during runtime.

Parameters:
sql - The SQL statement

getSqlUserSelectAll

public String getSqlUserSelectAll()
Get the SQL SELECT statement used to select all user ids.

Returns:
The SQL statement

setSqlUserSelectAll

public void setSqlUserSelectAll(String sql)
Set the SQL SELECT statement used to select all user ids. All the dynamic values will be replaced during runtime.

Parameters:
sql - The SQL statement

getSqlUserAuthenticate

public String getSqlUserAuthenticate()
Get the SQL SELECT statement used to authenticate user.

Returns:
The SQL statement

setSqlUserAuthenticate

public void setSqlUserAuthenticate(String sql)
Set the SQL SELECT statement used to authenticate user. All the dynamic values will be replaced during runtime.

Parameters:
sql - The SQL statement

getSqlUserAdmin

public String getSqlUserAdmin()
Get the SQL SELECT statement used to find whether an user is admin or not.

Returns:
The SQL statement

setSqlUserAdmin

public void setSqlUserAdmin(String sql)
Set the SQL SELECT statement used to find whether an user is admin or not. All the dynamic values will be replaced during runtime.

Parameters:
sql - The SQL statement

getPasswordEncryptor

public PasswordEncryptor getPasswordEncryptor()
Retrieve the password encryptor used for this user manager

Returns:
The password encryptor. Default to Md5PasswordEncryptor if no other has been provided

setPasswordEncryptor

public void setPasswordEncryptor(PasswordEncryptor passwordEncryptor)
Set the password encryptor to use for this user manager

Parameters:
passwordEncryptor - The password encryptor


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