Class JpaUserSessionEntity
- java.lang.Object
- 
- org.keycloak.models.map.common.UpdatableEntity.Impl
- 
- org.keycloak.models.map.userSession.MapUserSessionEntity.AbstractUserSessionEntity
- 
- org.keycloak.models.map.storage.jpa.userSession.entity.JpaUserSessionEntity
 
 
 
- 
- All Implemented Interfaces:
- Serializable,- AbstractEntity,- ExpirableEntity,- UpdatableEntity,- JpaRootEntity,- JpaRootVersionedEntity,- MapUserSessionEntity
 
 @Entity public class JpaUserSessionEntity extends MapUserSessionEntity.AbstractUserSessionEntity implements JpaRootVersionedEntity There are some fields marked by@Column(insertable = false, updatable = false). Those fields are automatically generated by database from json field, therefore marked as non-insertable and non-updatable to instruct hibernate.- See Also:
- Serialized Form
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.keycloak.models.map.userSession.MapUserSessionEntityMapUserSessionEntity.AbstractUserSessionEntity
 - 
Nested classes/interfaces inherited from interface org.keycloak.models.map.common.UpdatableEntityUpdatableEntity.Impl
 
- 
 - 
Field Summary- 
Fields inherited from class org.keycloak.models.map.common.UpdatableEntity.Implupdated
 
- 
 - 
Constructor SummaryConstructors Constructor Description JpaUserSessionEntity()No-argument constructor, used by hibernate to instantiate entities.JpaUserSessionEntity(DeepCloner cloner)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAuthenticatedClientSession(MapAuthenticatedClientSessionEntity clientSession)voidclearAuthenticatedClientSessions()booleanequals(Object obj)Optional<MapAuthenticatedClientSessionEntity>getAuthenticatedClientSession(String clientUUID)Set<MapAuthenticatedClientSessionEntity>getAuthenticatedClientSessions()StringgetAuthMethod()StringgetBrokerSessionId()StringgetBrokerUserId()IntegergetCurrentSchemaVersion()IntegergetEntityVersion()LonggetExpiration()Returns a point in the time (timestamp in milliseconds since The Epoch) when this entity expires.StringgetId()StringgetIpAddress()LonggetLastSessionRefresh()Returns a point in time (timestamp in milliseconds since The Epoch) when the user session entity was last refreshed.StringgetLoginUsername()StringgetNote(String name)Map<String,String>getNotes()UserSessionModel.SessionPersistenceStategetPersistenceState()StringgetRealmId()UserSessionModel.StategetState()LonggetTimestamp()Returns a point in time (timestamp in milliseconds since The Epoch) when the user session entity was created.StringgetUserId()intgetVersion()Version of the JPA entity used for optimistic lockinginthashCode()booleanisMetadataInitialized()BooleanisOffline()BooleanisRememberMe()BooleanremoveAuthenticatedClientSession(String clientUUID)BooleanremoveNote(String name)voidsetAuthMethod(String authMethod)voidsetBrokerSessionId(String brokerSessionId)voidsetBrokerUserId(String brokerUserId)voidsetEntityVersion(Integer entityVersion)voidsetExpiration(Long expiration)Sets a point in the time (timestamp in milliseconds since The Epoch) when this entity expires.voidsetId(String id)voidsetIpAddress(String ipAddress)voidsetLastSessionRefresh(Long lastSessionRefresh)Sets a point in the (timestamp in milliseconds since The Epoch) when the user session entity was last refreshed.voidsetLoginUsername(String loginUsername)voidsetNote(String name, String value)voidsetNotes(Map<String,String> notes)voidsetOffline(Boolean offline)voidsetPersistenceState(UserSessionModel.SessionPersistenceState persistenceState)voidsetRealmId(String realmId)voidsetRememberMe(Boolean rememberMe)voidsetState(UserSessionModel.State state)voidsetTimestamp(Long timestamp)Sets a point in the (timestamp in milliseconds since The Epoch) when the user session entity was created.voidsetUserId(String userId)- 
Methods inherited from class org.keycloak.models.map.userSession.MapUserSessionEntity.AbstractUserSessionEntityclearUpdatedFlag, isUpdated
 - 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.keycloak.models.map.storage.jpa.JpaRootEntityupdateEntityVersion
 
- 
 
- 
- 
- 
Constructor Detail- 
JpaUserSessionEntitypublic JpaUserSessionEntity() No-argument constructor, used by hibernate to instantiate entities.
 - 
JpaUserSessionEntitypublic JpaUserSessionEntity(DeepCloner cloner) 
 
- 
 - 
Method Detail- 
isMetadataInitializedpublic boolean isMetadataInitialized() 
 - 
getEntityVersionpublic Integer getEntityVersion() - Specified by:
- getEntityVersionin interface- JpaRootEntity
- Returns:
- current supported version of the JPA entity used for schema versioning.
 
 - 
setEntityVersionpublic void setEntityVersion(Integer entityVersion) - Specified by:
- setEntityVersionin interface- JpaRootEntity
- Parameters:
- entityVersion- sets current supported version to JPA entity.
 
 - 
getCurrentSchemaVersionpublic Integer getCurrentSchemaVersion() - Specified by:
- getCurrentSchemaVersionin interface- JpaRootEntity
 
 - 
getVersionpublic int getVersion() Description copied from interface:JpaRootVersionedEntityVersion of the JPA entity used for optimistic locking- Specified by:
- getVersionin interface- JpaRootVersionedEntity
 
 - 
getIdpublic String getId() - Specified by:
- getIdin interface- AbstractEntity
- Overrides:
- getIdin class- MapUserSessionEntity.AbstractUserSessionEntity
 
 - 
setIdpublic void setId(String id) - Specified by:
- setIdin interface- AbstractEntity
- Overrides:
- setIdin class- MapUserSessionEntity.AbstractUserSessionEntity
 
 - 
getRealmIdpublic String getRealmId() - Specified by:
- getRealmIdin interface- MapUserSessionEntity
 
 - 
setRealmIdpublic void setRealmId(String realmId) - Specified by:
- setRealmIdin interface- MapUserSessionEntity
 
 - 
getUserIdpublic String getUserId() - Specified by:
- getUserIdin interface- MapUserSessionEntity
 
 - 
setUserIdpublic void setUserId(String userId) - Specified by:
- setUserIdin interface- MapUserSessionEntity
 
 - 
getLoginUsernamepublic String getLoginUsername() - Specified by:
- getLoginUsernamein interface- MapUserSessionEntity
 
 - 
setLoginUsernamepublic void setLoginUsername(String loginUsername) - Specified by:
- setLoginUsernamein interface- MapUserSessionEntity
 
 - 
getIpAddresspublic String getIpAddress() - Specified by:
- getIpAddressin interface- MapUserSessionEntity
 
 - 
setIpAddresspublic void setIpAddress(String ipAddress) - Specified by:
- setIpAddressin interface- MapUserSessionEntity
 
 - 
getAuthMethodpublic String getAuthMethod() - Specified by:
- getAuthMethodin interface- MapUserSessionEntity
 
 - 
setAuthMethodpublic void setAuthMethod(String authMethod) - Specified by:
- setAuthMethodin interface- MapUserSessionEntity
 
 - 
isOfflinepublic Boolean isOffline() - Specified by:
- isOfflinein interface- MapUserSessionEntity
 
 - 
setOfflinepublic void setOffline(Boolean offline) - Specified by:
- setOfflinein interface- MapUserSessionEntity
 
 - 
isRememberMepublic Boolean isRememberMe() - Specified by:
- isRememberMein interface- MapUserSessionEntity
 
 - 
setRememberMepublic void setRememberMe(Boolean rememberMe) - Specified by:
- setRememberMein interface- MapUserSessionEntity
 
 - 
getTimestamppublic Long getTimestamp() Description copied from interface:MapUserSessionEntityReturns a point in time (timestamp in milliseconds since The Epoch) when the user session entity was created.- Specified by:
- getTimestampin interface- MapUserSessionEntity
- Returns:
- a timestamp in milliseconds since The Epoch or nullwhen the time is unknown
 
 - 
setTimestamppublic void setTimestamp(Long timestamp) Description copied from interface:MapUserSessionEntitySets a point in the (timestamp in milliseconds since The Epoch) when the user session entity was created.- Specified by:
- setTimestampin interface- MapUserSessionEntity
- Parameters:
- timestamp- a timestamp in milliseconds since The Epoch or- nullwhen the time is unknown
 
 - 
getLastSessionRefreshpublic Long getLastSessionRefresh() Description copied from interface:MapUserSessionEntityReturns a point in time (timestamp in milliseconds since The Epoch) when the user session entity was last refreshed.- Specified by:
- getLastSessionRefreshin interface- MapUserSessionEntity
- Returns:
- a timestamp in milliseconds since The Epoch or nullwhen the time is unknown
 
 - 
setLastSessionRefreshpublic void setLastSessionRefresh(Long lastSessionRefresh) Description copied from interface:MapUserSessionEntitySets a point in the (timestamp in milliseconds since The Epoch) when the user session entity was last refreshed.- Specified by:
- setLastSessionRefreshin interface- MapUserSessionEntity
- Parameters:
- lastSessionRefresh- a timestamp in milliseconds since The Epoch or- nullwhen the time is unknown
 
 - 
getExpirationpublic Long getExpiration() Description copied from interface:ExpirableEntityReturns a point in the time (timestamp in milliseconds since The Epoch) when this entity expires.- Specified by:
- getExpirationin interface- ExpirableEntity
- Returns:
- a timestamp in milliseconds since The Epoch or nullif this entity never expires or expiration is not known.
 
 - 
setExpirationpublic void setExpiration(Long expiration) Description copied from interface:ExpirableEntitySets a point in the time (timestamp in milliseconds since The Epoch) when this entity expires.- Specified by:
- setExpirationin interface- ExpirableEntity
- Parameters:
- expiration- a timestamp in milliseconds since The Epoch or- nullif this entity never expires.
 
 - 
getStatepublic UserSessionModel.State getState() - Specified by:
- getStatein interface- MapUserSessionEntity
 
 - 
setStatepublic void setState(UserSessionModel.State state) - Specified by:
- setStatein interface- MapUserSessionEntity
 
 - 
getPersistenceStatepublic UserSessionModel.SessionPersistenceState getPersistenceState() - Specified by:
- getPersistenceStatein interface- MapUserSessionEntity
 
 - 
setPersistenceStatepublic void setPersistenceState(UserSessionModel.SessionPersistenceState persistenceState) - Specified by:
- setPersistenceStatein interface- MapUserSessionEntity
 
 - 
getNotespublic Map<String,String> getNotes() - Specified by:
- getNotesin interface- MapUserSessionEntity
 
 - 
getNotepublic String getNote(String name) - Specified by:
- getNotein interface- MapUserSessionEntity
 
 - 
setNotespublic void setNotes(Map<String,String> notes) - Specified by:
- setNotesin interface- MapUserSessionEntity
 
 - 
removeNotepublic Boolean removeNote(String name) - Specified by:
- removeNotein interface- MapUserSessionEntity
 
 - 
setNotepublic void setNote(String name, String value) - Specified by:
- setNotein interface- MapUserSessionEntity
 
 - 
getBrokerSessionIdpublic String getBrokerSessionId() - Specified by:
- getBrokerSessionIdin interface- MapUserSessionEntity
 
 - 
setBrokerSessionIdpublic void setBrokerSessionId(String brokerSessionId) - Specified by:
- setBrokerSessionIdin interface- MapUserSessionEntity
 
 - 
getBrokerUserIdpublic String getBrokerUserId() - Specified by:
- getBrokerUserIdin interface- MapUserSessionEntity
 
 - 
setBrokerUserIdpublic void setBrokerUserId(String brokerUserId) - Specified by:
- setBrokerUserIdin interface- MapUserSessionEntity
 
 - 
getAuthenticatedClientSessionspublic Set<MapAuthenticatedClientSessionEntity> getAuthenticatedClientSessions() - Specified by:
- getAuthenticatedClientSessionsin interface- MapUserSessionEntity
 
 - 
addAuthenticatedClientSessionpublic void addAuthenticatedClientSession(MapAuthenticatedClientSessionEntity clientSession) - Specified by:
- addAuthenticatedClientSessionin interface- MapUserSessionEntity
 
 - 
getAuthenticatedClientSessionpublic Optional<MapAuthenticatedClientSessionEntity> getAuthenticatedClientSession(String clientUUID) - Specified by:
- getAuthenticatedClientSessionin interface- MapUserSessionEntity
 
 - 
removeAuthenticatedClientSessionpublic Boolean removeAuthenticatedClientSession(String clientUUID) - Specified by:
- removeAuthenticatedClientSessionin interface- MapUserSessionEntity
 
 - 
clearAuthenticatedClientSessionspublic void clearAuthenticatedClientSessions() - Specified by:
- clearAuthenticatedClientSessionsin interface- MapUserSessionEntity
- Overrides:
- clearAuthenticatedClientSessionsin class- MapUserSessionEntity.AbstractUserSessionEntity
 
 
- 
 
-