Package org.openwms.core.uaa.impl
Class UserServiceImpl
java.lang.Object
org.openwms.core.uaa.impl.UserServiceImpl
- All Implemented Interfaces:
- org.ameba.integration.FindOperations<User,,- Long> - org.ameba.integration.SaveOperations<User,,- Long> - UserService
An UserServiceImpl is a Spring managed transactional implementation of the 
UserService. Using Spring 2 annotation support
 autowires collaborators, therefore XML configuration becomes obsolete. This class is marked with Amebas TxService annotation to
 benefit from Springs exception translation interceptor. Traditional CRUD operations are delegated to an UserRepository.
 This implementation exists since Spring 2.0.
- Author:
- Heiko Scherrer
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final org.springframework.security.crypto.password.PasswordEncoderprivate final org.springframework.context.ApplicationEventPublisherprivate static final org.slf4j.Loggerprivate final UserRepositoryprivate final RoleServiceprivate final GrantRepositoryprivate final Stringprivate final Stringprivate final org.ameba.i18n.Translatorprivate final UserMapperprivate final org.springframework.plugin.core.PluginRegistry<UserUpdater, String> private final jakarta.validation.Validator
- 
Constructor SummaryConstructorsConstructorDescriptionUserServiceImpl(UserRepository repository, GrantRepository securityObjectDao, RoleService roleService, org.springframework.security.crypto.password.PasswordEncoder enc, org.ameba.i18n.Translator translator, jakarta.validation.Validator validator, UserMapper userMapper, org.springframework.plugin.core.PluginRegistry<UserUpdater, String> userUpdater, org.springframework.context.ApplicationEventPublisher eventPublisher, String systemUsername, String systemPassword) 
- 
Method SummaryModifier and TypeMethodDescription@NotNull Usercreate(@NotNull(groups=Create.class) @Valid User user, List<String> roleNames) Create a non-existing User.@NotNull SystemUserCreate and return theSystemUserwithout persisting this user.voidDelete anUser.@NotNull Collection<User> findAll()@NotNull User@NotNull UserfindByPKey(@NotBlank String pKey) Find and return anUserinstance.private UserfindByPKeyInternal(String pKey) findByUsername(@NotBlank String username) Find and return anUserinstance.@NotNull Usersave(@NotNull(groups=Modify.class) @Valid User user, List<String> roleNames) Save or update an already existingUser.@NotNull Userprivate UsersaveInternal(User entity) @NotNull UserVOupdatePassword(@NotBlank String pKey, @NotNull CharSequence newPassword) Update the password of theUser.voiduploadImageFile(@NotBlank String pKey, @jakarta.validation.constraints.NotNull byte[] image) 
- 
Field Details- 
LOGGERprivate static final org.slf4j.Logger LOGGER
- 
repository
- 
securityObjectDao
- 
roleService
- 
encprivate final org.springframework.security.crypto.password.PasswordEncoder enc
- 
translatorprivate final org.ameba.i18n.Translator translator
- 
validatorprivate final jakarta.validation.Validator validator
- 
userMapper
- 
userUpdater
- 
eventPublisherprivate final org.springframework.context.ApplicationEventPublisher eventPublisher
- 
systemUsername
- 
systemPassword
 
- 
- 
Constructor Details- 
UserServiceImplUserServiceImpl(UserRepository repository, GrantRepository securityObjectDao, @Lazy RoleService roleService, org.springframework.security.crypto.password.PasswordEncoder enc, org.ameba.i18n.Translator translator, jakarta.validation.Validator validator, UserMapper userMapper, org.springframework.plugin.core.PluginRegistry<UserUpdater, String> userUpdater, org.springframework.context.ApplicationEventPublisher eventPublisher, @Value("${owms.security.system.username}") String systemUsername, @Value("${owms.security.system.password}") String systemPassword) 
 
- 
- 
Method Details- 
save@Validated(Modify.class) @Measured @NotNull public @NotNull User save(@NotNull(groups=Modify.class) @Valid @NotNull(groups=Modify.class) @Valid User user, List<String> roleNames) Save or update an already existingUser.- Specified by:
- savein interface- UserService
- Parameters:
- user- The instance to save
- roleNames- A list of Role names to assign the User to
- Returns:
- The saved instance
 
- 
uploadImageFile@Measured public void uploadImageFile(@NotBlank @NotBlank String pKey, @NotNull @jakarta.validation.constraints.NotNull byte[] image) - Specified by:
- uploadImageFilein interface- UserService
- Parameters:
- pKey- The persistent key of the User
- image- Image to be stored
 
- 
save
- 
saveInternal
- 
createSystemUserCreate and return theSystemUserwithout persisting this user.Marked as read-only transactional method. - Specified by:
- createSystemUserin interface- UserService
- Returns:
- the SystemUser instance
 
- 
create@Measured @Validated(Create.class) @NotNull public @NotNull User create(@NotNull(groups=Create.class) @Valid @NotNull(groups=Create.class) @Valid User user, List<String> roleNames) Create a non-existing User.- Specified by:
- createin interface- UserService
- Parameters:
- user- The User instance to create
- roleNames- A list of Role names to assign the User to
- Returns:
- The created instance
 
- 
findByUsername@Measured @NotNull public @NotNull Optional<User> findByUsername(@NotBlank @NotBlank String username) Find and return anUserinstance.- Specified by:
- findByUsernamein interface- UserService
- Parameters:
- username- The unique name of the User to search for
- Returns:
- The instance
 
- 
findByPKeyFind and return anUserinstance.- Specified by:
- findByPKeyin interface- UserService
- Parameters:
- pKey- The persistent identifier of the User to search for
- Returns:
- The instance
 
- 
findByPKeyInternal
- 
deleteDelete anUser.- Specified by:
- deletein interface- UserService
- Parameters:
- pKey- The identifiable persistent key
 
- 
updatePassword@Measured @NotNull public @NotNull UserVO updatePassword(@NotBlank @NotBlank String pKey, @NotNull @NotNull CharSequence newPassword) throws InvalidPasswordException Update the password of theUser.- Specified by:
- updatePasswordin interface- UserService
- Parameters:
- pKey- The identifiable persistent key
- newPassword- The new password
- Returns:
- The updated instance
- Throws:
- InvalidPasswordException
 
- 
findAll
- 
findById
 
-