public class MapKeycloakTransaction<K,V extends AbstractEntity<K>,M> extends Object implements KeycloakTransaction
Modifier and Type | Class and Description |
---|---|
protected class |
MapKeycloakTransaction.MapTaskWithValue |
Constructor and Description |
---|
MapKeycloakTransaction(MapStorage<K,V,M> map) |
Modifier and Type | Method and Description |
---|---|
protected void |
addTask(K key,
MapKeycloakTransaction.MapTaskWithValue task)
Adds a given task if not exists for the given key
|
void |
begin() |
void |
commit() |
void |
create(K key,
V value) |
void |
delete(K key) |
long |
delete(K artificialKey,
ModelCriteriaBuilder<M> mcb)
Bulk removal of items.
|
long |
getCount(ModelCriteriaBuilder<M> mcb)
Returns the stream of records that match given criteria and includes changes made in this transaction, i.e.
|
boolean |
getRollbackOnly() |
V |
getUpdated(V orig)
Returns a updated version of the
orig object as updated in this transaction. |
Stream<V> |
getUpdatedNotRemoved(ModelCriteriaBuilder<M> mcb)
Returns the stream of records that match given criteria and includes changes made in this transaction, i.e.
|
boolean |
isActive() |
V |
read(K key) |
V |
read(K key,
Function<K,V> defaultValueFunc) |
void |
rollback() |
void |
setRollbackOnly() |
void |
update(K key,
V value) |
void |
updateIfChanged(K key,
V value,
Predicate<V> shouldPut) |
public MapKeycloakTransaction(MapStorage<K,V,M> map)
public void begin()
begin
in interface KeycloakTransaction
public void commit()
commit
in interface KeycloakTransaction
public void rollback()
rollback
in interface KeycloakTransaction
public void setRollbackOnly()
setRollbackOnly
in interface KeycloakTransaction
public boolean getRollbackOnly()
getRollbackOnly
in interface KeycloakTransaction
public boolean isActive()
isActive
in interface KeycloakTransaction
protected void addTask(K key, MapKeycloakTransaction.MapTaskWithValue task)
public Stream<V> getUpdatedNotRemoved(ModelCriteriaBuilder<M> mcb)
mcb
- public long getCount(ModelCriteriaBuilder<M> mcb)
mcb
- public V getUpdated(V orig)
orig
object as updated in this transaction.
If the underlying store handles transactions on its own, this can return orig
directly.orig
- orig
object as visible from this transaction, or null
if the object has been removed.public void delete(K key)
public long delete(K artificialKey, ModelCriteriaBuilder<M> mcb)
artificialKey
- Key to record the transaction with, must be a key that does not exist in this transaction to
prevent collision with other operations in this transactionmcb
- Copyright © 2021 JBoss by Red Hat. All rights reserved.