Class APIMCLICacheManager

  • All Implemented Interfaces:
    Closeable, AutoCloseable, org.ehcache.CacheManager

    public class APIMCLICacheManager
    extends Object
    implements org.ehcache.CacheManager
    • Constructor Detail

      • APIMCLICacheManager

        public APIMCLICacheManager​(org.ehcache.CacheManager cacheManager)
    • Method Detail

      • setEnabledCaches

        public void setEnabledCaches​(List<CacheType> enabledCaches)
      • close

        public void close()
                   throws org.ehcache.StateTransitionException
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface org.ehcache.CacheManager
        Specified by:
        close in interface Closeable
        Throws:
        org.ehcache.StateTransitionException
      • createCache

        public <K,​V> org.ehcache.Cache<K,​V> createCache​(String arg0,
                                                                    org.ehcache.config.CacheConfiguration<K,​V> arg1)
        Specified by:
        createCache in interface org.ehcache.CacheManager
      • createCache

        public <K,​V> org.ehcache.Cache<K,​V> createCache​(String arg0,
                                                                    org.ehcache.config.Builder<? extends org.ehcache.config.CacheConfiguration<K,​V>> arg1)
        Specified by:
        createCache in interface org.ehcache.CacheManager
      • getCache

        public <K,​V> org.ehcache.Cache<K,​V> getCache​(String alias,
                                                                 Class<K> keyType,
                                                                 Class<V> valueType)
        Specified by:
        getCache in interface org.ehcache.CacheManager
      • getRuntimeConfiguration

        public org.ehcache.config.Configuration getRuntimeConfiguration()
        Specified by:
        getRuntimeConfiguration in interface org.ehcache.CacheManager
      • getStatus

        public org.ehcache.Status getStatus()
        Specified by:
        getStatus in interface org.ehcache.CacheManager
      • init

        public void init()
                  throws org.ehcache.StateTransitionException
        Specified by:
        init in interface org.ehcache.CacheManager
        Throws:
        org.ehcache.StateTransitionException
      • removeCache

        public void removeCache​(String arg0)
        Specified by:
        removeCache in interface org.ehcache.CacheManager
      • flipApiId

        public void flipApiId​(String oldApiId,
                              String newApiId)
                       throws AppException
        There are a number of entities which have references to an API (e.g. QuotaRestrictions). These are stored/maintained with their own ID (quotaId) and cached in Ehcache. But, if the API-ID changes, the cached reference points to an API that no longer exists. This method is used to update all entities in the cache when the API ID of an API changes (e.g. with a Replace Action).
        Parameters:
        oldApiId - the ID currently used by the cached entities
        newApiId - the new ID that must be replaced
        Throws:
        AppException - when the cache cannot be updated.