java.lang.Object
com.irurueta.authserver.authorization.application.ott.CleanupOttUseCase

@Service @Transactional public class CleanupOttUseCase extends Object
Deletes what the one-time-code and SMS features leave behind: expired codes, expired pending phone verifications, cost ledger rows older than the retention and expired magic-link tokens.
  • Field Details

    • oneTimeCodeRepository

      private final OneTimeCodeRepository oneTimeCodeRepository
      Port that stores the codes.
    • phoneVerificationRepository

      private final PhoneVerificationRepository phoneVerificationRepository
      Port that stores the pending phone verifications.
    • smsCostLedgerRepository

      private final SmsCostLedgerRepository smsCostLedgerRepository
      Port that stores the SMS spend.
    • expiredLinkTokenPurger

      private final ExpiredLinkTokenPurger expiredLinkTokenPurger
      Port that removes the expired magic-link tokens.
    • smsProperties

      private final SmsProperties smsProperties
      SMS settings, for the retention of the ledger.
    • clock

      private final Clock clock
      Source of the current time.
  • Constructor Details

    • CleanupOttUseCase

      public CleanupOttUseCase()
  • Method Details

    • execute

      public OttCleanupResult execute()
      Runs the cleanup.
      Returns:
      the number of rows removed from each store.