Class JdbcPhoneVerificationRepository

java.lang.Object
com.irurueta.authserver.authorization.infrastructure.persistence.sms.JdbcPhoneVerificationRepository
All Implemented Interfaces:
PhoneVerificationRepository

@Repository public class JdbcPhoneVerificationRepository extends Object implements PhoneVerificationRepository
PhoneVerificationRepository over the pending_* columns of the user_phones table. It opens no transaction: clearing a verification and then deleting an empty row runs in the caller's.
  • Field Details

    • UPSERT

      private static final String UPSERT
      Statement storing the pending verification of a user, creating the row if needed.
      See Also:
    • FIND_BY_USER

      private static final String FIND_BY_USER
      Query returning the pending verification of a user.
      See Also:
    • INCREMENT_ATTEMPTS

      private static final String INCREMENT_ATTEMPTS
      Statement counting a failed attempt atomically and returning the new count.
      See Also:
    • CLEAR_PENDING

      private static final String CLEAR_PENDING
      Statement clearing the pending columns of a user.
      See Also:
    • DELETE_IF_EMPTY

      private static final String DELETE_IF_EMPTY
      Statement deleting the row of a user that holds neither a verified phone nor a pending verification.
      See Also:
    • CLEAR_EXPIRED

      private static final String CLEAR_EXPIRED
      Statement clearing every expired pending verification.
      See Also:
    • DELETE_EMPTY_ROWS

      private static final String DELETE_EMPTY_ROWS
      Statement deleting the rows that hold nothing at all.
      See Also:
    • jdbcClient

      private final org.springframework.jdbc.core.simple.JdbcClient jdbcClient
      JDBC client used to run the statements.
    • phoneVerificationRowMapper

      private final PhoneVerificationRowMapper phoneVerificationRowMapper
      Maps a row to a verification.
  • Constructor Details

    • JdbcPhoneVerificationRepository

      public JdbcPhoneVerificationRepository()
  • Method Details