Package org.powertac.visualizer.service
Class UserService
java.lang.Object
org.powertac.visualizer.service.UserService
@Service @Transactional public class UserService extends Object
Service class for managing users.
-
Constructor Summary
Constructors Constructor Description UserService(UserRepository userRepository, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder, PersistentTokenRepository persistentTokenRepository, AuthorityRepository authorityRepository) -
Method Summary
Modifier and Type Method Description voidchangePassword(String password)UsercreateUser(String login, String password, String firstName, String lastName, String langKey)UsercreateUser(UserDTO userDTO)voiddeleteUser(String login)org.springframework.data.domain.Page<UserDTO>getAllManagedUsers(org.springframework.data.domain.Pageable pageable)Optional<User>getUserByLogin(String login)UsergetUserWithAuthorities()UsergetUserWithAuthorities(Long id)Optional<User>getUserWithAuthoritiesByLogin(String login)voidremoveOldPersistentTokens()Persistent Token are used for providing automatic authentication, they should be automatically deleted after 30 days.voidupdateUser(String firstName, String lastName, String langKey)Update basic information (first name, last name, language) for the current user.Optional<UserDTO>updateUser(UserDTO userDTO)Update all information for a specific user, and return the modified user.
-
Constructor Details
-
UserService
public UserService(UserRepository userRepository, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder, PersistentTokenRepository persistentTokenRepository, AuthorityRepository authorityRepository)
-
-
Method Details
-
createUser
-
createUser
-
updateUser
Update basic information (first name, last name, language) for the current user. -
updateUser
Update all information for a specific user, and return the modified user. -
deleteUser
-
changePassword
-
getAllManagedUsers
@Transactional(readOnly=true) public org.springframework.data.domain.Page<UserDTO> getAllManagedUsers(org.springframework.data.domain.Pageable pageable) -
getUserByLogin
-
getUserWithAuthoritiesByLogin
-
getUserWithAuthorities
-
getUserWithAuthorities
-
removeOldPersistentTokens
@Scheduled(cron="0 0 0 * * ?") public void removeOldPersistentTokens()Persistent Token are used for providing automatic authentication, they should be automatically deleted after 30 days.This is scheduled to get fired everyday, at midnight.
-