Package org.keycloak.revoketokens.jpa
Enum Class RevokedTokenExpirationAction
java.lang.Object
java.lang.Enum<RevokedTokenExpirationAction>
org.keycloak.revoketokens.jpa.RevokedTokenExpirationAction
- All Implemented Interfaces:
Serializable,Comparable<RevokedTokenExpirationAction>,Constable,ExpirationAction
public enum RevokedTokenExpirationAction
extends Enum<RevokedTokenExpirationAction>
implements ExpirationAction
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionbooleanremoveExpired(KeycloakSession session, String realmId, int currentTime, int maxRemoval, IntConsumer removeCount) Removes expired entries from the database.static RevokedTokenExpirationActionReturns the enum constant of this class with the specified name.static RevokedTokenExpirationAction[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
removeExpired
public boolean removeExpired(KeycloakSession session, String realmId, int currentTime, int maxRemoval, IntConsumer removeCount) Description copied from interface:ExpirationActionRemoves expired entries from the database.This method is invoked inside a transaction. It should delete a batch of expired entries whose expiration time is at or before
currentTimeand report the number of removed rows viaremoveCount.- Specified by:
removeExpiredin interfaceExpirationAction- Parameters:
session- the current Keycloak session, valid for the duration of the enclosing transaction.realmId- the realm to clean up, ornullfor non-realm-aware expiration tasks.currentTime- the current time in seconds since epoch, used as the expiration threshold. This value is constant across all batches within a single task run.maxRemoval- the maximum number of entries to remove in this batch.removeCount- a consumer to report the number of entries removed in this batch.- Returns:
trueif there are more expired entries to remove (the framework will call this method again in a new transaction);falseif all expired entries have been removed.
-