Class CleanExpiredAuthorizationsUseCase

java.lang.Object
com.irurueta.authserver.authorization.application.tokens.CleanExpiredAuthorizationsUseCase

@Service @Transactional public class CleanExpiredAuthorizationsUseCase extends Object
Use case that deletes the authorizations whose tokens have all expired, and the abandoned ones: authorization or consent requests that never got a token and are older than a threshold.
  • Field Details

    • userAuthorizationRepository

      private final UserAuthorizationRepository userAuthorizationRepository
      Port that removes stored authorizations.
    • clock

      private final Clock clock
      Source of the current time.
    • abandonedAfter

      @Value("${authserver.tokens.cleanup.abandoned-after:P1D}") private final Duration abandonedAfter
      Age after which an authorization that never got a token is deleted (authserver.tokens.cleanup.abandoned-after, default 1 day).
  • Constructor Details

    • CleanExpiredAuthorizationsUseCase

      public CleanExpiredAuthorizationsUseCase()
  • Method Details

    • execute

      public int execute()
      Deletes the expired and the abandoned authorizations.
      Returns:
      the number of deleted authorizations.