Package org.nentangso.core.service
Class NtsUserService
- java.lang.Object
-
- org.nentangso.core.service.NtsUserService
-
@Service @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)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description reactor.core.publisher.Mono<Long>countManagedUsers()reactor.core.publisher.Flux<NtsAdminUserDTO>getAllManagedUsers(org.springframework.data.domain.Pageable pageable)reactor.core.publisher.Flux<NtsUserDTO>getAllPublicUsers(org.springframework.data.domain.Pageable pageable)reactor.core.publisher.Flux<String>getAuthorities()Gets a list of all the authorities.reactor.core.publisher.Mono<NtsAdminUserDTO>getUserFromAuthentication(org.springframework.security.authentication.AbstractAuthenticationToken authToken)Returns the user from an OAuth 2.0 login or resource server with JWT.reactor.core.publisher.Mono<NtsUserEntity>getUserWithAuthoritiesByLogin(String login)reactor.core.publisher.Mono<NtsUserEntity>saveUser(NtsUserEntity user)reactor.core.publisher.Mono<NtsUserEntity>saveUser(NtsUserEntity user, boolean forceCreate)reactor.core.publisher.Mono<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.
-
-
-
Constructor Detail
-
NtsUserService
public NtsUserService(NtsUserRepository userRepository, NtsAuthorityRepository authorityRepository, NtsUserMapper userMapper)
-
-
Method Detail
-
updateUser
@Transactional public reactor.core.publisher.Mono<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.- Returns:
- a completed
Mono.
-
saveUser
@Transactional public reactor.core.publisher.Mono<NtsUserEntity> saveUser(NtsUserEntity user)
-
saveUser
@Transactional public reactor.core.publisher.Mono<NtsUserEntity> saveUser(NtsUserEntity user, boolean forceCreate)
-
getAllManagedUsers
@Transactional(readOnly=true) public reactor.core.publisher.Flux<NtsAdminUserDTO> getAllManagedUsers(org.springframework.data.domain.Pageable pageable)
-
getAllPublicUsers
@Transactional(readOnly=true) public reactor.core.publisher.Flux<NtsUserDTO> getAllPublicUsers(org.springframework.data.domain.Pageable pageable)
-
countManagedUsers
@Transactional(readOnly=true) public reactor.core.publisher.Mono<Long> countManagedUsers()
-
getUserWithAuthoritiesByLogin
@Transactional(readOnly=true) public reactor.core.publisher.Mono<NtsUserEntity> getUserWithAuthoritiesByLogin(String login)
-
getAuthorities
@Transactional(readOnly=true) public reactor.core.publisher.Flux<String> getAuthorities()
Gets a list of all the authorities.- Returns:
- a list of all the authorities.
-
getUserFromAuthentication
@Transactional public reactor.core.publisher.Mono<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.
-
-