Interface UserProfileService

All Known Implementing Classes:
UserProfileServiceImpl

public interface UserProfileService
Service interface for managing user profiles within the application.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    deleteUser(jakarta.servlet.http.HttpServletRequest request)
    Deletes the currently authenticated user's profile.
    void
    deleteUserByEmail(jakarta.servlet.http.HttpServletRequest request, UUID userId)
    Deletes a user profile identified by their email.
    org.springframework.data.domain.Page<UserProfile>
    filterAndSortUsers(jakarta.servlet.http.HttpServletRequest request, org.springframework.data.domain.Pageable pageable)
    Filters and sorts user profiles based on the provided criteria.
    Generates an authentication token for the specified user profile.
    getUser(jakarta.servlet.http.HttpServletRequest request)
    Retrieves the user profile of the currently authenticated user.
    getUserById(jakarta.servlet.http.HttpServletRequest request, UUID userId)
    Retrieves a user profile by its unique identifier.
    getUsers(jakarta.servlet.http.HttpServletRequest request)
    Retrieves a list of all user profiles.
    void
    removeUserAvatar(jakarta.servlet.http.HttpServletRequest request)
    Removes the avatar image of the currently authenticated user.
    updateUser(jakarta.servlet.http.HttpServletRequest request, UserUpdateRequest userRequest)
    Updates the user profile with the provided information.
    void
    updateUserRole(jakarta.servlet.http.HttpServletRequest request, UUID userId)
    Updates the role of a user identified by their unique ID.
    updateUserSpecificCredentials(jakarta.servlet.http.HttpServletRequest request, UUID userId, @Valid AdminUpdateUserRequest userRequest)
    Updates specific credentials of a user identified by their unique ID.
    void
    updateUserStatus(jakarta.servlet.http.HttpServletRequest request, UUID userId)
    Updates the status of a user identified by their unique ID.
    void
    uploadUserAvatar(jakarta.servlet.http.HttpServletRequest request, org.springframework.web.multipart.MultipartFile userAvatar)
    Uploads an avatar image for the specified user.
    org.springframework.security.core.userdetails.UserDetailsService
    Retrieves the user details service associated with the user profiles.
  • Method Details

    • getUsers

      List<UserProfile> getUsers(jakarta.servlet.http.HttpServletRequest request)
      Retrieves a list of all user profiles.
      Parameters:
      request - the HTTP request containing context information
      Returns:
      a list of UserProfile objects representing all users
    • filterAndSortUsers

      org.springframework.data.domain.Page<UserProfile> filterAndSortUsers(jakarta.servlet.http.HttpServletRequest request, org.springframework.data.domain.Pageable pageable)
      Filters and sorts user profiles based on the provided criteria.
      Parameters:
      request - the HTTP request containing context information
      pageable - the pagination and sorting information
      Returns:
      a page of UserProfile objects that match the filter criteria
    • getUser

      UserProfile getUser(jakarta.servlet.http.HttpServletRequest request)
      Retrieves the user profile of the currently authenticated user.
      Parameters:
      request - the HTTP request containing context information
      Returns:
      the UserProfile object of the authenticated user
    • getUserById

      UserProfile getUserById(jakarta.servlet.http.HttpServletRequest request, UUID userId)
      Retrieves a user profile by its unique identifier.
      Parameters:
      request - the HTTP request containing context information
      userId - the unique identifier of the user
      Returns:
      the UserProfile object corresponding to the specified user ID
    • updateUser

      UserProfile updateUser(jakarta.servlet.http.HttpServletRequest request, UserUpdateRequest userRequest) throws Exception
      Updates the user profile with the provided information.
      Parameters:
      request - the HTTP request containing context information
      userRequest - the updated user profile data
      Returns:
      the updated UserProfile object
      Throws:
      Exception - if there is an error while updating the user profile
    • updateUserSpecificCredentials

      UserProfile updateUserSpecificCredentials(jakarta.servlet.http.HttpServletRequest request, UUID userId, @Valid @Valid AdminUpdateUserRequest userRequest)
      Updates specific credentials of a user identified by their unique ID.
      Parameters:
      request - the HTTP request containing context information
      userId - the unique identifier of the user
      userRequest - the updated specific user credentials
      Returns:
      the updated UserProfile object
    • uploadUserAvatar

      void uploadUserAvatar(jakarta.servlet.http.HttpServletRequest request, org.springframework.web.multipart.MultipartFile userAvatar)
      Uploads an avatar image for the specified user.
      Parameters:
      request - the HTTP request containing context information
      userAvatar - the image file to be uploaded as the user's avatar
    • removeUserAvatar

      void removeUserAvatar(jakarta.servlet.http.HttpServletRequest request)
      Removes the avatar image of the currently authenticated user.
      Parameters:
      request - the HTTP request containing context information
    • updateUserRole

      void updateUserRole(jakarta.servlet.http.HttpServletRequest request, UUID userId)
      Updates the role of a user identified by their unique ID.
      Parameters:
      request - the HTTP request containing context information
      userId - the unique identifier of the user
    • updateUserStatus

      void updateUserStatus(jakarta.servlet.http.HttpServletRequest request, UUID userId)
      Updates the status of a user identified by their unique ID.
      Parameters:
      request - the HTTP request containing context information
      userId - the unique identifier of the user
    • deleteUser

      void deleteUser(jakarta.servlet.http.HttpServletRequest request)
      Deletes the currently authenticated user's profile.
      Parameters:
      request - the HTTP request containing context information
    • deleteUserByEmail

      void deleteUserByEmail(jakarta.servlet.http.HttpServletRequest request, UUID userId)
      Deletes a user profile identified by their email.
      Parameters:
      request - the HTTP request containing context information
      userId - the unique identifier of the user to be deleted
    • userDetailsService

      org.springframework.security.core.userdetails.UserDetailsService userDetailsService()
      Retrieves the user details service associated with the user profiles.
      Returns:
      the UserDetailsService instance
    • generateToken

      String generateToken(UserProfile userProfile)
      Generates an authentication token for the specified user profile.
      Parameters:
      userProfile - the user profile for which the token is generated
      Returns:
      the generated token as a String