Class RemoteHttpCacheClient<K,V> 
java.lang.Object
org.apache.commons.jcs3.auxiliary.remote.http.client.RemoteHttpCacheClient<K,V> 
- All Implemented Interfaces:
- Remote,- IRemoteHttpCacheClient<K,,- V> - ICacheService<K,,- V> - ICacheServiceNonLocal<K,- V> 
This is the service used by the remote http auxiliary cache.
- 
Constructor SummaryConstructorsConstructorDescriptionFor factory construction.RemoteHttpCacheClient(RemoteHttpCacheAttributes attributes) Constructs a client.
- 
Method SummaryModifier and TypeMethodDescriptionvoidFrees the specified cache.Create a request, process, extract the payload.Create a request, process, extract the payload.Return the keys in this cache.Map<K,ICacheElement<K, V>> getMatching(String cacheName, String pattern) Gets multiple items from the cache matching the pattern.Map<K,ICacheElement<K, V>> getMatching(String cacheName, String pattern, long requesterId) Gets multiple items from the cache matching the pattern.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.voidinitialize(RemoteHttpCacheAttributes attributes) The provides an extension point.booleanisAlive()Make and alive request.protected booleanvoidrelease()Frees the specified cache.voidRemoves the given key from the specified cache.voidRemoves the given key from the specified cache.voidRemove all keys from the specified cache.voidRemove all keys from the specified cache.protected voidsetInitialized(boolean initialized) voidsetRemoteDispatcher(IRemoteCacheDispatcher remoteDispatcher) voidsetRemoteHttpCacheAttributes(RemoteHttpCacheAttributes remoteHttpCacheAttributes) voidupdate(ICacheElement<K, V> item) Puts a cache item to the cache.voidupdate(ICacheElement<K, V> cacheElement, long requesterId) Puts a cache item to the cache.
- 
Constructor Details- 
RemoteHttpCacheClientpublic RemoteHttpCacheClient()For factory construction.
- 
RemoteHttpCacheClientConstructs a client.- Parameters:
- attributes-
 
 
- 
- 
Method Details- 
initializeThe provides an extension point. If you want to extend this and use a special dispatcher, here is the place to do it.- Specified by:
- initializein interface- IRemoteHttpCacheClient<K,- V> 
- Parameters:
- attributes-
 
- 
getCreate a request, process, extract the payload.- Specified by:
- getin interface- ICacheService<K,- V> 
- Parameters:
- cacheName-
- key-
- Returns:
- ICacheElement
- Throws:
- IOException
 
- 
getCreate a request, process, extract the payload.- Specified by:
- getin interface- ICacheServiceNonLocal<K,- V> 
- Parameters:
- cacheName-
- key-
- requesterId-
- Returns:
- ICacheElement
- Throws:
- IOException
 
- 
getMatchingGets multiple items from the cache matching the pattern.- Specified by:
- getMatchingin interface- ICacheService<K,- V> 
- Parameters:
- cacheName-
- pattern-
- Returns:
- a map of K key to ICacheElement<K, V> element, or an empty map if there is no data in cache matching the pattern.
- Throws:
- IOException
 
- 
getMatchingpublic Map<K,ICacheElement<K, getMatchingV>> (String cacheName, String pattern, long requesterId) throws IOException Gets multiple items from the cache matching the pattern.- Specified by:
- getMatchingin interface- ICacheServiceNonLocal<K,- V> 
- Parameters:
- cacheName-
- pattern-
- requesterId-
- Returns:
- a map of K key to ICacheElement<K, V> element, or an empty map if there is no data in cache matching the pattern.
- Throws:
- IOException
 
- 
getMultipleGets multiple items from the cache based on the given set of keys.- Specified by:
- getMultiplein interface- ICacheService<K,- V> 
- Parameters:
- cacheName-
- keys-
- Returns:
- a map of K key to ICacheElement<K, V> element, or an empty map if there is no data in cache for any of these keys
- Throws:
- IOException
 
- 
getMultiplepublic Map<K,ICacheElement<K, getMultipleV>> (String cacheName, Set<K> keys, long requesterId) throws IOException Gets multiple items from the cache based on the given set of keys.- Specified by:
- getMultiplein interface- ICacheServiceNonLocal<K,- V> 
- Parameters:
- cacheName-
- keys-
- requesterId-
- Returns:
- a map of K key to ICacheElement<K, V> element, or an empty map if there is no data in cache for any of these keys
- Throws:
- IOException
 
- 
removeRemoves the given key from the specified cache.- Specified by:
- removein interface- ICacheService<K,- V> 
- Parameters:
- cacheName-
- key-
- Throws:
- IOException
 
- 
removeRemoves the given key from the specified cache.- Specified by:
- removein interface- ICacheServiceNonLocal<K,- V> 
- Parameters:
- cacheName-
- key-
- requesterId-
- Throws:
- IOException
 
- 
removeAllRemove all keys from the specified cache.- Specified by:
- removeAllin interface- ICacheService<K,- V> 
- Parameters:
- cacheName-
- Throws:
- IOException
 
- 
removeAllRemove all keys from the specified cache.- Specified by:
- removeAllin interface- ICacheServiceNonLocal<K,- V> 
- Parameters:
- cacheName-
- requesterId-
- Throws:
- IOException
 
- 
updatePuts a cache item to the cache.- Specified by:
- updatein interface- ICacheService<K,- V> 
- Parameters:
- item-
- Throws:
- IOException
 
- 
updatePuts a cache item to the cache.- Specified by:
- updatein interface- ICacheServiceNonLocal<K,- V> 
- Parameters:
- cacheElement-
- requesterId-
- Throws:
- IOException
 
- 
disposeFrees the specified cache.- Specified by:
- disposein interface- ICacheService<K,- V> 
- Parameters:
- cacheName-
- Throws:
- IOException
 
- 
releaseFrees the specified cache.- Specified by:
- releasein interface- ICacheService<K,- V> 
- Throws:
- IOException
 
- 
getKeySetReturn the keys in this cache.- Specified by:
- getKeySetin interface- ICacheServiceNonLocal<K,- V> 
- Parameters:
- cacheName- the name of the cache
- Returns:
- a set of the key type TODO This should probably be done in chunks with a range passed in. This will be a problem if someone puts a 1,000,000 or so items in a region.
- Throws:
- IOException
- See Also:
 
- 
isAliveMake and alive request.- Specified by:
- isAlivein interface- IRemoteHttpCacheClient<K,- V> 
- Returns:
- true if we make a successful alive request.
- Throws:
- IOException
 
- 
setRemoteDispatcher- Parameters:
- remoteDispatcher- the remoteDispatcher to set
 
- 
getRemoteDispatcher- Returns:
- the remoteDispatcher
 
- 
setRemoteHttpCacheAttributes- Parameters:
- remoteHttpCacheAttributes- the remoteHttpCacheAttributes to set
 
- 
getRemoteHttpCacheAttributes- Returns:
- the remoteHttpCacheAttributes
 
- 
setInitialized- Parameters:
- initialized- the initialized to set
 
- 
isInitialized- Returns:
- the initialized
 
 
-