Package org.teamapps.ux.cache
Class ClientRecordCache<RECORD,UIRECORD extends org.teamapps.dto.UiIdentifiableClientRecord>
java.lang.Object
org.teamapps.ux.cache.ClientRecordCache<RECORD,UIRECORD>
public class ClientRecordCache<RECORD,UIRECORD extends org.teamapps.dto.UiIdentifiableClientRecord>
extends java.lang.Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceClientRecordCache.UiIdentifiableClientRecordFactory<RECORD,UIRECORD>static interfaceClientRecordCache.UiIdentifiableClientRecordPostProcessor<RECORD,UIRECORD> -
Constructor Summary
Constructors Constructor Description ClientRecordCache(ClientRecordCache.UiIdentifiableClientRecordFactory<RECORD,UIRECORD> clientRecordFactory)ClientRecordCache(ClientRecordCache.UiIdentifiableClientRecordFactory<RECORD,UIRECORD> clientRecordFactory, ClientRecordCache.UiIdentifiableClientRecordPostProcessor<RECORD,UIRECORD> postProcessor) -
Method Summary
Modifier and Type Method Description CacheManipulationHandle<UIRECORD>addOrUpdateRecord(RECORD record)CacheManipulationHandle<UIRECORD>addRecord(RECORD record)CacheManipulationHandle<java.util.List<UIRECORD>>addRecords(java.util.List<RECORD> newRecords)CacheManipulationHandle<java.lang.Void>clear()<ID> booleancontainsExactly(java.util.List<RECORD> records, java.util.function.Function<RECORD,ID> identifierExtractor, java.util.function.BiPredicate<RECORD,RECORD> recordsEqual)java.util.Map<java.lang.Integer,RECORD>getAllRecords(boolean includingAcknowledged)intgetMaxCapacity()intgetOperationInvalidationSequenceNumber()java.util.function.BiPredicate<RECORD,java.lang.Integer>getPurgeDecider()ClientRecordCachePurgeListenergetPurgeListener()RECORDgetRecordByClientId(int id)java.lang.IntegergetUiRecordIdOrNull(RECORD record)java.util.List<java.lang.Integer>getUiRecordIds(java.util.List<RECORD> records)voidhardReplaceRecords(java.util.Map<RECORD,java.lang.Integer> newRecords)CacheManipulationHandle<java.lang.Integer>removeRecord(RECORD record)CacheManipulationHandle<java.util.List<java.lang.Integer>>removeRecords(java.util.Collection<RECORD> recordToBeRemoved)CacheManipulationHandle<java.util.List<UIRECORD>>replaceRecords(java.util.List<RECORD> newRecords)Replaces the records, but keeps records inside the cache that are not purged due to thepurgeDecider's intervention.voidsetMaxCapacity(int maxCapacity)voidsetPurgeDecider(java.util.function.BiPredicate<RECORD,java.lang.Integer> purgeDecider)voidsetPurgeListener(ClientRecordCachePurgeListener purgeListener)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ClientRecordCache
public ClientRecordCache(ClientRecordCache.UiIdentifiableClientRecordFactory<RECORD,UIRECORD> clientRecordFactory, ClientRecordCache.UiIdentifiableClientRecordPostProcessor<RECORD,UIRECORD> postProcessor) -
ClientRecordCache
public ClientRecordCache(ClientRecordCache.UiIdentifiableClientRecordFactory<RECORD,UIRECORD> clientRecordFactory)
-
-
Method Details
-
getUiRecordIdOrNull
-
getUiRecordIds
-
getRecordByClientId
-
clear
-
replaceRecords
public CacheManipulationHandle<java.util.List<UIRECORD>> replaceRecords(java.util.List<RECORD> newRecords)Replaces the records, but keeps records inside the cache that are not purged due to thepurgeDecider's intervention. -
addRecords
public CacheManipulationHandle<java.util.List<UIRECORD>> addRecords(java.util.List<RECORD> newRecords) -
addRecord
-
addOrUpdateRecord
-
removeRecord
-
removeRecords
public CacheManipulationHandle<java.util.List<java.lang.Integer>> removeRecords(java.util.Collection<RECORD> recordToBeRemoved) -
hardReplaceRecords
-
getMaxCapacity
public int getMaxCapacity() -
setMaxCapacity
public void setMaxCapacity(int maxCapacity) -
getPurgeListener
-
setPurgeListener
-
getOperationInvalidationSequenceNumber
public int getOperationInvalidationSequenceNumber() -
getAllRecords
-
containsExactly
-
getPurgeDecider
-
setPurgeDecider
public void setPurgeDecider(java.util.function.BiPredicate<RECORD,java.lang.Integer> purgeDecider)
-