Class RealmAwareExpirationTask

java.lang.Object
org.keycloak.expiration.jpa.impl.RealmAwareExpirationTask
All Implemented Interfaces:
Runnable, ExpirationTask

public class RealmAwareExpirationTask extends Object
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 Details

    • logger

      protected static final org.jboss.logging.Logger logger
    • factory

      protected final KeycloakSessionFactory factory
    • entityId

      protected final String entityId
    • intervalSeconds

      protected final int intervalSeconds
    • maxRemoval

      protected final int maxRemoval
    • action

      protected final ExpirationAction action
    • listener

      protected final ExpirationListener listener
  • Constructor Details

  • Method Details

    • run

      public final void run()
      Specified by:
      run in interface Runnable
    • schedule

      public void schedule()
      Description copied from interface: ExpirationTask
      Registers this task with the TimerProvider to run periodically at the configured interval.
      Specified by:
      schedule in interface ExpirationTask
    • computeOutcome

      protected static Outcome computeOutcome(boolean success, boolean failed)