public class DbUserManager extends AbstractUserManager
ATTR_ENABLE, ATTR_HOME, ATTR_LOGIN, ATTR_MAX_DOWNLOAD_RATE, ATTR_MAX_IDLE_TIME, ATTR_MAX_LOGIN_NUMBER, ATTR_MAX_LOGIN_PER_IP, ATTR_MAX_UPLOAD_RATE, ATTR_PASSWORD, ATTR_WRITE_PERM| Constructor and Description |
|---|
DbUserManager(DataSource dataSource,
String selectAllStmt,
String selectUserStmt,
String insertUserStmt,
String updateUserStmt,
String deleteUserStmt,
String authenticateStmt,
String isAdminStmt,
PasswordEncryptor passwordEncryptor,
String adminName)
Internal constructor, do not use directly.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.ftpserver.ftplet.User |
authenticate(org.apache.ftpserver.ftplet.Authentication authentication)
User authentication.
|
protected void |
closeQuitely(Connection con) |
protected Connection |
createConnection()
Open connection to database.
|
void |
delete(String name)
Delete user.
|
boolean |
doesExist(String name)
User existance check.
|
String[] |
getAllUserNames()
Get all user names from the database.
|
DataSource |
getDataSource()
Retrive the data source used by the 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.
|
org.apache.ftpserver.ftplet.User |
getUserByName(String name)
Get the user object.
|
boolean |
isAdmin(String login) |
void |
save(org.apache.ftpserver.ftplet.User user)
Save user.
|
void |
setDataSource(DataSource dataSource)
Set the data source to be used by the 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.
|
getAdminName, getPasswordEncryptorpublic DbUserManager(DataSource dataSource, String selectAllStmt, String selectUserStmt, String insertUserStmt, String updateUserStmt, String deleteUserStmt, String authenticateStmt, String isAdminStmt, PasswordEncryptor passwordEncryptor, String adminName)
DbUserManagerFactory instead.public DataSource getDataSource()
public void setDataSource(DataSource dataSource)
dataSource - The data source to usepublic String getSqlUserInsert()
public void setSqlUserInsert(String sql)
sql - The SQL statementpublic String getSqlUserDelete()
public void setSqlUserDelete(String sql)
sql - The SQL statementpublic String getSqlUserUpdate()
public void setSqlUserUpdate(String sql)
sql - The SQL statementpublic String getSqlUserSelect()
public void setSqlUserSelect(String sql)
sql - The SQL statementpublic String getSqlUserSelectAll()
public void setSqlUserSelectAll(String sql)
sql - The SQL statementpublic String getSqlUserAuthenticate()
public void setSqlUserAuthenticate(String sql)
sql - The SQL statementpublic String getSqlUserAdmin()
public void setSqlUserAdmin(String sql)
sql - The SQL statementpublic boolean isAdmin(String login) throws org.apache.ftpserver.ftplet.FtpException
isAdmin in interface org.apache.ftpserver.ftplet.UserManagerisAdmin in class AbstractUserManagerorg.apache.ftpserver.ftplet.FtpExceptionprotected Connection createConnection() throws SQLException
SQLExceptionpublic void delete(String name) throws org.apache.ftpserver.ftplet.FtpException
org.apache.ftpserver.ftplet.FtpExceptionpublic void save(org.apache.ftpserver.ftplet.User user)
throws org.apache.ftpserver.ftplet.FtpException
org.apache.ftpserver.ftplet.FtpExceptionprotected void closeQuitely(Connection con)
public org.apache.ftpserver.ftplet.User getUserByName(String name) throws org.apache.ftpserver.ftplet.FtpException
org.apache.ftpserver.ftplet.FtpExceptionpublic boolean doesExist(String name) throws org.apache.ftpserver.ftplet.FtpException
org.apache.ftpserver.ftplet.FtpExceptionpublic String[] getAllUserNames() throws org.apache.ftpserver.ftplet.FtpException
org.apache.ftpserver.ftplet.FtpExceptionpublic org.apache.ftpserver.ftplet.User authenticate(org.apache.ftpserver.ftplet.Authentication authentication)
throws org.apache.ftpserver.ftplet.AuthenticationFailedException
org.apache.ftpserver.ftplet.AuthenticationFailedExceptionCopyright © 2003–2017 The Apache Software Foundation. All rights reserved.