Interface UserManager


public interface UserManager
User manager interface.
Author:
Apache MINA Project
  • Field Details

  • Method Details

    • getUserByName

      User getUserByName(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

      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(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.
      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.
      UnsupportedOperationException - if UserManager in read-only mode
    • doesExist

      boolean doesExist(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 - If we got an error during the check
    • authenticate

      User authenticate(Authentication authentication) throws AuthenticationFailedException
      Authenticate user
      Parameters:
      authentication - The Authentication that proves the users identity
      Returns:
      the authenticated account.
      Throws:
      AuthenticationFailedException - If the authentication failed
    • getAdminName

      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(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.