Package com.networknt.aws.lambda.cache
Class DynamoDbCacheManager
- java.lang.Object
-
- com.networknt.aws.lambda.cache.DynamoDbCacheManager
-
- All Implemented Interfaces:
com.networknt.cache.CacheManager
public class DynamoDbCacheManager extends Object implements com.networknt.cache.CacheManager
This is the cache manager that can survive the cold start of the lambda function.
-
-
Constructor Summary
Constructors Constructor Description DynamoDbCacheManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCache(String cacheName, long maxSize, long expiryInMinutes)static Map<Object,Object>convertMap(Map<String,Object> originalMap)voiddelete(String cacheName, String key)voiddeleteTable(String tableName)DEBUG FUNCTION - will be changed or deprecated in the future.booleandoesTableExist(String tableName)Checks to see if the table exists.Objectget(String cacheName, String key)Map<Object,Object>getCache(String cacheName)intgetSize(String cacheName)voidput(String cacheName, String key, Object value)voidremoveCache(String cacheName)
-
-
-
Method Detail
-
addCache
public void addCache(String cacheName, long maxSize, long expiryInMinutes)
- Specified by:
addCachein interfacecom.networknt.cache.CacheManager
-
getCache
public Map<Object,Object> getCache(String cacheName)
- Specified by:
getCachein interfacecom.networknt.cache.CacheManager
-
put
public void put(String cacheName, String key, Object value)
- Specified by:
putin interfacecom.networknt.cache.CacheManager
-
get
public Object get(String cacheName, String key)
- Specified by:
getin interfacecom.networknt.cache.CacheManager
-
delete
public void delete(String cacheName, String key)
- Specified by:
deletein interfacecom.networknt.cache.CacheManager
-
removeCache
public void removeCache(String cacheName)
- Specified by:
removeCachein interfacecom.networknt.cache.CacheManager
-
getSize
public int getSize(String cacheName)
- Specified by:
getSizein interfacecom.networknt.cache.CacheManager
-
deleteTable
public void deleteTable(String tableName) throws InterruptedException
DEBUG FUNCTION - will be changed or deprecated in the future.- Parameters:
tableName- - name of the table- Throws:
InterruptedException- - exception
-
doesTableExist
public boolean doesTableExist(String tableName)
Checks to see if the table exists.- Parameters:
tableName- - name of the table- Returns:
- - returns true if the table exists
-
-