Class NoActionHotRodTransactionWrapper<K,V extends AbstractEntity & UpdatableEntity,M>
- java.lang.Object
-
- org.keycloak.models.map.storage.hotRod.transaction.NoActionHotRodTransactionWrapper<K,V,M>
-
- All Implemented Interfaces:
KeycloakTransaction,MapKeycloakTransaction<V,M>
public class NoActionHotRodTransactionWrapper<K,V extends AbstractEntity & UpdatableEntity,M> extends Object implements MapKeycloakTransaction<V,M>
This is used to return ConcurrentHashMapTransaction (used for operating RemoteCache) functionality to providers but not enlist actualTx the way we need: in prepare phase.
-
-
Constructor Summary
Constructors Constructor Description NoActionHotRodTransactionWrapper(ConcurrentHashMapKeycloakTransaction<K,V,M> actualTx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbegin()voidcommit()Vcreate(V value)Instructs this transaction to add a new value into the underlying store on commit.booleandelete(String key)Instructs this transaction to delete a value associated with the identifierkeyfrom the underlying store on commit.longdelete(QueryParameters<M> queryParameters)Instructs this transaction to remove values (identified bymcbfilter) from the underlying store on commit.longgetCount(QueryParameters<M> queryParameters)Returns a number of values present in the underlying storage that fulfill the given criteria with respect to changes done in the current transaction.booleangetRollbackOnly()booleanisActive()Vread(String key)Provides possibility to lookup for values by akeyin the underlying store with respect to changes done in current transaction.Stream<V>read(QueryParameters<M> queryParameters)Returns a stream of values from underlying storage that are updated based on the current transaction changes; i.e.voidrollback()voidsetRollbackOnly()-
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, exists
-
-
-
-
Constructor Detail
-
NoActionHotRodTransactionWrapper
public NoActionHotRodTransactionWrapper(ConcurrentHashMapKeycloakTransaction<K,V,M> actualTx)
-
-
Method Detail
-
create
public V create(V value)
Description copied from interface:MapKeycloakTransactionInstructs this transaction to add a new value into the underlying store on commit.Updates to the returned instances of
Vwould 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:
createin interfaceMapKeycloakTransaction<K,V extends AbstractEntity & UpdatableEntity>- Parameters:
value- the value- Returns:
- Entity representing the
valuein the store. It may or may not be the same instance asvalue.
-
read
public V read(String key)
Description copied from interface:MapKeycloakTransactionProvides possibility to lookup for values by akeyin 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. IfVimplementsExpirableEntitythis method should not return entities that are expired. SeeExpirableEntityJavaDoc for more details.- Specified by:
readin interfaceMapKeycloakTransaction<K,V extends AbstractEntity & UpdatableEntity>- Parameters:
key- identifier of a value- Returns:
- a value associated with the given
key
-
read
public Stream<V> read(QueryParameters<M> queryParameters)
Description copied from interface:MapKeycloakTransactionReturns a stream of values from underlying storage that are updated based on the current transaction changes; i.e. the result contains updates and excludes of records that have been created, updated or deleted in this transaction by methodsMapKeycloakTransaction.create(V),MapKeycloakTransaction.create(V),MapKeycloakTransaction.delete(java.lang.String), etc.Updates to the returned instances of
Vwould be visible in the current transaction and will propagate into the underlying store upon commit. IfVimplementsExpirableEntitythis method should not return entities that are expired. SeeExpirableEntityJavaDoc for more details.- Specified by:
readin interfaceMapKeycloakTransaction<K,V extends AbstractEntity & UpdatableEntity>- 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
-
getCount
public long getCount(QueryParameters<M> queryParameters)
Description copied from interface:MapKeycloakTransactionReturns a number of values present in the underlying storage that fulfill the given criteria with respect to changes done in the current transaction.- Specified by:
getCountin interfaceMapKeycloakTransaction<K,V extends AbstractEntity & UpdatableEntity>- Parameters:
queryParameters- parameters for the query like firstResult, maxResult, requested ordering, etc.- Returns:
- number of values present in the storage that fulfill the given criteria
-
delete
public boolean delete(String key)
Description copied from interface:MapKeycloakTransactionInstructs this transaction to delete a value associated with the identifierkeyfrom the underlying store on commit.- Specified by:
deletein interfaceMapKeycloakTransaction<K,V extends AbstractEntity & UpdatableEntity>- Parameters:
key- identifier of a value- Returns:
- Returns
trueif the object has been deleted or result cannot be determined,falseotherwise.
-
delete
public long delete(QueryParameters<M> queryParameters)
Description copied from interface:MapKeycloakTransactionInstructs this transaction to remove values (identified bymcbfilter) from the underlying store on commit.- Specified by:
deletein interfaceMapKeycloakTransaction<K,V extends AbstractEntity & UpdatableEntity>- Parameters:
queryParameters- parameters for the query like firstResult, maxResult, requested ordering, etc.- Returns:
- number of removed objects (might return
-1if not supported)
-
begin
public void begin()
- Specified by:
beginin interfaceKeycloakTransaction
-
commit
public void commit()
- Specified by:
commitin interfaceKeycloakTransaction
-
rollback
public void rollback()
- Specified by:
rollbackin interfaceKeycloakTransaction
-
setRollbackOnly
public void setRollbackOnly()
- Specified by:
setRollbackOnlyin interfaceKeycloakTransaction
-
getRollbackOnly
public boolean getRollbackOnly()
- Specified by:
getRollbackOnlyin interfaceKeycloakTransaction
-
isActive
public boolean isActive()
- Specified by:
isActivein interfaceKeycloakTransaction
-
-