Class UserAccountRefreshTokenDao

java.lang.Object
ru.cg.webbpm.modules.security.api.impl.dao.jooq.BaseDao<UserAccountRefreshTokenRecord,Object>
ru.cg.webbpm.modules.security.api.impl.dao.jooq.UserAccountRefreshTokenDao

@Repository public class UserAccountRefreshTokenDao extends BaseDao<UserAccountRefreshTokenRecord,Object>
Author:
latypov
  • Constructor Details

    • UserAccountRefreshTokenDao

      public UserAccountRefreshTokenDao()
  • Method Details

    • createRecordMapper

      protected org.jooq.RecordMapper<UserAccountRefreshTokenRecord,Object> createRecordMapper()
      Specified by:
      createRecordMapper in class BaseDao<UserAccountRefreshTokenRecord,Object>
    • createUserRefreshToken

      public void createUserRefreshToken(String userAccountRefreshTokenId, String userAccountId, String refreshToken, String accessToken, Timestamp expirationTime)
      Inserts new refresh token by passed parameters.
      Parameters:
      userAccountRefreshTokenId - userAccountRefreshTokenId of String type to set user_account_refresh_token_id column value.
      userAccountId - userAccountId of String type to set user_account_id column value.
      refreshToken - refreshToken of String type to set refresh_token column value.
      accessToken - accessToken of String type to set access_token column value.
      expirationTime - expirationTime of Timestamp to set expiration_time column value.
    • cleanupRefreshTokenByExpirationTime

      public void cleanupRefreshTokenByExpirationTime(Timestamp nowTimestamp)
      Removes refresh token which expiration_time column value less than passed timestamp.
      Parameters:
      nowTimestamp - nowTimestamp of Timestamp to indicates time value.
    • countRefreshTokenForUserAccountId

      public Integer countRefreshTokenForUserAccountId(String userAccountId)
      Get count value of refresh token for passed user account id.
      Parameters:
      userAccountId - user account id of String type.
      Returns:
      count num of Integer type.
    • deleteOutdatedRefreshTokensForUserAccountId

      public void deleteOutdatedRefreshTokensForUserAccountId(String userAccountId, int toKeep)
      Removes outdated refresh tokens table.
      Parameters:
      userAccountId - user account id of String type.
      toKeep - limit value of Integer type.
    • deleteRefreshTokensForAccessToken

      public void deleteRefreshTokensForAccessToken(String accessToken)
      Removes refresh token by passed access token.
      Parameters:
      accessToken - access token value of String type.
    • deleteRefreshTokensForUserAccountId

      public void deleteRefreshTokensForUserAccountId(String userAccountId)
      Removes refresh token by passed user account id.
      Parameters:
      userAccountId - user account id of String type.
    • updateRefreshToken

      public void updateRefreshToken(String userAccountId, String token, String oldToken, Timestamp expirationTime, String accessToken)
      Updates refresh token according to passed parameters.
      Parameters:
      userAccountId - user account id of String type.
      token - new refresh token value of String type.
      oldToken - old refresh token value of String type.
      expirationTime - Expiration timestamp value of Timestamp type.
      accessToken - access token value of String type.
    • refreshTokenForUserAccountIdExists

      public boolean refreshTokenForUserAccountIdExists(String userAccountId, String refreshToken)
      Checks for the presence of a refresh token for a passed user account id record.
      Parameters:
      userAccountId - user account id value of String type.
      refreshToken - refresh token value of String type.
      Returns:
      boolean value according to result of method. Value of Boolean type.