Package nl.nn.adapterframework.http.rest
Interface IApiCache
-
- All Known Implementing Classes:
ApiEhcache
,ApiMemcached
public interface IApiCache
Etag (key-value) Cache interface, allowsRestListeners
andApiListeners
to save and retrieve etags.- Since:
- 7.0-B2
- Author:
- Niels Meijer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
Removes all items in the cache.boolean
containsKey(String key)
Checks whether or not an object has previously been stored in the cachevoid
destroy()
Closes the cache.Object
get(String key)
Retrieve an object from the cachevoid
put(String key, Object value)
Place an object in the cachevoid
put(String key, Object value, int ttl)
Place an object in the cacheboolean
remove(String key)
Remove an object from the cache
-
-
-
Method Detail
-
get
Object get(String key)
Retrieve an object from the cache- Parameters:
key
- name of the object to fetch- Returns:
- null or value of the stored object
-
put
void put(String key, Object value)
Place an object in the cache- Parameters:
key
- name of the object to storevalue
- value of the object
-
put
void put(String key, Object value, int ttl)
Place an object in the cache- Parameters:
key
- name of the object to storevalue
- value of the objectttl
- time to live, when the object expires
-
remove
boolean remove(String key)
Remove an object from the cache- Parameters:
key
- name of the object to remove- Returns:
- returns true when successfully removed the object
-
containsKey
boolean containsKey(String key)
Checks whether or not an object has previously been stored in the cache- Parameters:
key
- name of the object to find- Returns:
- true when found
-
clear
void clear()
Removes all items in the cache.
-
destroy
void destroy()
Closes the cache.
-
-