Interface UserManager
- All Known Implementing Classes:
SimpleUserManager
public interface UserManager
Allows to manipulate user accounts in system without checking permission access.
Usage of this manager is preferable to
UserDetailsManager
because it works on StandardUser
instead of UserDetails
.-
Method Summary
Modifier and TypeMethodDescriptioncreateUser
(StandardUser user) Create a new user with the supplied details.void
deleteUser
(String username) Remove the user with the given login name from the system.Get user for provided idGet user with provided usernamevoid
updatePassword
(long id, String newPassword) Change password of user with provided id.void
updatePassword
(String username, String newPassword) Change password of user with provided username.void
updateUser
(StandardUser user) Update the specified user.boolean
userExists
(Long id) Check if a user with the supplied id exists in the system.boolean
userExists
(String username) Check if a user with the supplied login name exists in the system.
-
Method Details
-
createUser
Create a new user with the supplied details.- Parameters:
user
- full details of user to create- Returns:
- id of created user
- Throws:
UserManagementException
-
updateUser
Update the specified user. It gets user by username. Note: password is not updated in this method even if provided. UseupdatePassword(String, String)
- Parameters:
user
- full details of user to update- Throws:
UserManagementException
-
updatePassword
Change password of user with provided username.- Parameters:
username
- username of user for password changenewPassword
- not encrypted password- Throws:
UserManagementException
-
updatePassword
Change password of user with provided id.- Parameters:
id
- id of user for password changenewPassword
- not encrypted password- Throws:
UserManagementException
-
getUser
Get user with provided username- Parameters:
username
- username of user- Returns:
- application user with provided username of null
- Throws:
UserManagementException
-
getUser
Get user for provided id- Parameters:
id
- id of user- Returns:
- application user for provided id
- Throws:
UserManagementException
-
deleteUser
Remove the user with the given login name from the system.- Parameters:
username
- username of user to remove- Throws:
UserManagementException
-
userExists
Check if a user with the supplied login name exists in the system.- Parameters:
username
- username to check- Returns:
- true if user exists, false otherwise
-
userExists
Check if a user with the supplied id exists in the system.- Parameters:
id
- id to check- Returns:
- true if user exists, false otherwise
-