Class 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 Detail

      • DynamoDbCacheManager

        public DynamoDbCacheManager()
    • Method Detail

      • addCache

        public void addCache​(String cacheName,
                             long maxSize,
                             long expiryInMinutes)
        Specified by:
        addCache in interface com.networknt.cache.CacheManager
      • getCache

        public Map<Object,​Object> getCache​(String cacheName)
        Specified by:
        getCache in interface com.networknt.cache.CacheManager
      • put

        public void put​(String cacheName,
                        String key,
                        Object value)
        Specified by:
        put in interface com.networknt.cache.CacheManager
      • get

        public Object get​(String cacheName,
                          String key)
        Specified by:
        get in interface com.networknt.cache.CacheManager
      • delete

        public void delete​(String cacheName,
                           String key)
        Specified by:
        delete in interface com.networknt.cache.CacheManager
      • removeCache

        public void removeCache​(String cacheName)
        Specified by:
        removeCache in interface com.networknt.cache.CacheManager
      • getSize

        public int getSize​(String cacheName)
        Specified by:
        getSize in interface com.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