Interface ExpirableEntity

All Superinterfaces:
AbstractEntity
All Known Subinterfaces:
MapAdminEventEntity, MapAuthenticatedClientSessionEntity, MapAuthEventEntity, MapClientInitialAccessEntity, MapRootAuthenticationSessionEntity, MapSingleUseObjectEntity, MapUserSessionEntity
All Known Implementing Classes:
HotRodAdminEventEntity.AbstractHotRodAdminEventEntityDelegate, HotRodAdminEventEntityDelegate, HotRodAuthenticatedClientSessionEntity.AbstractHotRodAuthenticatedClientSessionEntityDelegate, HotRodAuthenticatedClientSessionEntityDelegate, HotRodAuthEventEntity.AbstractHotRodAuthEventEntityDelegate, HotRodAuthEventEntityDelegate, HotRodClientInitialAccessEntityDelegate, HotRodRootAuthenticationSessionEntity.AbstractHotRodRootAuthenticationSessionEntityDelegate, HotRodRootAuthenticationSessionEntityDelegate, HotRodSingleUseObjectEntity.AbstractHotRodSingleUseObjectEntityDelegate, HotRodSingleUseObjectEntityDelegate, HotRodUserSessionEntity.AbstractHotRodUserSessionEntityDelegate, HotRodUserSessionEntityDelegate, JpaAdminEventEntity, JpaAdminEventMetadata, JpaAuthEventEntity, JpaAuthEventMetadata, JpaClientSessionEntity, JpaClientSessionMetadata, JpaRootAuthenticationSessionEntity, JpaRootAuthenticationSessionMetadata, JpaSingleUseObjectEntity, JpaSingleUseObjectMetadata, JpaUserSessionEntity, JpaUserSessionMetadata, MapAdminEventEntity.AbstractAdminEventEntity, MapAdminEventEntityDelegate, MapAdminEventEntityFieldDelegate, MapAdminEventEntityImpl, MapAdminEventEntityImpl.Empty, MapAuthenticatedClientSessionEntity.AbstractAuthenticatedClientSessionEntity, MapAuthenticatedClientSessionEntityDelegate, MapAuthenticatedClientSessionEntityFieldDelegate, MapAuthenticatedClientSessionEntityImpl, MapAuthenticatedClientSessionEntityImpl.Empty, MapAuthEventEntity.AbstractAuthEventEntity, MapAuthEventEntityDelegate, MapAuthEventEntityFieldDelegate, MapAuthEventEntityImpl, MapAuthEventEntityImpl.Empty, MapClientInitialAccessEntityDelegate, MapClientInitialAccessEntityFieldDelegate, MapClientInitialAccessEntityImpl, MapClientInitialAccessEntityImpl.Empty, MapRootAuthenticationSessionEntity.AbstractRootAuthenticationSessionEntity, MapRootAuthenticationSessionEntityDelegate, MapRootAuthenticationSessionEntityFieldDelegate, MapRootAuthenticationSessionEntityImpl, MapRootAuthenticationSessionEntityImpl.Empty, MapSingleUseObjectEntity.AbstractSingleUseObjectEntity, MapSingleUseObjectEntityDelegate, MapSingleUseObjectEntityFieldDelegate, MapSingleUseObjectEntityImpl, MapSingleUseObjectEntityImpl.Empty, MapUserSessionEntity.AbstractUserSessionEntity, MapUserSessionEntityDelegate, MapUserSessionEntityFieldDelegate, MapUserSessionEntityImpl, MapUserSessionEntityImpl.Empty

public interface ExpirableEntity extends AbstractEntity
This interface provides a way for marking entities that can expire. For example, user sessions are valid only for certain amount of time. After that time the entities can be removed from storage/omitted from query results. Presence of expired entities in the storage should be transparent to layers above the physical one. This can be achieved in more ways. Ideal solution is when expired entities never reach Keycloak codebase, however, this may not be possible for all storage implementations, therefore, we need to double-check entities validity before they reach logical layer, for example, before we turn entity into model. Implementation of actual removal of the entities from the storage is responsibility of each storage individually.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a point in the time (timestamp in milliseconds since The Epoch) when this entity expires.
    void
    setExpiration(Long expiration)
    Sets a point in the time (timestamp in milliseconds since The Epoch) when this entity expires.

    Methods inherited from interface org.keycloak.models.map.common.AbstractEntity

    getId, setId
  • Method Details

    • getExpiration

      Long getExpiration()
      Returns a point in the time (timestamp in milliseconds since The Epoch) when this entity expires.
      Returns:
      a timestamp in milliseconds since The Epoch or null if this entity never expires or expiration is not known.
    • setExpiration

      void setExpiration(Long expiration)
      Sets a point in the time (timestamp in milliseconds since The Epoch) when this entity expires.
      Parameters:
      expiration - a timestamp in milliseconds since The Epoch or null if this entity never expires.