Class CleanExpiredAuthorizationsUseCase
java.lang.Object
com.irurueta.authserver.authorization.application.tokens.CleanExpiredAuthorizationsUseCase
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final DurationAge after which an authorization that never got a token is deleted (authserver.tokens.cleanup.abandoned-after, default 1 day).private final ClockSource of the current time.private final UserAuthorizationRepositoryPort that removes stored authorizations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintexecute()Deletes the expired and the abandoned authorizations.
-
Field Details
-
userAuthorizationRepository
Port that removes stored authorizations. -
clock
Source of the current time. -
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.
-