Package org.keycloak.expiration.jpa.impl
Class RealmAwareExpirationTask
java.lang.Object
org.keycloak.expiration.jpa.impl.RealmAwareExpirationTask
- All Implemented Interfaces:
Runnable,ExpirationTask
An
ExpirationTask that runs cleanup per realm.
On each run, this task fetches the list of realms, removes orphan coordination keys (from deleted realms), and then
iterates over each realm. Per-realm coordination via ServerConfigStorageProvider ensures that a cleanup is
skipped if another node ran one recently for the same realm.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ExpirationActionprotected final Stringprotected final KeycloakSessionFactoryprotected final intprotected final ExpirationListenerprotected static final org.jboss.logging.Loggerprotected final int -
Constructor Summary
ConstructorsConstructorDescriptionRealmAwareExpirationTask(KeycloakSessionFactory factory, Executor executor, ExpirationAction action, ExpirationListener listener, String entityId, int transactionTimeoutSeconds, int intervalSeconds, int maxRemoval) -
Method Summary
Modifier and TypeMethodDescriptionprotected static OutcomecomputeOutcome(boolean success, boolean failed) final voidrun()voidschedule()Registers this task with theTimerProviderto run periodically at the configured interval.
-
Field Details
-
logger
protected static final org.jboss.logging.Logger logger -
factory
-
entityId
-
intervalSeconds
protected final int intervalSeconds -
maxRemoval
protected final int maxRemoval -
action
-
listener
-
-
Constructor Details
-
RealmAwareExpirationTask
public RealmAwareExpirationTask(KeycloakSessionFactory factory, Executor executor, ExpirationAction action, ExpirationListener listener, String entityId, int transactionTimeoutSeconds, int intervalSeconds, int maxRemoval)
-
-
Method Details
-
run
public final void run() -
schedule
public void schedule()Description copied from interface:ExpirationTaskRegisters this task with theTimerProviderto run periodically at the configured interval.- Specified by:
schedulein interfaceExpirationTask
-
computeOutcome
-