Interface UserManager

All Known Implementing Classes:
AbstractDatabaseUserRepository, DatabaseUserRepository

public interface UserManager
Interface provides API for some actions with users
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    changePassword(String userName, String oldPassword, String newPassword)
    Changes the password for the specific user and saves changes to the database immediately.
    org.springframework.security.core.userdetails.UserDetails
    changePassword(String userName, String oldPassword, String newPassword, boolean saveChanges)
    Changes the password for the specific user.
    default Map<org.springframework.security.core.userdetails.UserDetails,String>
    resetPasswords(Set<org.springframework.security.core.userdetails.UserDetails> users)
    Generates new passwords for passed users and saves changes to the database immediately.
    Map<org.springframework.security.core.userdetails.UserDetails,String>
    resetPasswords(Set<org.springframework.security.core.userdetails.UserDetails> users, boolean saveChanges)
    Generates new passwords for passed users.
    void
    resetRememberMe(Collection<org.springframework.security.core.userdetails.UserDetails> users)
    Resets 'remember me' token for the specific user.
  • Method Details

    • changePassword

      default void changePassword(String userName, @Nullable String oldPassword, @Nullable String newPassword) throws PasswordNotMatchException
      Changes the password for the specific user and saves changes to the database immediately.
      Parameters:
      userName - user login
      oldPassword - non-encoded old user password
      newPassword - non-encoded new user password
      Throws:
      PasswordNotMatchException - if the oldPassword is not null and the oldPassword does not equal to the current password or if the oldPassword is null and the newPassword does equal the current password
    • changePassword

      org.springframework.security.core.userdetails.UserDetails changePassword(String userName, @Nullable String oldPassword, @Nullable String newPassword, boolean saveChanges) throws PasswordNotMatchException
      Changes the password for the specific user.
      Parameters:
      userName - users login
      oldPassword - non-encoded old user password
      newPassword - non-encoded new user password
      saveChanges - whether to save changes to the database
      Throws:
      PasswordNotMatchException - if the oldPassword is not null and the oldPassword does not equal to the current password or if the oldPassword is null and the newPassword does equal the current password
    • resetPasswords

      default Map<org.springframework.security.core.userdetails.UserDetails,String> resetPasswords(Set<org.springframework.security.core.userdetails.UserDetails> users)
      Generates new passwords for passed users and saves changes to the database immediately.
      Parameters:
      users - users which need reset passwords
      Returns:
      map which contains new passwords for the passed users
    • resetPasswords

      Map<org.springframework.security.core.userdetails.UserDetails,String> resetPasswords(Set<org.springframework.security.core.userdetails.UserDetails> users, boolean saveChanges)
      Generates new passwords for passed users.
      Parameters:
      users - users which need reset passwords
      saveChanges - whether to save changes to the database
      Returns:
      map which contains new passwords for the passed users
    • resetRememberMe

      void resetRememberMe(Collection<org.springframework.security.core.userdetails.UserDetails> users)
      Resets 'remember me' token for the specific user.
      Parameters:
      users - - users which need reset 'remember me' token