Class UserManagementService

java.lang.Object
callofproject.dev.authentication.service.UserManagementService

@Service("callofproject.dev.authentication.service.usermanagement") @Lazy public class UserManagementService extends Object
Service class for managing users. It implements the IUserManagementService interface.
  • Constructor Details

    • UserManagementService

      public UserManagementService(@Qualifier("callofproject.dev.repository.authentication.dal.usermanagement") callofproject.dev.repository.authentication.dal.UserManagementServiceHelper serviceHelper, @Qualifier("callofproject.dev.authentication.mapper.MapperConfig") MapperConfiguration mapperConfig, KafkaProducer userProducer)
      Constructor for the UserManagementService class. It is used to inject dependencies into the service.
      Parameters:
      serviceHelper - The UserManagementServiceHelper object to be injected.
      mapperConfig - The MapperConfiguration object to be injected.
      userProducer - The KafkaProducer object to be injected.
  • Method Details

    • saveUser

      public callofproject.dev.data.common.clas.ResponseMessage<UserSaveDTO> saveUser(UserSignUpRequestDTO userDTO)
      Save User with given dto class.
      Parameters:
      userDTO - represent the dto class
      Returns:
      UserSaveDTO.
    • findUserByUsername

      public callofproject.dev.data.common.clas.ResponseMessage<UserDTO> findUserByUsername(String username)
      Find user with given username
      Parameters:
      username - represent the username.
      Returns:
      UserDTO class.
    • findUserByUsernameForAuthenticationService

      public UserResponseDTO<callofproject.dev.repository.authentication.entity.User> findUserByUsernameForAuthenticationService(String username)
      Find User with given username but returns the user entity.
      Parameters:
      username - represent the username.
      Returns:
      User class.
    • findAllUsersPageableByContainsWord

      public callofproject.dev.data.common.clas.MultipleResponseMessagePageable<Object> findAllUsersPageableByContainsWord(int page, String word)
      Find all users with given word and page.
      Parameters:
      page - represent the page.
      word - represent the containing word.
      Returns:
      UsersDTO class.
    • upsertUserProfile

      public callofproject.dev.data.common.clas.ResponseMessage<Object> upsertUserProfile(UserProfileUpdateDTO dto)
      Update user profile with given dto class.
      Parameters:
      dto - represent the dto class
      Returns:
      MessageResponseDTO.
    • findUserProfileByUserId

      public callofproject.dev.data.common.clas.ResponseMessage<Object> findUserProfileByUserId(UUID userId)
      Find user profile with given user id.
      Parameters:
      userId - represent the user id.
      Returns:
      UserProfileDTO class.
    • findUserProfileByUsername

      public callofproject.dev.data.common.clas.ResponseMessage<Object> findUserProfileByUsername(String username)
      Find user profile with given username.
      Parameters:
      username - represent the username.
      Returns:
      UserProfileDTO class.
    • findUserWithProfile

      public callofproject.dev.data.common.clas.ResponseMessage<Object> findUserWithProfile(UUID userId)
      Find user and his/her profile with given id.
      Parameters:
      userId - represent the user id.
      Returns:
      UserWithProfileDTO class.
    • saveUserCallback

      public callofproject.dev.data.common.clas.ResponseMessage<UserSaveDTO> saveUserCallback(UserSignUpRequestDTO userDTO)
      Save User with given dto class.
      Parameters:
      userDTO - represent the dto class
      Returns:
      UserSaveDTO.
    • findUserByUsernameCallback

      public callofproject.dev.data.common.clas.ResponseMessage<UserDTO> findUserByUsernameCallback(String username)
      Find user with given username
      Parameters:
      username - represent the username.
      Returns:
      UserDTO class.
    • findUserByUsernameForAuthenticationServiceCallback

      public UserResponseDTO<callofproject.dev.repository.authentication.entity.User> findUserByUsernameForAuthenticationServiceCallback(String username)
      Find User with given username but returns the user entity.
      Parameters:
      username - represent the username.
      Returns:
      User class.
    • findAllUsersPageableByContainsWordCallback

      public callofproject.dev.data.common.clas.MultipleResponseMessagePageable<Object> findAllUsersPageableByContainsWordCallback(int page, String word)
      Find all users with given word and page.
      Parameters:
      page - represent the page.
      word - represent the containing word.
      Returns:
      UsersDTO class.
    • getUserIfExists

      public callofproject.dev.repository.authentication.entity.User getUserIfExists(UUID userId)
      Get user with given user id.
      Parameters:
      userId - represent the user id.
      Returns:
      User class.
    • saveUsers

      public Iterable<callofproject.dev.repository.authentication.entity.User> saveUsers(List<UserSignUpRequestDTO> userDTOs) throws callofproject.dev.library.exception.service.DataServiceException
      Save Users with given dto class.
      Parameters:
      userDTOs - represent the dto class
      Returns:
      UserSaveDTO.
      Throws:
      callofproject.dev.library.exception.service.DataServiceException