Class HotRodUserSessionTransaction<K>
- java.lang.Object
-
- org.keycloak.models.map.storage.chm.ConcurrentHashMapKeycloakTransaction<K,MapUserSessionEntity,UserSessionModel>
-
- org.keycloak.models.map.storage.hotRod.userSession.HotRodUserSessionTransaction<K>
-
- All Implemented Interfaces:
KeycloakTransaction
,HasRealmId
,MapKeycloakTransaction<MapUserSessionEntity,UserSessionModel>
public class HotRodUserSessionTransaction<K> extends ConcurrentHashMapKeycloakTransaction<K,MapUserSessionEntity,UserSessionModel>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.keycloak.models.map.storage.chm.ConcurrentHashMapKeycloakTransaction
ConcurrentHashMapKeycloakTransaction.MapTaskWithValue
-
-
Field Summary
-
Fields inherited from class org.keycloak.models.map.storage.chm.ConcurrentHashMapKeycloakTransaction
active, cloner, fieldPredicates, keyConverter, map, realmIdEntityField, rollback, tasks
-
-
Constructor Summary
Constructors Constructor Description HotRodUserSessionTransaction(ConcurrentHashMapCrudOperations<MapUserSessionEntity,UserSessionModel> map, StringKeyConverter<K> keyConverter, DeepCloner cloner, Map<SearchableModelField<? super UserSessionModel>,MapModelCriteriaBuilder.UpdatePredicatesFunc<K,MapUserSessionEntity,UserSessionModel>> fieldPredicates, MapKeycloakTransaction<MapAuthenticatedClientSessionEntity,AuthenticatedClientSessionModel> clientSessionTransaction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commit()
MapUserSessionEntity
create(MapUserSessionEntity value)
Instructs this transaction to add a new value into the underlying store on commit.boolean
delete(String key)
Instructs this transaction to delete a value associated with the identifierkey
from the underlying store on commit.long
delete(QueryParameters<UserSessionModel> queryParameters)
Instructs this transaction to remove values (identified bymcb
filter) from the underlying store on commit.MapUserSessionEntity
read(String sKey)
Provides possibility to lookup for values by akey
in the underlying store with respect to changes done in current transaction.Stream<MapUserSessionEntity>
read(QueryParameters<UserSessionModel> queryParameters)
Returns the stream of records that match given criteria and includes changes made in this transaction, i.e.-
Methods inherited from class org.keycloak.models.map.storage.chm.ConcurrentHashMapKeycloakTransaction
addTask, begin, exists, getCount, getRealmId, getRollbackOnly, isActive, registerEntityForChanges, rollback, setRealmId, setRollbackOnly, updateIfChanged
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.keycloak.models.map.storage.MapKeycloakTransaction
exists
-
-
-
-
Constructor Detail
-
HotRodUserSessionTransaction
public HotRodUserSessionTransaction(ConcurrentHashMapCrudOperations<MapUserSessionEntity,UserSessionModel> map, StringKeyConverter<K> keyConverter, DeepCloner cloner, Map<SearchableModelField<? super UserSessionModel>,MapModelCriteriaBuilder.UpdatePredicatesFunc<K,MapUserSessionEntity,UserSessionModel>> fieldPredicates, MapKeycloakTransaction<MapAuthenticatedClientSessionEntity,AuthenticatedClientSessionModel> clientSessionTransaction)
-
-
Method Detail
-
commit
public void commit()
- Specified by:
commit
in interfaceKeycloakTransaction
- Overrides:
commit
in classConcurrentHashMapKeycloakTransaction<K,MapUserSessionEntity,UserSessionModel>
-
read
public MapUserSessionEntity read(String sKey)
Description copied from interface:MapKeycloakTransaction
Provides possibility to lookup for values by akey
in the underlying store with respect to changes done in current transaction. Updates to the returned instance would be visible in the current transaction and will propagate into the underlying store upon commit. IfV
implementsExpirableEntity
this method should not return entities that are expired. SeeExpirableEntity
JavaDoc for more details.- Specified by:
read
in interfaceMapKeycloakTransaction<MapUserSessionEntity,UserSessionModel>
- Overrides:
read
in classConcurrentHashMapKeycloakTransaction<K,MapUserSessionEntity,UserSessionModel>
- Parameters:
sKey
- identifier of a value- Returns:
- a value associated with the given
key
-
read
public Stream<MapUserSessionEntity> read(QueryParameters<UserSessionModel> queryParameters)
Description copied from class:ConcurrentHashMapKeycloakTransaction
Returns the stream of records that match given criteria and includes changes made in this transaction, i.e. the result contains updates and excludes records that have been deleted in this transaction.- Specified by:
read
in interfaceMapKeycloakTransaction<MapUserSessionEntity,UserSessionModel>
- Overrides:
read
in classConcurrentHashMapKeycloakTransaction<K,MapUserSessionEntity,UserSessionModel>
- Parameters:
queryParameters
- parameters for the query like firstResult, maxResult, requested ordering, etc.- Returns:
- values that fulfill the given criteria, that are updated based on changes in the current transaction
-
create
public MapUserSessionEntity create(MapUserSessionEntity value)
Description copied from interface:MapKeycloakTransaction
Instructs this transaction to add a new value into the underlying store on commit.Updates to the returned instances of
V
would be visible in the current transaction and will propagate into the underlying store upon commit. The ID of the entity passed in the parameter might change to a different value in the returned value if the underlying storage decided this was necessary. If the ID of the entity was null before, it will be set on the returned value.- Specified by:
create
in interfaceMapKeycloakTransaction<MapUserSessionEntity,UserSessionModel>
- Overrides:
create
in classConcurrentHashMapKeycloakTransaction<K,MapUserSessionEntity,UserSessionModel>
- Parameters:
value
- the value- Returns:
- Entity representing the
value
in the store. It may or may not be the same instance asvalue
.
-
delete
public boolean delete(String key)
Description copied from interface:MapKeycloakTransaction
Instructs this transaction to delete a value associated with the identifierkey
from the underlying store on commit.- Specified by:
delete
in interfaceMapKeycloakTransaction<MapUserSessionEntity,UserSessionModel>
- Overrides:
delete
in classConcurrentHashMapKeycloakTransaction<K,MapUserSessionEntity,UserSessionModel>
- Parameters:
key
- identifier of a value- Returns:
- Returns
true
if the object has been deleted or result cannot be determined,false
otherwise.
-
delete
public long delete(QueryParameters<UserSessionModel> queryParameters)
Description copied from interface:MapKeycloakTransaction
Instructs this transaction to remove values (identified bymcb
filter) from the underlying store on commit.- Specified by:
delete
in interfaceMapKeycloakTransaction<MapUserSessionEntity,UserSessionModel>
- Overrides:
delete
in classConcurrentHashMapKeycloakTransaction<K,MapUserSessionEntity,UserSessionModel>
- Parameters:
queryParameters
- parameters for the query like firstResult, maxResult, requested ordering, etc.- Returns:
- number of removed objects (might return
-1
if not supported)
-
-