Package org.nentangso.core.service
Class NtsUserService
- java.lang.Object
-
- org.nentangso.core.service.NtsUserService
-
@Service @Transactional @ConditionalOnMissingBean(name="userService") public class NtsUserService extends Object
Service class for managing users.
-
-
Constructor Summary
Constructors Constructor Description NtsUserService(NtsUserRepository userRepository, NtsAuthorityRepository authorityRepository, NtsUserMapper userMapper, org.springframework.cache.CacheManager cacheManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.data.domain.Page<NtsAdminUserDTO>getAllManagedUsers(org.springframework.data.domain.Pageable pageable)org.springframework.data.domain.Page<NtsUserDTO>getAllPublicUsers(org.springframework.data.domain.Pageable pageable)List<String>getAuthorities()Gets a list of all the authorities.NtsAdminUserDTOgetUserFromAuthentication(org.springframework.security.authentication.AbstractAuthenticationToken authToken)Returns the user from an OAuth 2.0 login or resource server with JWT.Optional<NtsUserEntity>getUserWithAuthoritiesByLogin(String login)voidupdateUser(String firstName, String lastName, String email, String langKey, String imageUrl)Update basic information (first name, last name, email, language) for the current user.
-
-
-
Constructor Detail
-
NtsUserService
public NtsUserService(NtsUserRepository userRepository, NtsAuthorityRepository authorityRepository, NtsUserMapper userMapper, org.springframework.cache.CacheManager cacheManager)
-
-
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.
-
-