java.lang.Object
tr.com.havelsan.javarch.oauth.jpa.data.provider.module.user.manager.HvlOAuthUserManagerImpl
All Implemented Interfaces:
HvlOAuthUserManager

@Service @Transactional(readOnly=true) public class HvlOAuthUserManagerImpl extends Object implements HvlOAuthUserManager
The class which implements HvlOAuthUserManager.
  • Constructor Details

  • 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 query
      userDetailQuery - 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 interface HvlOAuthUserManager
      Parameters:
      username - the username
      Returns:
      the long
    • getById

      public HvlOAuthUserModel getById(@NotNull @NotNull Long id)
      Gets user by id.
      Specified by:
      getById in interface HvlOAuthUserManager
      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 interface HvlOAuthUserManager
      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 interface HvlOAuthUserManager
      Parameters:
      username - the username
      Returns:
      the user model
    • getByEmail

      public HvlOAuthUserModel getByEmail(@NotBlank @Size(max=100) @NotBlank @Size(max=100) String email)
      Gets user by email.
      Specified by:
      getByEmail in interface HvlOAuthUserManager
      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 interface HvlOAuthUserManager
      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 interface HvlOAuthUserManager
      Parameters:
      username - the username
      tenant - 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 interface HvlOAuthUserManager
      Parameters:
      username - the username
      tenant - 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 interface HvlOAuthUserManager
      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 interface HvlOAuthUserManager
      Parameters:
      username - the username
      Returns:
      the password by user
    • getTenantByUsername

      public String getTenantByUsername(@NotBlank @Size(max=50) @NotBlank @Size(max=50) String username)
      Gets tenant identifier by username.
      Specified by:
      getTenantByUsername in interface HvlOAuthUserManager
      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 interface HvlOAuthUserManager
      Parameters:
      id - the id
      password - 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 interface HvlOAuthUserManager
      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 interface HvlOAuthUserManager
      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 interface HvlOAuthUserManager
      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 interface HvlOAuthUserManager
      Parameters:
      userClaimQueryModel - the user claim query model
      Returns:
      the user claim data model page