Class HvlOAuthUserManagerImpl
java.lang.Object
tr.com.havelsan.javarch.oauth.jpa.data.provider.module.user.manager.HvlOAuthUserManagerImpl
- All Implemented Interfaces:
HvlOAuthUserManager
The class which implements
HvlOAuthUserManager
.-
Constructor Summary
ConstructorDescriptionHvlOAuthUserManagerImpl
(HvlOAuthUserQueryGenerator userQueryGenerator, HvlOAuthUserClaimTrustedProxyQueryGenerator userClaimTrustedProxyQueryGenerator, HvlOAuthUserRepository userRepository, HvlOAuthUserMapper userMapper, HvlOAuthUserWithoutDetailMapper userWithoutDetailMapper) Instantiates a new HvlOAuthUserManager. -
Method Summary
Modifier and TypeMethodDescriptionfindIdByUsernameOrElseThrow
(@NotBlank @Size(max=50) String username) Find id by username or else throw long.getByEmail
(@NotBlank @Size(max=100) String email) Gets user by email.Gets user by id.getByIntegrationCode
(@NotBlank @Size(max=20) String integrationCode) Gets user by integration code.getByUsername
(@NotBlank @Size(max=50) String username) Gets user by username.getByUsernameAndTenant
(@NotBlank @Size(max=50) String username, @NotBlank @Size(max=100) String tenant) Gets user by username and tenant.getByUsernameAndTenantWithoutDetail
(@NotBlank @Size(max=50) String username, @NotBlank @Size(max=100) String tenant) Gets user by username and tenant without detail.getByUsernameWithoutDetail
(@NotBlank @Size(max=50) String username) Gets user by username without detail.Gets user by uuid.getPasswordByUsername
(@NotBlank @Size(max=50) String username) Gets password by username.getTenantByUsername
(@NotBlank @Size(max=50) String username) Gets tenant identifier by username.boolean
isExistsByIdAndPassword
(@NotNull Long id, @NotBlank @Size(max=100) String password) Exists user by id and password.boolean
isExistsByUserDetailUuid
(@NotBlank @Size(min=36,max=36) String uuid) Exists user by user detail uuid.static List
<tr.com.havelsan.javarch.data.jpa.query.expression.HvlJoinExpression> prepareLeftJoinForUserDetail
(HvlOAuthUserQuery userQuery) Prepare left join for user detail.static List
<com.querydsl.core.types.Expression<?>> Prepare select expression for user data model.static com.querydsl.core.types.QBean
<HvlOAuthUserClaimDataModel> prepareUserClaimDataProjection
(HvlOAuthUserQuery userQuery, HvlOAuthUserDetailQuery userDetailQuery) Prepare user claim data projection q bean.tr.com.havelsan.javarch.data.commons.pageable.HvlPage
<HvlOAuthUserClaimDataModel> queryClaimDataPage
(@NotNull @Valid HvlOAuthUserClaimQueryModel userClaimQueryModel) Returns a page of user claim for assigned entity relation matching the query criteria.queryList
(@NotNull @Valid HvlOAuthUserQueryModel userQueryModel) Returns a list of user matching the query criteria.tr.com.havelsan.javarch.data.commons.pageable.HvlPage
<HvlOAuthUserDataModel> queryPage
(@NotNull @Valid HvlOAuthUserQueryModel userQueryModel) Returns a page of user matching the query criteria.
-
Constructor Details
-
HvlOAuthUserManagerImpl
public HvlOAuthUserManagerImpl(HvlOAuthUserQueryGenerator userQueryGenerator, HvlOAuthUserClaimTrustedProxyQueryGenerator userClaimTrustedProxyQueryGenerator, HvlOAuthUserRepository userRepository, HvlOAuthUserMapper userMapper, HvlOAuthUserWithoutDetailMapper userWithoutDetailMapper) Instantiates a new HvlOAuthUserManager.- Parameters:
userQueryGenerator
- the user query generatoruserClaimTrustedProxyQueryGenerator
- the user claim trusted proxy query generatoruserRepository
- the user repositoryuserMapper
- the user mapperuserWithoutDetailMapper
- the user without detail mapper
-
-
Method Details
-
prepareSelectClauseForUserDataModel
public static List<com.querydsl.core.types.Expression<?>> prepareSelectClauseForUserDataModel(HvlOAuthUserQuery userQuery) Prepare select expression for user data model.- Parameters:
userQuery
- the user query- Returns:
- the select expressions
-
prepareLeftJoinForUserDetail
public static List<tr.com.havelsan.javarch.data.jpa.query.expression.HvlJoinExpression> prepareLeftJoinForUserDetail(HvlOAuthUserQuery userQuery) Prepare left join for user detail.- Parameters:
userQuery
- the user query- Returns:
- the left join list
-
prepareUserClaimDataProjection
public static com.querydsl.core.types.QBean<HvlOAuthUserClaimDataModel> prepareUserClaimDataProjection(HvlOAuthUserQuery userQuery, HvlOAuthUserDetailQuery userDetailQuery) Prepare user claim data projection q bean.- Parameters:
userQuery
- the user queryuserDetailQuery
- the user detail query- Returns:
- the q bean
-
findIdByUsernameOrElseThrow
public Long findIdByUsernameOrElseThrow(@NotBlank @Size(max=50) @NotBlank @Size(max=50) String username) Find id by username or else throw long.- Specified by:
findIdByUsernameOrElseThrow
in interfaceHvlOAuthUserManager
- Parameters:
username
- the username- Returns:
- the long
-
getById
Gets user by id.- Specified by:
getById
in interfaceHvlOAuthUserManager
- Parameters:
id
- the id- Returns:
- the user model
-
getByUuid
@Cacheable(value="user::uuid", unless="#result == null") public HvlOAuthUserModel getByUuid(@NotBlank @Size(min=36,max=36) @NotBlank @Size(min=36,max=36) String uuid) Gets user by uuid.- Specified by:
getByUuid
in interfaceHvlOAuthUserManager
- Parameters:
uuid
- the uuid- Returns:
- the user model
-
getByUsername
@Cacheable(value="user::username", unless="#result == null") public HvlOAuthUserModel getByUsername(@NotBlank @Size(max=50) @NotBlank @Size(max=50) String username) Gets user by username.- Specified by:
getByUsername
in interfaceHvlOAuthUserManager
- Parameters:
username
- the username- Returns:
- the user model
-
getByEmail
Gets user by email.- Specified by:
getByEmail
in interfaceHvlOAuthUserManager
- Parameters:
email
- the email- Returns:
- the user model
-
getByUsernameWithoutDetail
@Cacheable(value="user::username_without_detail", unless="#result == null") public HvlOAuthUserModel getByUsernameWithoutDetail(@NotBlank @Size(max=50) @NotBlank @Size(max=50) String username) Gets user by username without detail.- Specified by:
getByUsernameWithoutDetail
in interfaceHvlOAuthUserManager
- Parameters:
username
- the username- Returns:
- the user model
-
getByUsernameAndTenant
public HvlOAuthUserModel getByUsernameAndTenant(@NotBlank @Size(max=50) @NotBlank @Size(max=50) String username, @NotBlank @Size(max=100) @NotBlank @Size(max=100) String tenant) Gets user by username and tenant.- Specified by:
getByUsernameAndTenant
in interfaceHvlOAuthUserManager
- Parameters:
username
- the usernametenant
- the tenant- Returns:
- the user
-
getByUsernameAndTenantWithoutDetail
public HvlOAuthUserModel getByUsernameAndTenantWithoutDetail(@NotBlank @Size(max=50) @NotBlank @Size(max=50) String username, @NotBlank @Size(max=100) @NotBlank @Size(max=100) String tenant) Gets user by username and tenant without detail.- Specified by:
getByUsernameAndTenantWithoutDetail
in interfaceHvlOAuthUserManager
- Parameters:
username
- the usernametenant
- the tenant- Returns:
- the user
-
getByIntegrationCode
@Cacheable(value="user::integration_code", unless="#result == null") public HvlOAuthUserModel getByIntegrationCode(@NotBlank @Size(max=20) @NotBlank @Size(max=20) String integrationCode) Gets user by integration code.- Specified by:
getByIntegrationCode
in interfaceHvlOAuthUserManager
- Parameters:
integrationCode
- the integration code- Returns:
- the user
-
getPasswordByUsername
public String getPasswordByUsername(@NotBlank @Size(max=50) @NotBlank @Size(max=50) String username) Gets password by username.- Specified by:
getPasswordByUsername
in interfaceHvlOAuthUserManager
- Parameters:
username
- the username- Returns:
- the password by user
-
getTenantByUsername
Gets tenant identifier by username.- Specified by:
getTenantByUsername
in interfaceHvlOAuthUserManager
- Parameters:
username
- the username- Returns:
- the tenant identifier
-
isExistsByIdAndPassword
public boolean isExistsByIdAndPassword(@NotNull @NotNull Long id, @NotBlank @Size(max=100) @NotBlank @Size(max=100) String password) Exists user by id and password.- Specified by:
isExistsByIdAndPassword
in interfaceHvlOAuthUserManager
- Parameters:
id
- the idpassword
- the password- Returns:
- the boolean
-
isExistsByUserDetailUuid
public boolean isExistsByUserDetailUuid(@NotBlank @Size(min=36,max=36) @NotBlank @Size(min=36,max=36) String uuid) Exists user by user detail uuid.- Specified by:
isExistsByUserDetailUuid
in interfaceHvlOAuthUserManager
- Parameters:
uuid
- the uuid- Returns:
- the boolean
-
queryList
public List<HvlOAuthUserModel> queryList(@NotNull @Valid @NotNull @Valid HvlOAuthUserQueryModel userQueryModel) Returns a list of user matching the query criteria.- Specified by:
queryList
in interfaceHvlOAuthUserManager
- Parameters:
userQueryModel
- the user query model- Returns:
- the list of user model
-
queryPage
public tr.com.havelsan.javarch.data.commons.pageable.HvlPage<HvlOAuthUserDataModel> queryPage(@NotNull @Valid @NotNull @Valid HvlOAuthUserQueryModel userQueryModel) Returns a page of user matching the query criteria.- Specified by:
queryPage
in interfaceHvlOAuthUserManager
- Parameters:
userQueryModel
- the user query model- Returns:
- the page of user model
-
queryClaimDataPage
public tr.com.havelsan.javarch.data.commons.pageable.HvlPage<HvlOAuthUserClaimDataModel> queryClaimDataPage(@NotNull @Valid @NotNull @Valid HvlOAuthUserClaimQueryModel userClaimQueryModel) Returns a page of user claim for assigned entity relation matching the query criteria.- Specified by:
queryClaimDataPage
in interfaceHvlOAuthUserManager
- Parameters:
userClaimQueryModel
- the user claim query model- Returns:
- the user claim data model page
-