com.atlassian.confluence.cache
Class CacheOperations<K,V>

java.lang.Object
  extended by com.atlassian.confluence.cache.CacheOperations<K,V>

@Internal
public class CacheOperations<K,V>
extends Object

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:
DeferredOperationsCache

Constructor Summary
CacheOperations()
           
 
Method Summary
 void cache(K key, V value)
           
 void clear()
          Clear all recorded cache cachedOperations
 Set<K> filter(Iterable<K> globalKeys)
          Filters the supplied list of keys by adding those from any 'put' operations and removing those from any 'remove' operations.
 V get(K key)
           
 boolean isRemoved(K key)
           
 int operationCount()
           
 void perform(com.atlassian.cache.Cache<K,V> cache)
          Perform all recorded cachedOperations on the provided cache
 void put(K key, V value)
           
 int putCount()
           
 void putIfAbsent(K key, V value)
           
 int putIfAbsentCount()
           
 void remove(K key)
           
 void removeAll(Collection<K> keys)
           
 int removeCount()
           
 int valueCount()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheOperations

public CacheOperations()
Method Detail

get

public V get(K key)

isRemoved

public boolean isRemoved(K key)

cache

public void cache(K key,
                  V value)

put

public void put(K key,
                V value)

putIfAbsent

public void putIfAbsent(K key,
                        V value)

remove

public void remove(K key)

removeAll

public void removeAll(Collection<K> keys)

clear

public void clear()
Clear all recorded cache cachedOperations


filter

public Set<K> filter(Iterable<K> globalKeys)
Filters the supplied list of keys by adding those from any 'put' operations and removing those from any 'remove' operations.


perform

public void perform(com.atlassian.cache.Cache<K,V> cache)
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


Copyright © 2003–2015 Atlassian. All rights reserved.