package br.ufrgs.inf.prosoft.adaptivecaching.cachemanager.model;


import br.ufrgs.inf.prosoft.adaptivecaching.cachemanager.extensions.guava.GuavaCacheManager;

import java.util.Collection;

//Available implementations: AbstractCacheManager, AbstractTransactionSupportingCacheManager, CaffeineCacheManager,
//        CompositeCacheManager, ConcurrentMapCacheManager, EhCacheCacheManager, GuavaCacheManager, JCacheCacheManager,
//        NoOpCacheManager, SimpleCacheManager, TransactionAwareCacheManagerProxy

/**
 * The type Adaptive cache manager.
 */
//For future use, do not use it yet
@Deprecated
public class AdaptiveCacheManager implements CacheManager {

    private CacheManager cacheManager;

    /**
     * Instantiates a new Adaptive cache manager.
     */
    public AdaptiveCacheManager() {
        this(new GuavaCacheManager());
    }

    /**
     * Instantiates a new Adaptive cache manager.
     *
     * @param cacheManager the cache manager
     */
    public AdaptiveCacheManager(CacheManager cacheManager) {
        this.cacheManager = cacheManager;
    }

    /**
     * Gets cache manager.
     *
     * @return the cache manager
     */
    public CacheManager getCacheManager() {
        return this.cacheManager;
    }

    @Override
    public Cache getCache(String s) {
        return this.cacheManager.getCache(s);
    }

    @Override
    public Collection<String> getCacheNames() {
        return this.cacheManager.getCacheNames();
    }
}
