Interface UserServiceInterface
- All Known Implementing Classes:
UserService
public interface UserServiceInterface
The UserServiceInterface is an interface that defines the methods that are available to perform operations on User entities.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addRoleToUser
(String username, String roleName) This method is used to add a Role to a User.This method is used to retrieve a User from the database by its username.getUsers()
This method is used to retrieve all User entities from the database.This method is used to save a Role entity to the database.This method is used to save a User entity to the database.
-
Method Details
-
saveUser
This method is used to save a User entity to the database.- Parameters:
user
- the User entity to be saved.- Returns:
- the saved User entity.
-
saveRole
This method is used to save a Role entity to the database.- Parameters:
role
- the Role entity to be saved.- Returns:
- the saved Role entity.
-
addRoleToUser
This method is used to add a Role to a User.- Parameters:
username
- the username of the User to which the Role is to be added.roleName
- the name of the Role to be added.
-
getUser
This method is used to retrieve a User from the database by its username.- Parameters:
username
- the username of the User to be retrieved.- Returns:
- the retrieved User entity.
-
getUsers
This method is used to retrieve all User entities from the database.- Returns:
- a List of all User entities.
-