org.apache.ftpserver.ftplet
Interface UserManager

All Known Implementing Classes:
AbstractUserManager, DbUserManager, PropertiesUserManager

public interface UserManager

User manager interface.

Version:
$Rev: 711368 $, $Date: 2008-11-04 21:02:43 +0100 (Tue, 04 Nov 2008) $
Author:
The Apache MINA Project (dev@mina.apache.org)

Method Summary
 User authenticate(Authentication authentication)
          Authenticate user
 void delete(java.lang.String username)
          Delete the user from the system.
 boolean doesExist(java.lang.String username)
          Check if the user exists.
 java.lang.String getAdminName()
          Get admin user name
 java.lang.String[] getAllUserNames()
          Get all user names in the system.
 User getUserByName(java.lang.String username)
          Get user by name.
 boolean isAdmin(java.lang.String username)
          Check if the user is admin.
 void save(User user)
          Save user.
 

Method Detail

getUserByName

User getUserByName(java.lang.String username)
                   throws FtpException
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

java.lang.String[] getAllUserNames()
                                   throws FtpException
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

void delete(java.lang.String username)
            throws FtpException
Delete the user from the system.

Parameters:
username - The name of the User to delete
Throws:
FtpException - when the UserManager can't fulfill the request.
java.lang.UnsupportedOperationException - if UserManager in read-only mode

save

void save(User user)
          throws FtpException
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.
java.lang.UnsupportedOperationException - if UserManager in read-only mode

doesExist

boolean doesExist(java.lang.String username)
                  throws FtpException
Check if the user exists.

Parameters:
username - the name of the user to check.
Returns:
true if the user exist, false otherwise.
Throws:
FtpException

authenticate

User authenticate(Authentication authentication)
                  throws AuthenticationFailedException
Authenticate user

Parameters:
authentication - The Authentication that proves the users identity
Returns:
the authenticated account.
Throws:
AuthenticationFailedException
FtpException - when the UserManager can't fulfill the request.

getAdminName

java.lang.String getAdminName()
                              throws FtpException
Get admin user name

Returns:
the admin user name
Throws:
FtpException - when the UserManager can't fulfill the request.

isAdmin

boolean isAdmin(java.lang.String username)
                throws FtpException
Check if the user is admin.

Parameters:
username - The name of the User to check
Returns:
true if user with this login is administrator
Throws:
FtpException - when the UserManager can't fulfill the request.


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