@Component(value="domainUserService") public class DomainUserServiceImpl extends Object implements DomainUserService
| Constructor and Description |
|---|
DomainUserServiceImpl(DomainControllerProperties properties,
DomainUserRepository domainUserRepository,
EmailService emailService,
DomainGroupRepository domainGroupRepository)
Instantiates a new domain user service.
|
| Modifier and Type | Method and Description |
|---|---|
org.bremersee.dccon.model.DomainUser |
addUser(org.bremersee.dccon.model.DomainUser domainUser,
Boolean sendEmail,
org.bremersee.common.model.TwoLetterLanguageCode language)
Add domain user.
|
Boolean |
deleteUser(@NotNull String userName)
Delete user.
|
Optional<org.bremersee.dccon.model.DomainUser> |
getUser(@NotNull String userName)
Get domain user.
|
Optional<byte[]> |
getUserAvatar(String userName,
org.bremersee.dccon.model.AvatarDefault avatarDefault,
Integer size)
Gets user avatar.
|
List<org.bremersee.dccon.model.DomainUser> |
getUsers(String sort,
String query)
Get domain users.
|
void |
resetData()
Reset data.
|
void |
setDomainUserValidator(DomainUserValidator domainUserValidator)
Sets domain user validator.
|
Optional<org.bremersee.dccon.model.DomainUser> |
updateUser(@NotNull String userName,
Boolean updateGroups,
@NotNull @Valid org.bremersee.dccon.model.DomainUser domainUser)
Update domain user.
|
void |
updateUserPassword(String userName,
org.bremersee.dccon.model.Password newPassword,
Boolean sendEmail,
org.bremersee.common.model.TwoLetterLanguageCode language)
Update user password.
|
Boolean |
userExists(@NotNull String userName)
Check whether user exists or not.
|
public DomainUserServiceImpl(DomainControllerProperties properties, DomainUserRepository domainUserRepository, EmailService emailService, DomainGroupRepository domainGroupRepository)
properties - the propertiesdomainUserRepository - the domain user repositoryemailService - the email servicedomainGroupRepository - the domain group repository@Autowired(required=false) public void setDomainUserValidator(DomainUserValidator domainUserValidator)
domainUserValidator - the domain user validatorpublic void resetData()
DomainUserServiceresetData in interface DomainUserServicepublic List<org.bremersee.dccon.model.DomainUser> getUsers(String sort, String query)
DomainUserServicegetUsers in interface DomainUserServicesort - the sort orderquery - the querypublic org.bremersee.dccon.model.DomainUser addUser(org.bremersee.dccon.model.DomainUser domainUser,
Boolean sendEmail,
org.bremersee.common.model.TwoLetterLanguageCode language)
DomainUserServiceaddUser in interface DomainUserServicedomainUser - the domain usersendEmail - specifies whether to send an email or not (default is false)language - the language of the emailpublic Optional<org.bremersee.dccon.model.DomainUser> getUser(@NotNull @NotNull String userName)
DomainUserServicegetUser in interface DomainUserServiceuserName - the user namepublic Optional<byte[]> getUserAvatar(String userName, org.bremersee.dccon.model.AvatarDefault avatarDefault, Integer size)
DomainUserServicegetUserAvatar in interface DomainUserServiceuserName - the user nameavatarDefault - the avatar defaultsize - the sizepublic Optional<org.bremersee.dccon.model.DomainUser> updateUser(@NotNull @NotNull String userName, Boolean updateGroups, @NotNull @Valid @NotNull @Valid org.bremersee.dccon.model.DomainUser domainUser)
DomainUserServiceupdateUser in interface DomainUserServiceuserName - the user nameupdateGroups - specifies whether the groups should also be updated or not (default is
false)domainUser - the domain userpublic void updateUserPassword(String userName, org.bremersee.dccon.model.Password newPassword, Boolean sendEmail, org.bremersee.common.model.TwoLetterLanguageCode language)
DomainUserServiceupdateUserPassword in interface DomainUserServiceuserName - the user namenewPassword - the new passwordsendEmail - specifies whether to send an email or not (default is false)language - the language of the emailpublic Boolean userExists(@NotNull @NotNull String userName)
DomainUserServiceuserExists in interface DomainUserServiceuserName - the user nametrue if the user exists, otherwise falsepublic Boolean deleteUser(@NotNull @NotNull String userName)
DomainUserServicedeleteUser in interface DomainUserServiceuserName - the user nametrue if the user was removed; false if the user didn't existCopyright © 2020 bremersee.org. All rights reserved.