Package org.apache.ftpserver.ftplet
Interface UserManager
public interface UserManager
User manager interface.
- Author:
- Apache MINA Project
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(Authentication authentication) Authenticate uservoidDelete the user from the system.booleanCheck if the user exists.Get admin user nameString[]Get all user names in the system.getUserByName(String username) Get user by name.booleanCheck if the user is admin.voidSave user.
-
Field Details
-
ANONYMOUS
The anonymous user- See Also:
-
-
Method Details
-
getUserByName
Get user by name.- Parameters:
username- the name to search for.- Returns:
- the user with the specified name, or null if a such user does not exist.
- Throws:
FtpException- when the UserManager can't fulfill the request.
-
getAllUserNames
Get all user names in the system.- Returns:
- an array of username strings, note that the result should never be null, if there is no users the result is an empty array.
- Throws:
FtpException- when the UserManager can't fulfill the request.
-
delete
Delete the user from the system.- Parameters:
username- The name of theUserto delete- Throws:
FtpException- when the UserManager can't fulfill the request.UnsupportedOperationException- if UserManager in read-only mode
-
save
Save user. If a new user, create it else update the existing user.- Parameters:
user- the Uset to save- Throws:
FtpException- when the UserManager can't fulfill the request.UnsupportedOperationException- if UserManager in read-only mode
-
doesExist
Check if the user exists.- Parameters:
username- the name of the user to check.- Returns:
trueif the user exist,falseotherwise.- Throws:
FtpException- If we got an error during the check
-
authenticate
Authenticate user- Parameters:
authentication- TheAuthenticationthat proves the users identity- Returns:
- the authenticated account.
- Throws:
AuthenticationFailedException- If the authentication failed
-
getAdminName
Get admin user name- Returns:
- the admin user name
- Throws:
FtpException- when the UserManager can't fulfill the request.
-
isAdmin
Check if the user is admin.- Parameters:
username- The name of theUserto check- Returns:
trueif user with this login is administrator- Throws:
FtpException- when the UserManager can't fulfill the request.
-