Class HotRodMapStorage<K,E extends AbstractHotRodEntity,V extends AbstractEntity & HotRodEntityDelegate<E>,M>
- java.lang.Object
- 
- org.keycloak.models.map.storage.hotRod.HotRodMapStorage<K,E,V,M>
 
- 
- All Implemented Interfaces:
- ConcurrentHashMapCrudOperations<V,M>,- MapStorage<V,M>
 - Direct Known Subclasses:
- SingleUseObjectHotRodMapStorage
 
 public class HotRodMapStorage<K,E extends AbstractHotRodEntity,V extends AbstractEntity & HotRodEntityDelegate<E>,M> extends Object implements MapStorage<V,M>, ConcurrentHashMapCrudOperations<V,M> 
- 
- 
Field SummaryFields Modifier and Type Field Description protected DeepClonerclonerprotected booleanisExpirableEntityprotected StringKeyConverter<K>keyConverterprotected HotRodEntityDescriptor<E,V>storedEntityDescriptor
 - 
Constructor SummaryConstructors Constructor Description HotRodMapStorage(org.infinispan.client.hotrod.RemoteCache<K,E> remoteCache, StringKeyConverter<K> keyConverter, HotRodEntityDescriptor<E,V> storedEntityDescriptor, DeepCloner cloner, AllAreasHotRodTransactionsWrapper txWrapper)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Vcreate(V value)Creates an object in the store.IckleQueryMapModelCriteriaBuilder<E,M>createCriteriaBuilder()MapKeycloakTransaction<V,M>createTransaction(KeycloakSession session)Creates aMapKeycloakTransactionobject that tracks a new transaction related to this storage.protected MapKeycloakTransaction<V,M>createTransactionInternal(KeycloakSession session)booleandelete(String key)Deletes object with the givenkeyfrom the storage, if exists, no-op otherwise.longdelete(QueryParameters<M> queryParameters)Deletes objects that match the given criteria.booleanexists(String key)Returnstrueif the object with the givenkeyexists in the storage.longgetCount(QueryParameters<M> queryParameters)Returns the number of objects satisfying givencriteriafrom the storage.Vread(String key)Returns object with the givenkeyfrom the storage ornullif object does not exist.Stream<V>read(QueryParameters<M> queryParameters)Returns stream of objects satisfying givencriteriafrom the storage.Vupdate(V value)Updates the object with the key of thevalue's ID in the storage if it already exists.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.keycloak.models.map.storage.chm.ConcurrentHashMapCrudOperationsdetermineKeyFromValue, exists
 
- 
 
- 
- 
- 
Field Detail- 
keyConverterprotected final StringKeyConverter<K> keyConverter 
 - 
storedEntityDescriptorprotected final HotRodEntityDescriptor<E extends AbstractHotRodEntity,V extends AbstractEntity & HotRodEntityDelegate<E>> storedEntityDescriptor 
 - 
clonerprotected final DeepCloner cloner 
 - 
isExpirableEntityprotected boolean isExpirableEntity 
 
- 
 - 
Constructor Detail- 
HotRodMapStoragepublic HotRodMapStorage(org.infinispan.client.hotrod.RemoteCache<K,E> remoteCache, StringKeyConverter<K> keyConverter, HotRodEntityDescriptor<E,V> storedEntityDescriptor, DeepCloner cloner, AllAreasHotRodTransactionsWrapper txWrapper) 
 
- 
 - 
Method Detail- 
createpublic V create(V value) Description copied from interface:ConcurrentHashMapCrudOperationsCreates an object in the store. ID of thevaluemay be prescribed in id of thevalue. If the id isnullor its format is not matching the store internal format for ID, then thevalue's ID will be generated and returned in the id of the return value.- Specified by:
- createin interface- ConcurrentHashMapCrudOperations<K,E extends AbstractHotRodEntity>
- Parameters:
- value- Entity to create in the store
- Returns:
- Entity representing the valuein the store. It may or may not be the same instance asvalue
- See Also:
- AbstractEntity.getId()
 
 - 
readpublic V read(String key) Description copied from interface:ConcurrentHashMapCrudOperationsReturns object with the givenkeyfrom the storage ornullif object does not exist.
 IfVimplementsExpirableEntitythis method should not return entities that are expired. SeeExpirableEntityJavaDoc for more details. TODO: Consider returningOptional<V>instead.- Specified by:
- readin interface- ConcurrentHashMapCrudOperations<K,E extends AbstractHotRodEntity>
- Parameters:
- key- Key of the object. Must not be- null.
- Returns:
- See description
 
 - 
updatepublic V update(V value) Description copied from interface:ConcurrentHashMapCrudOperationsUpdates the object with the key of thevalue's ID in the storage if it already exists.- Specified by:
- updatein interface- ConcurrentHashMapCrudOperations<K,E extends AbstractHotRodEntity>
- Parameters:
- value- Updated value
- Returns:
- the previous value associated with the specified key, or null if there was no mapping for the key. (A null return can also indicate that the map previously associated null with the key, if the implementation supports null values.)
- See Also:
- AbstractEntity.getId()
 
 - 
deletepublic boolean delete(String key) Description copied from interface:ConcurrentHashMapCrudOperationsDeletes object with the givenkeyfrom the storage, if exists, no-op otherwise.- Specified by:
- deletein interface- ConcurrentHashMapCrudOperations<K,E extends AbstractHotRodEntity>
- Returns:
- Returns trueif the object has been deleted or result cannot be determined,falseotherwise.
 
 - 
readpublic Stream<V> read(QueryParameters<M> queryParameters) Description copied from interface:ConcurrentHashMapCrudOperationsReturns stream of objects satisfying givencriteriafrom the storage. The criteria are specified in the given criteria builder based on model properties. IfVimplementsExpirableEntitythis method should not return entities that are expired. SeeExpirableEntityJavaDoc for more details.- Specified by:
- readin interface- ConcurrentHashMapCrudOperations<K,E extends AbstractHotRodEntity>
- Parameters:
- queryParameters- parameters for the query like firstResult, maxResult, requested ordering, etc.
- Returns:
- Stream of objects. Never returns null.
 
 - 
getCountpublic long getCount(QueryParameters<M> queryParameters) Description copied from interface:ConcurrentHashMapCrudOperationsReturns the number of objects satisfying givencriteriafrom the storage. The criteria are specified in the given criteria builder based on model properties.- Specified by:
- getCountin interface- ConcurrentHashMapCrudOperations<K,E extends AbstractHotRodEntity>
- Parameters:
- queryParameters- parameters for the query like firstResult, maxResult, requested ordering, etc.
- Returns:
- Number of objects. Never returns null.
 
 - 
deletepublic long delete(QueryParameters<M> queryParameters) Description copied from interface:ConcurrentHashMapCrudOperationsDeletes objects that match the given criteria.- Specified by:
- deletein interface- ConcurrentHashMapCrudOperations<K,E extends AbstractHotRodEntity>
- Parameters:
- queryParameters- parameters for the query like firstResult, maxResult, requested ordering, etc.
- Returns:
- Number of removed objects (might return -1if not supported)
 
 - 
existspublic boolean exists(String key) Description copied from interface:ConcurrentHashMapCrudOperationsReturnstrueif the object with the givenkeyexists in the storage.falseotherwise.- Specified by:
- existsin interface- ConcurrentHashMapCrudOperations<K,E extends AbstractHotRodEntity>
- Parameters:
- key- Key of the object. Must not be- null.
- Returns:
- See description
 
 - 
createCriteriaBuilderpublic IckleQueryMapModelCriteriaBuilder<E,M> createCriteriaBuilder() 
 - 
createTransactionpublic MapKeycloakTransaction<V,M> createTransaction(KeycloakSession session) Description copied from interface:MapStorageCreates aMapKeycloakTransactionobject that tracks a new transaction related to this storage. In case of JPA or similar, the transaction object might be supplied by the container (via JTA) or shared same across storages accessing the same database within the same session; in other cases (e.g. plain map) a separate transaction handler might be created per each storage.- Specified by:
- createTransactionin interface- MapStorage<K,E extends AbstractHotRodEntity>
- Returns:
- See description. Never returns null
 
 - 
createTransactionInternalprotected MapKeycloakTransaction<V,M> createTransactionInternal(KeycloakSession session) 
 
- 
 
-