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 Type
    Method
    Description
    void
    addRoleToUser(String username, String roleName)
    This method is used to add a Role to a User.
    getUser(String username)
    This method is used to retrieve a User from the database by its username.
    This method is used to retrieve all User entities from the database.
    saveRole(Role role)
    This method is used to save a Role entity to the database.
    saveUser(User user)
    This method is used to save a User entity to the database.
  • Method Details

    • saveUser

      User saveUser(User user)
      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

      Role saveRole(Role role)
      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

      void addRoleToUser(String username, String roleName)
      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

      User getUser(String username)
      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

      List<User> getUsers()
      This method is used to retrieve all User entities from the database.
      Returns:
      a List of all User entities.