Package com.atlassian.confluence.cache
Class CacheOperations<K,V>
java.lang.Object
com.atlassian.confluence.cache.CacheOperations<K,V>
A cache operation recorder. Offers the ability to record a series of cache modification operations and perform them
on a target cache at a later time.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
clear()
Clear all recorded cache cachedOperationsFilters the supplied list of keys by adding those from any 'put' operations and removing those from any 'remove' operations.@NonNull V
Return the value for the given key, or load a new value into the session cache using the given supplier.boolean
int
void
Perform all recorded cachedOperations on the provided cachevoid
int
putCount()
void
putIfAbsent
(K key, V value) Deprecated.since 7.5 No longer usedint
void
void
removeAll
(Collection<K> keys) int
int
-
Constructor Details
-
CacheOperations
public CacheOperations()
-
-
Method Details
-
get
-
isRemoved
-
cache
-
put
-
putIfAbsent
Deprecated.since 7.5 No longer used -
get
Return the value for the given key, or load a new value into the session cache using the given supplier. When the deferred operations are performed, this will call get-with-supplier on the delegate cache, with the previously loaded value being supplied.- Since:
- 7.5
-
remove
-
removeAll
-
clear
public void clear()Clear all recorded cache cachedOperations -
filter
Filters the supplied list of keys by adding those from any 'put' operations and removing those from any 'remove' operations. -
perform
Perform all recorded cachedOperations on the provided cache- Parameters:
cache
- Cache to perform cachedOperations on
-
operationCount
public int operationCount()- Returns:
- The total number of recorded cachedOperations
-
putIfAbsentCount
public int putIfAbsentCount()- Returns:
- The number of recorded put cachedOperations
-
putCount
public int putCount()- Returns:
- The number of recorded put cachedOperations
-
removeCount
public int removeCount()- Returns:
- The number of recorded remove cachedOperations
-
valueCount
public int valueCount()- Returns:
- The number of recorded reads
-