Class NtsUserService


  • @Service
    @Transactional
    @ConditionalOnMissingBean(name="userService")
    public class NtsUserService
    extends Object
    Service class for managing users.
    • Method Detail

      • updateUser

        public void updateUser​(String firstName,
                               String lastName,
                               String email,
                               String langKey,
                               String imageUrl)
        Update basic information (first name, last name, email, language) for the current user.
        Parameters:
        firstName - first name of user.
        lastName - last name of user.
        email - email id of user.
        langKey - language key.
        imageUrl - image URL of user.
      • getAllManagedUsers

        @Transactional(readOnly=true)
        public org.springframework.data.domain.Page<NtsAdminUserDTO> getAllManagedUsers​(org.springframework.data.domain.Pageable pageable)
      • getAllPublicUsers

        @Transactional(readOnly=true)
        public org.springframework.data.domain.Page<NtsUserDTO> getAllPublicUsers​(org.springframework.data.domain.Pageable pageable)
      • getUserWithAuthoritiesByLogin

        @Transactional(readOnly=true)
        public Optional<NtsUserEntity> getUserWithAuthoritiesByLogin​(String login)
      • getAuthorities

        @Transactional(readOnly=true)
        public List<String> getAuthorities()
        Gets a list of all the authorities.
        Returns:
        a list of all the authorities.
      • getUserFromAuthentication

        @Transactional
        public NtsAdminUserDTO getUserFromAuthentication​(org.springframework.security.authentication.AbstractAuthenticationToken authToken)
        Returns the user from an OAuth 2.0 login or resource server with JWT. Synchronizes the user in the local repository.
        Parameters:
        authToken - the authentication token.
        Returns:
        the user from the authentication.