org.apache.jcs.auxiliary
Class MockAuxiliaryCache<K extends Serializable,V extends Serializable>
java.lang.Object
org.apache.jcs.auxiliary.AbstractAuxiliaryCache<K,V>
org.apache.jcs.auxiliary.MockAuxiliaryCache<K,V>
- All Implemented Interfaces:
- AuxiliaryCache<K,V>, ICache<K,V>, ICacheType
public class MockAuxiliaryCache<K extends Serializable,V extends Serializable>
- extends AbstractAuxiliaryCache<K,V>
Mock auxiliary for unit tests.
- Author:
- Aaron Smuts
| Methods inherited from class org.apache.jcs.auxiliary.AbstractAuxiliaryCache |
createICacheEvent, createICacheEvent, getCacheEventLogger, getElementSerializer, getKeyMatcher, logApplicationEvent, logError, logICacheEvent, setCacheEventLogger, setElementSerializer, setKeyMatcher |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cacheType
public ICacheType.CacheType cacheType
- Can setup the cache type
status
public CacheStatus status
- Can setup status
getMatchingCallCount
public int getMatchingCallCount
- Times getMatching was Called
MockAuxiliaryCache
public MockAuxiliaryCache()
update
public void update(ICacheElement<K,V> ce)
throws IOException
- Parameters:
ce -
- Throws:
IOException
get
public ICacheElement<K,V> get(K key)
throws IOException
- Parameters:
key -
- Returns:
- ICacheElement
- Throws:
IOException
getMatching
public Map<K,ICacheElement<K,V>> getMatching(String pattern)
throws IOException
- Parameters:
pattern -
- Returns:
- Map
- Throws:
IOException
getMultiple
public Map<K,ICacheElement<K,V>> getMultiple(Set<K> keys)
- Gets multiple items from the cache based on the given set of keys.
- Parameters:
keys -
- Returns:
- a map of K key to ICacheElement element, or an empty map if there is no
data in cache for any of these keys
remove
public boolean remove(K key)
throws IOException
- Parameters:
key -
- Returns:
- boolean
- Throws:
IOException
removeAll
public void removeAll()
throws IOException
- Throws:
IOException
dispose
public void dispose()
throws IOException
- Throws:
IOException
getSize
public int getSize()
- Returns:
- int
getStatus
public CacheStatus getStatus()
- Returns:
- int
getCacheName
public String getCacheName()
- Returns:
- null
getGroupKeys
public Set<K> getGroupKeys(String group)
throws IOException
- Parameters:
group -
- Returns:
- null
- Throws:
IOException
getGroupNames
public Set<String> getGroupNames()
throws IOException
- Returns:
- null
- Throws:
IOException
getStatistics
public IStats getStatistics()
- Returns:
- null
getStats
public String getStats()
- Returns:
- null
getCacheType
public ICacheType.CacheType getCacheType()
- Returns:
- cacheType
getAuxiliaryCacheAttributes
public AuxiliaryCacheAttributes getAuxiliaryCacheAttributes()
- Returns:
- Returns the AuxiliaryCacheAttributes.
getEventLoggingExtraInfo
public String getEventLoggingExtraInfo()
- Specified by:
getEventLoggingExtraInfo in class AbstractAuxiliaryCache<K extends Serializable,V extends Serializable>
- Returns:
- null
Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.