Class SessionTimeouts

java.lang.Object
org.keycloak.models.sessions.infinispan.util.SessionTimeouts

public class SessionTimeouts extends Object
Author:
Marek Posolda
  • Field Details

    • ENTRY_EXPIRED_FLAG

      public static final long ENTRY_EXPIRED_FLAG
      This indicates that entry is already expired and should be removed from the cache
      See Also:
    • MINIMAL_EXPIRATION_SEC

      public static final int MINIMAL_EXPIRATION_SEC
      This is used just if timeouts are not set on the realm (usually happens just during tests when realm is created manually with the model API)
      See Also:
  • Constructor Details

    • SessionTimeouts

      public SessionTimeouts()
  • Method Details

    • getUserSessionLifespanMs

      public static long getUserSessionLifespanMs(RealmModel realm, ClientModel client, UserSessionEntity userSessionEntity)
      Get the maximum lifespan, which this userSession can remain in the infinispan cache. Returned value will be used as "lifespan" when calling put/replace operation in the infinispan cache for this entity
      Parameters:
      realm -
      client -
      userSessionEntity -
      Returns:
    • getUserSessionMaxIdleMs

      public static long getUserSessionMaxIdleMs(RealmModel realm, ClientModel client, UserSessionEntity userSessionEntity)
      Get the maximum idle time for this userSession. Returned value will be used when as "maxIdleTime" when calling put/replace operation in the infinispan cache for this entity
      Parameters:
      realm -
      client -
      userSessionEntity -
      Returns:
    • getClientSessionLifespanMs

      public static long getClientSessionLifespanMs(RealmModel realm, ClientModel client, AuthenticatedClientSessionEntity clientSessionEntity)
      Get the maximum lifespan, which this clientSession can remain in the infinispan cache. Returned value will be used as "lifespan" when calling put/replace operation in the infinispan cache for this entity
      Parameters:
      realm -
      client -
      clientSessionEntity -
      Returns:
    • getClientSessionMaxIdleMs

      public static long getClientSessionMaxIdleMs(RealmModel realm, ClientModel client, AuthenticatedClientSessionEntity clientSessionEntity)
      Get the maxIdle, which this clientSession will use. Returned value will be used as "maxIdle" when calling put/replace operation in the infinispan cache for this entity
      Parameters:
      realm -
      client -
      clientSessionEntity -
      Returns:
    • getOfflineSessionLifespanMs

      public static long getOfflineSessionLifespanMs(RealmModel realm, ClientModel client, UserSessionEntity userSessionEntity)
      Get the maximum lifespan, which this offline userSession can remain in the infinispan cache. Returned value will be used as "lifespan" when calling put/replace operation in the infinispan cache for this entity
      Parameters:
      realm -
      client -
      userSessionEntity -
      Returns:
    • getOfflineSessionMaxIdleMs

      public static long getOfflineSessionMaxIdleMs(RealmModel realm, ClientModel client, UserSessionEntity userSessionEntity)
      Get the maximum idle time for this offline userSession. Returned value will be used when as "maxIdleTime" when calling put/replace operation in the infinispan cache for this entity
      Parameters:
      realm -
      client -
      userSessionEntity -
      Returns:
    • getOfflineClientSessionLifespanMs

      public static long getOfflineClientSessionLifespanMs(RealmModel realm, ClientModel client, AuthenticatedClientSessionEntity authenticatedClientSessionEntity)
      Get the maximum lifespan, which this offline clientSession can remain in the infinispan cache. Returned value will be used as "lifespan" when calling put/replace operation in the infinispan cache for this entity
      Parameters:
      realm -
      client -
      authenticatedClientSessionEntity -
      Returns:
    • getOfflineClientSessionMaxIdleMs

      public static long getOfflineClientSessionMaxIdleMs(RealmModel realm, ClientModel client, AuthenticatedClientSessionEntity authenticatedClientSessionEntity)
      Get the maxIdle, which this offline clientSession will use. Returned value will be used as "maxIdle" when calling put/replace operation in the infinispan cache for this entity
      Parameters:
      realm -
      client -
      authenticatedClientSessionEntity -
      Returns:
    • getLoginFailuresLifespanMs

      public static long getLoginFailuresLifespanMs(RealmModel realm, ClientModel client, LoginFailureEntity loginFailureEntity)
      Not using lifespan for detached login failure (backwards compatibility with the background cleaner threads, which were used for cleanup of detached login failures)
      Parameters:
      realm -
      client -
      loginFailureEntity -
      Returns:
    • getLoginFailuresMaxIdleMs

      public static long getLoginFailuresMaxIdleMs(RealmModel realm, ClientModel client, LoginFailureEntity loginFailureEntity)
      Not using maxIdle for detached login failure (backwards compatibility with the background cleaner threads, which were used for cleanup of detached login failures)
      Parameters:
      realm -
      client -
      loginFailureEntity -
      Returns: