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

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

public class CacheOperations<K,V>
extends java.lang.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 clear()
          Clear all recorded cache operations
 java.util.Set<K> filter(java.util.Collection<K> keys)
          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)
           
 void perform(com.atlassian.cache.Cache<K,V> cache)
          Perform all recorded operations on the provided cache
 void put(K key, V value)
           
 int putCount()
           
 void remove(K key)
           
 void removeAll(java.util.Collection<K> keys)
           
 int removeCount()
           
 
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)

put

public void put(K key,
                V value)

remove

public void remove(K key)

removeAll

public void removeAll(java.util.Collection<K> keys)

clear

public void clear()
Clear all recorded cache operations


filter

public java.util.Set<K> filter(java.util.Collection<K> keys)
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 operations on the provided cache

Parameters:
cache - Cache to perform operations on

putCount

public int putCount()
Returns:
The number of recorded put operations

removeCount

public int removeCount()
Returns:
The number of recorded remove operations


Copyright © 2003-2014 Atlassian. All Rights Reserved.