Package org.keycloak.models.map.storage
Interface MapKeycloakTransaction<V extends AbstractEntity,M>
-
- All Superinterfaces:
KeycloakTransaction
- All Known Subinterfaces:
MapKeycloakTransactionWithAuth<V,M>
- All Known Implementing Classes:
ConcurrentHashMapKeycloakTransaction
,FileMapKeycloakTransaction
,HotRodUserSessionTransaction
,JpaAdminEventMapKeycloakTransaction
,JpaAuthEventMapKeycloakTransaction
,JpaClientMapKeycloakTransaction
,JpaClientScopeMapKeycloakTransaction
,JpaGroupMapKeycloakTransaction
,JpaMapKeycloakTransaction
,JpaPermissionMapKeycloakTransaction
,JpaPolicyMapKeycloakTransaction
,JpaRealmMapKeycloakTransaction
,JpaResourceMapKeycloakTransaction
,JpaResourceServerMapKeycloakTransaction
,JpaRoleMapKeycloakTransaction
,JpaRootAuthenticationSessionMapKeycloakTransaction
,JpaScopeMapKeycloakTransaction
,JpaSingleUseObjectMapKeycloakTransaction
,JpaUserLoginFailureMapKeycloakTransaction
,JpaUserMapKeycloakTransaction
,JpaUserSessionMapKeycloakTransaction
,LdapMapKeycloakTransaction
,LdapRoleMapKeycloakTransaction
,NoActionHotRodTransactionWrapper
,SingleUseObjectKeycloakTransaction
public interface MapKeycloakTransaction<V extends AbstractEntity,M> extends KeycloakTransaction
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description V
create(V 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<M> queryParameters)
Instructs this transaction to remove values (identified bymcb
filter) from the underlying store on commit.default boolean
exists(String key)
Returnstrue
if the object with the givenkey
exists in the underlying storage with respect to changes done in current transaction.default boolean
exists(QueryParameters<M> queryParameters)
Returnstrue
if at least one object is satisfying givencriteria
from the underlying storage with respect to changes done in current transaction.long
getCount(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.V
read(String key)
Provides possibility to lookup for values by akey
in 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.-
Methods inherited from interface org.keycloak.models.KeycloakTransaction
begin, commit, getRollbackOnly, isActive, rollback, setRollbackOnly
-
-
-
-
Method Detail
-
create
V create(V value)
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.- Parameters:
value
- the value- Returns:
- Entity representing the
value
in the store. It may or may not be the same instance asvalue
.
-
read
V read(String key)
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.- Parameters:
key
- identifier of a value- Returns:
- a value associated with the given
key
-
read
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. the result contains updates and excludes of records that have been created, updated or deleted in this transaction by methodscreate(V)
,create(V)
,delete(java.lang.String)
, etc.Updates to the returned instances of
V
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.- 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
long getCount(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.- 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
boolean delete(String key)
Instructs this transaction to delete a value associated with the identifierkey
from the underlying store on commit.- Parameters:
key
- identifier of a value- Returns:
- Returns
true
if the object has been deleted or result cannot be determined,false
otherwise.
-
delete
long delete(QueryParameters<M> queryParameters)
Instructs this transaction to remove values (identified bymcb
filter) from the underlying store on commit.- Parameters:
queryParameters
- parameters for the query like firstResult, maxResult, requested ordering, etc.- Returns:
- number of removed objects (might return
-1
if not supported)
-
exists
default boolean exists(String key)
Returnstrue
if the object with the givenkey
exists in the underlying storage with respect to changes done in current transaction.false
otherwise.- Parameters:
key
- Key of the object. Must not benull
.- Returns:
- See description
- Throws:
NullPointerException
- if thekey
isnull
-
exists
default boolean exists(QueryParameters<M> queryParameters)
Returnstrue
if at least one object is satisfying givencriteria
from the underlying storage with respect to changes done in current transaction.false
otherwise. The criteria are specified in the given criteria builder based on model properties.- Parameters:
queryParameters
- parameters for the query- Returns:
- See description
-
-