public abstract class AbstractRemoteCacheService<K,V> extends Object implements ICacheServiceNonLocal<K,V>
| Constructor and Description |
|---|
AbstractRemoteCacheService(ICompositeCacheManager cacheManager,
ICacheEventLogger cacheEventLogger)
Creates the super with the needed items.
|
| Modifier and Type | Method and Description |
|---|---|
protected ICacheEvent<ICacheElement<K,V>> |
createICacheEvent(ICacheElement<K,V> item,
long requesterId,
String eventName)
Logs an event if an event logger is configured.
|
protected <T> ICacheEvent<T> |
createICacheEvent(String cacheName,
T key,
long requesterId,
String eventName)
Logs an event if an event logger is configured.
|
void |
dispose(String cacheName)
Frees the specified remote cache.
|
void |
dispose(String cacheName,
long requesterId)
Frees the specified remote cache.
|
ICacheElement<K,V> |
get(String cacheName,
K key)
Returns a cache value from the specified remote cache; or null if the cache or key does not
exist.
|
ICacheElement<K,V> |
get(String cacheName,
K key,
long requesterId)
Returns a cache bean from the specified cache; or null if the key does not exist.
|
protected ICompositeCacheManager |
getCacheManager() |
protected String |
getEventLogSourceName() |
protected abstract String |
getExtraInfoForRequesterId(long requesterId)
Ip address for the client, if one is stored.
|
Set<K> |
getKeySet(String cacheName)
Return the keys in this cache.
|
Map<K,ICacheElement<K,V>> |
getMatching(String cacheName,
String pattern)
Gets all matching items.
|
Map<K,ICacheElement<K,V>> |
getMatching(String cacheName,
String pattern,
long requesterId)
Retrieves all matching keys.
|
Map<K,ICacheElement<K,V>> |
getMultiple(String cacheName,
Set<K> keys)
Gets multiple items from the cache based on the given set of keys.
|
Map<K,ICacheElement<K,V>> |
getMultiple(String cacheName,
Set<K> keys,
long requesterId)
Gets multiple items from the cache based on the given set of keys.
|
String |
getStats()
Gets the stats attribute of the RemoteCacheServer object.
|
protected void |
logApplicationEvent(String source,
String eventName,
String optionalDetails)
Logs an event if an event logger is configured.
|
protected <T> void |
logICacheEvent(ICacheEvent<T> cacheEvent)
Logs an event if an event logger is configured.
|
Set<K> |
processGetKeySet(String cacheName)
Gets the set of keys of objects currently in the cache.
|
void |
remove(String cacheName,
K key)
Removes the given key from the specified remote cache.
|
void |
remove(String cacheName,
K key,
long requesterId)
Remove the key from the cache region and don't tell the source listener about it.
|
void |
removeAll(String cacheName)
Remove all keys from the specified remote cache.
|
void |
removeAll(String cacheName,
long requesterId)
Remove all keys from the specified remote cache.
|
void |
setCacheEventLogger(ICacheEventLogger cacheEventLogger)
Allows it to be injected.
|
protected void |
setCacheManager(ICompositeCacheManager cacheManager) |
protected void |
setEventLogSourceName(String eventLogSourceName) |
void |
update(ICacheElement<K,V> item)
Puts a cache item to the cache.
|
void |
update(ICacheElement<K,V> item,
long requesterId)
The internal processing is wrapped in event logging calls.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreleasepublic AbstractRemoteCacheService(ICompositeCacheManager cacheManager, ICacheEventLogger cacheEventLogger)
cacheManager - cacheEventLogger - public void update(ICacheElement<K,V> item) throws IOException
ICacheServiceupdate in interface ICacheService<K,V>item - IOExceptionpublic void update(ICacheElement<K,V> item, long requesterId) throws IOException
update in interface ICacheServiceNonLocal<K,V>item - requesterId - IOExceptionpublic ICacheElement<K,V> get(String cacheName, K key) throws IOException
get in interface ICacheService<K,V>cacheName - key - IOExceptionpublic ICacheElement<K,V> get(String cacheName, K key, long requesterId) throws IOException
Adding the requestor id, allows the cache to determine the source of the get.
The internal processing is wrapped in event logging calls.
get in interface ICacheServiceNonLocal<K,V>cacheName - key - requesterId - IOExceptionpublic Map<K,ICacheElement<K,V>> getMatching(String cacheName, String pattern) throws IOException
getMatching in interface ICacheService<K,V>cacheName - pattern - IOExceptionpublic Map<K,ICacheElement<K,V>> getMatching(String cacheName, String pattern, long requesterId) throws IOException
getMatching in interface ICacheServiceNonLocal<K,V>cacheName - pattern - requesterId - IOExceptionpublic Map<K,ICacheElement<K,V>> getMultiple(String cacheName, Set<K> keys) throws IOException
getMultiple in interface ICacheService<K,V>cacheName - keys - IOExceptionpublic Map<K,ICacheElement<K,V>> getMultiple(String cacheName, Set<K> keys, long requesterId) throws IOException
The internal processing is wrapped in event logging calls.
getMultiple in interface ICacheServiceNonLocal<K,V>cacheName - keys - requesterId - IOExceptionpublic Set<K> getKeySet(String cacheName)
getKeySet in interface ICacheServiceNonLocal<K,V>cacheName - the name of the cacheAuxiliaryCache.getKeySet()public Set<K> processGetKeySet(String cacheName)
cacheName - public void remove(String cacheName, K key) throws IOException
remove in interface ICacheService<K,V>cacheName - key - IOExceptionpublic void remove(String cacheName, K key, long requesterId) throws IOException
The internal processing is wrapped in event logging calls.
remove in interface ICacheServiceNonLocal<K,V>cacheName - key - requesterId - IOExceptionpublic void removeAll(String cacheName) throws IOException
removeAll in interface ICacheService<K,V>cacheName - IOExceptionpublic void removeAll(String cacheName, long requesterId) throws IOException
The internal processing is wrapped in event logging calls.
removeAll in interface ICacheServiceNonLocal<K,V>cacheName - requesterId - IOExceptionpublic void dispose(String cacheName) throws IOException
dispose in interface ICacheService<K,V>cacheName - IOExceptionpublic void dispose(String cacheName, long requesterId) throws IOException
cacheName - requesterId - IOExceptionpublic String getStats() throws IOException
IOExceptionprotected ICacheEvent<ICacheElement<K,V>> createICacheEvent(ICacheElement<K,V> item, long requesterId, String eventName)
item - requesterId - eventName - protected <T> ICacheEvent<T> createICacheEvent(String cacheName, T key, long requesterId, String eventName)
cacheName - key - requesterId - eventName - protected void logApplicationEvent(String source, String eventName, String optionalDetails)
source - eventName - optionalDetails - protected <T> void logICacheEvent(ICacheEvent<T> cacheEvent)
cacheEvent - protected abstract String getExtraInfoForRequesterId(long requesterId)
Protected for testing.
requesterId - public void setCacheEventLogger(ICacheEventLogger cacheEventLogger)
cacheEventLogger - protected void setCacheManager(ICompositeCacheManager cacheManager)
cacheManager - the cacheManager to setprotected ICompositeCacheManager getCacheManager()
protected void setEventLogSourceName(String eventLogSourceName)
eventLogSourceName - the eventLogSourceName to setprotected String getEventLogSourceName()
Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.