?? usermanager.java
字號:
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE file.
*/
package server.ftp.usermanager;
import java.util.Collection;
import server.ftp.FtpConfig;
/**
* This is the base class of all the user manager classes.
* If we want to add a new user manager, we have to override
* this class.
*
* @author <a href="mailto:rana_b@yahoo.com">Rana Bhattacharyya</a>
*/
public
abstract class UserManager {
protected FtpConfig mConfig;
protected String mstAdminName;
/**
* Constrcutor
*/
public UserManager(FtpConfig cfg) {
mConfig = cfg;
mstAdminName = cfg.getProperty(FtpConfig.PREFIX + "admin", "admin");
}
/**
* Save the user. If a new user, create it else update the
* existing user.
*/
public abstract void save(User user) throws Exception;
/**
* Delete the user from the system.
*
* @param name name of the user to be deleted.
*/
public abstract void delete(String userName) throws Exception;
/**
* Get user by name.
*/
public abstract User getUserByName(String name);
/**
* Get all user names in the system.
*/
public abstract Collection getAllUserNames();
/**
* User existance check.
*
* @param name user name
*/
public abstract boolean doesExist(String name);
/**
* Authenticate user
*/
public abstract boolean authenticate(String login, String password);
/**
* Load the user data again
*/
public void reload() throws Exception {
}
/**
* Close the user manager - dummy method.
*/
public void dispose() {
}
/**
* Get config
*/
public FtpConfig getConfig() {
return mConfig;
}
/**
* Get admin name
*/
public String getAdminName() {
return mstAdminName;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -