Class HvlOAuthUserOperationalManagerImpl
java.lang.Object
tr.com.havelsan.javarch.oauth.jpa.data.provider.module.user.manager.HvlOAuthUserOperationalManagerImpl
- All Implemented Interfaces:
HvlOAuthUserOperationalManager
@Service
public class HvlOAuthUserOperationalManagerImpl
extends Object
implements HvlOAuthUserOperationalManager
The class which implements
HvlOAuthUserOperationalManager
.-
Constructor Summary
ConstructorDescriptionHvlOAuthUserOperationalManagerImpl
(HvlOAuthUserPersistQueryGenerator userPersistQueryGenerator, HvlOAuthUserPersistRepository userPersistRepository, HvlOAuthUserOldPasswordRepository oAuthUserOldPasswordRepository, HvlOAuthUserManager userManager, HvlOAuthProfileOperationalManager profileOperationalManager, HvlOAuthTrustedProxyOperationalManager trustedProxyOperationalManager, HvlOAuthUserPersistMapper userPersistMapper, HvlOAuthUserPasswordProvider userPasswordProvider, tr.com.havelsan.javarch.cache.core.manager.HvlCacheManager cacheManager, HvlOAuthUserPasswordPolicyManager userPasswordPolicyManager) Instantiates a new HvlOAuthUserManager. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Active password must be change all user.void
changePasswordByAdmin
(@NotNull Long id, @NotBlank @Size(max=100) String password, boolean passwordMustBeChanged) Change password by admin.deleteByUuid
(@NotBlank @Size(min=36,max=36) String uuid) Delete user by uuid.lock
(@NotNull @Valid HvlOAuthUserLockModel userLockModel) Lock user.save
(@NotNull @Valid HvlOAuthUserModel userModel, @NotNull HvlOAuthUserRegistrationSourceType userRegistrationSourceType) Save user.saveWithPredefinedValues
(@NotNull @Valid HvlOAuthUserModel userModel, @NotNull HvlOAuthUserRegistrationSourceType userRegistrationSourceType) saveWithPredefinedValues is a method which is used to add new user data with predefined values which can be defined by administrator.void
Unlock user.update
(@NotNull @Valid HvlOAuthUserModel userModel, Consumer<Set<String>> affectedUsersAction) Update user.void
updateUserFailedCountAndLockedDate
(@NotBlank @Size(max=50) String username, Integer failedCount, OffsetDateTime lockedDate) Update user password.void
updateUserPassword
(@NotBlank @Size(max=50) String username, @NotBlank @Size(max=100) String newPassword) Update user password.void
updateUserPassword
(@NotBlank @Size(max=50) String username, @NotBlank @Size(max=100) String oldPassword, @NotBlank @Size(max=100) String newPassword) Update user password.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface tr.com.havelsan.javarch.oauth.jpa.data.provider.module.user.manager.HvlOAuthUserOperationalManager
changePasswordByAdmin, save, saveWithPredefinedValues
-
Constructor Details
-
HvlOAuthUserOperationalManagerImpl
public HvlOAuthUserOperationalManagerImpl(HvlOAuthUserPersistQueryGenerator userPersistQueryGenerator, HvlOAuthUserPersistRepository userPersistRepository, HvlOAuthUserOldPasswordRepository oAuthUserOldPasswordRepository, HvlOAuthUserManager userManager, HvlOAuthProfileOperationalManager profileOperationalManager, HvlOAuthTrustedProxyOperationalManager trustedProxyOperationalManager, HvlOAuthUserPersistMapper userPersistMapper, HvlOAuthUserPasswordProvider userPasswordProvider, tr.com.havelsan.javarch.cache.core.manager.HvlCacheManager cacheManager, HvlOAuthUserPasswordPolicyManager userPasswordPolicyManager) Instantiates a new HvlOAuthUserManager.- Parameters:
userPersistQueryGenerator
- the user persist query generatoruserPersistRepository
- the user persist repositoryoAuthUserOldPasswordRepository
- the o auth user old password repositoryuserManager
- the user managerprofileOperationalManager
- the profile operational managertrustedProxyOperationalManager
- the trusted proxy operational manageruserPersistMapper
- the user persist mapperuserPasswordProvider
- the user password providercacheManager
- the cache manageruserPasswordPolicyManager
- the user password policy manager
-
-
Method Details
-
save
public HvlOAuthUserModel save(@NotNull @Valid @NotNull @Valid HvlOAuthUserModel userModel, @NotNull @NotNull HvlOAuthUserRegistrationSourceType userRegistrationSourceType) Save user.- Specified by:
save
in interfaceHvlOAuthUserOperationalManager
- Parameters:
userModel
- the user modeluserRegistrationSourceType
- the user registration source type- Returns:
- the user model
-
saveWithPredefinedValues
public HvlOAuthUserModel saveWithPredefinedValues(@NotNull @Valid @NotNull @Valid HvlOAuthUserModel userModel, @NotNull @NotNull HvlOAuthUserRegistrationSourceType userRegistrationSourceType) saveWithPredefinedValues is a method which is used to add new user data with predefined values which can be defined by administrator. For example, If there is a record for user type of user trying to be added matching with predefined role, system would create a profile authorized with this predefined roles for this user.- Specified by:
saveWithPredefinedValues
in interfaceHvlOAuthUserOperationalManager
- Parameters:
userModel
- the user modeluserRegistrationSourceType
- the user registration source type- Returns:
- the user model
-
update
@Validated(tr.com.havelsan.javarch.data.commons.validation.HvlConstraintGroups.ModifyingOperation.class) @CacheEvict(value={"user::uuid","user::username","user::integration_code"}, allEntries=true) public HvlOAuthUserModel update(@NotNull @Valid @NotNull @Valid HvlOAuthUserModel userModel, Consumer<Set<String>> affectedUsersAction) Update user.- Specified by:
update
in interfaceHvlOAuthUserOperationalManager
- Parameters:
userModel
- the user modelaffectedUsersAction
- the affected users action- Returns:
- the user model
-
updateUserPassword
@CacheEvict(value={"user::uuid","user::username","user::integration_code"}, allEntries=true) public void updateUserPassword(@NotBlank @Size(max=50) @NotBlank @Size(max=50) String username, @NotBlank @Size(max=100) @NotBlank @Size(max=100) String newPassword) Update user password.- Specified by:
updateUserPassword
in interfaceHvlOAuthUserOperationalManager
- Parameters:
username
- the usernamenewPassword
- the new password
-
updateUserPassword
@CacheEvict(value={"user::uuid","user::username","user::integration_code"}, allEntries=true) public void updateUserPassword(@NotBlank @Size(max=50) @NotBlank @Size(max=50) String username, @NotBlank @Size(max=100) @NotBlank @Size(max=100) String oldPassword, @NotBlank @Size(max=100) @NotBlank @Size(max=100) String newPassword) Update user password.- Specified by:
updateUserPassword
in interfaceHvlOAuthUserOperationalManager
- Parameters:
username
- the usernameoldPassword
- the old passwordnewPassword
- the new password
-
updateUserFailedCountAndLockedDate
@CacheEvict(value={"user::uuid","user::username","user::integration_code"}, allEntries=true) public void updateUserFailedCountAndLockedDate(@NotBlank @Size(max=50) @NotBlank @Size(max=50) String username, Integer failedCount, OffsetDateTime lockedDate) Update user password.- Specified by:
updateUserFailedCountAndLockedDate
in interfaceHvlOAuthUserOperationalManager
- Parameters:
username
- the usernamefailedCount
- the failed countlockedDate
- the locked date
-
deleteByUuid
@CacheEvict(value={"user::uuid","user::username","user::integration_code"}, allEntries=true) public String deleteByUuid(@NotBlank @Size(min=36,max=36) @NotBlank @Size(min=36,max=36) String uuid) Delete user by uuid.- Specified by:
deleteByUuid
in interfaceHvlOAuthUserOperationalManager
- Parameters:
uuid
- the uuid- Returns:
- the username
-
changePasswordByAdmin
@CacheEvict(value={"user::uuid","user::username","user::integration_code"}, allEntries=true) public void changePasswordByAdmin(@NotNull @NotNull Long id, @NotBlank @Size(max=100) @NotBlank @Size(max=100) String password, boolean passwordMustBeChanged) Change password by admin.- Specified by:
changePasswordByAdmin
in interfaceHvlOAuthUserOperationalManager
- Parameters:
id
- the idpassword
- the passwordpasswordMustBeChanged
- the password must be changed
-
lock
@CacheEvict(value={"user::uuid","user::username","user::integration_code"}, allEntries=true) public String lock(@NotNull @Valid @NotNull @Valid HvlOAuthUserLockModel userLockModel) Lock user.- Specified by:
lock
in interfaceHvlOAuthUserOperationalManager
- Parameters:
userLockModel
- the userLockModel- Returns:
- the string
-
unlock
@CacheEvict(value={"user::uuid","user::username","user::integration_code"}, allEntries=true) public void unlock(@NotBlank @Size(min=36,max=36) @NotBlank @Size(min=36,max=36) String uuid) Unlock user.- Specified by:
unlock
in interfaceHvlOAuthUserOperationalManager
- Parameters:
uuid
- the uuid
-
activePasswordMustBeChangeAllUser
@CacheEvict(value={"user::username_without_detail","user::uuid","user::username","user::integration_code"}, allEntries=true) public void activePasswordMustBeChangeAllUser()Active password must be change all user.- Specified by:
activePasswordMustBeChangeAllUser
in interfaceHvlOAuthUserOperationalManager
-