// Path: erp-library/src/main/java/com.jukusoft/erp/lib/cache/impl/DefaultCacheManager.java
// public class DefaultCacheManager implements CacheManager {
// 
//     //local cache directory
//     protected File localCacheDir = null;
// 
//     //instance of hazelcast
//     protected HazelcastInstance hazelcastInstance = null;
// 
//     //instance of logger
//     protected ILogging logger = null;
// 
//     //map with all cache instances
//     protected Map<String,ICache> cacheMap = new ConcurrentHashMap<>();
// 
//     public DefaultCacheManager (File localCacheDir, HazelcastInstance hazelcastInstance, ILogging logger) {
//         this.localCacheDir = localCacheDir;
//         this.hazelcastInstance = hazelcastInstance;
//         this.logger = logger;
//     }
// 
//     @Override
//     public ICache getCache(String cacheName) {
//         return this.cacheMap.get(cacheName);
//     }
// 
//     @Override
//     public ICache getOrCreateCache(String cacheName, CacheTypes cacheType) {
//         //check, if cache is present
//         if (this.containsCache(cacheName)) {
//             //get cache
//             return this.getCache(cacheName);
//         } else {
//             //create new cache
//             return this.createCache(cacheName, cacheType);
//         }
//     }
// 
//     @Override
//     public boolean containsCache(String cacheName) {
//         return this.getCache(cacheName) != null;
//     }
// 
//     @Override
//     public ICache createCache(String cacheName, CacheTypes type) {
//         //first check, if cache already exists
//         if (this.getCache(cacheName) != null) {
//             throw new IllegalStateException("cache '" + cacheName + "' does already exists.");
//         }
// 
//         ICache cache = null;
// 
//         switch (type) {
//             case FILE_CACHE:
//                 cache = new FileSystemCache(localCacheDir.getAbsolutePath() + "/" + cacheName.toLowerCase() + "/", cacheName, this.logger);
//                 break;
// 
//             case LOCAL_MEMORY_CACHE:
//                 cache = new LocalMemoryCache(this.logger);
//                 break;
// 
//             case HAZELCAST_CACHE:
//                 cache = new HazelcastCache(this.hazelcastInstance, cacheName, this.logger);
//                 break;
// 
//             default:
//                 throw new IllegalArgumentException("Unknown cache type: " + type);
//         }
// 
//         this.cacheMap.put(cacheName, cache);
// 
//         return cache;
//     }
// 
//     @Override
//     public void removeCache(String cacheName) {
//         ICache cache = this.getCache(cacheName);
// 
//         //remove cache from map
//         this.cacheMap.remove(cacheName);
// 
//         //cleanUp cache if neccessary
//         if (cache != null) {
//             cache.cleanUp();
//         }
//     }
// 
//     @Override
//     public List<String> listCacheNames() {
//         List<String> list = new ArrayList<>();
// 
//         for (Map.Entry<String,ICache> entry : this.cacheMap.entrySet()) {
//             //add cache name to list
//             list.add(entry.getKey());
//         }
// 
//         return list;
//     }
// 
//     @Override
//     public void cleanUp() {
//         for (Map.Entry<String,ICache> entry : this.cacheMap.entrySet()) {
//             entry.getValue().cleanUp();
//         }
//     }
// 
// }
// 
// Path: erp-library/src/main/java/com.jukusoft/erp/lib/logging/ILogging.java
// public interface ILogging {
// 
//     public void debug (long messageID, String tag, String message);
// 
//     public void debug (String tag, String message);
// 
//     public void info (long messageID, String tag, String message);
// 
//     public void info (String tag, String message);
// 
//     public void warn (long messageID, String tag, String message);
// 
//     public void warn (String tag, String message);
// 
//     public void error (long messageID, String tag, String message);
// 
//     public void error (String tag, String message);
// 
// }


import com.hazelcast.core.HazelcastInstance;
import com.jukusoft.erp.lib.cache.impl.DefaultCacheManager;
import com.jukusoft.erp.lib.logging.ILogging;
import java.io.File;
import java.util.List;
package com.jukusoft.erp.lib.cache;



public interface CacheManager {

    /**
    * get instance of cache
     *
     * @param cacheName name of cache
     *
     * @return instance of cache or null, if cache doesnt exists
    */
    public ICache getCache (String cacheName);

    /**
     * get instance of cache or create an new one, if cache doesnt exists
     *
     * @param cacheName name of cache
     *
     * @return instance of cache or null, if cache doesnt exists
     */
    public ICache getOrCreateCache (String cacheName, CacheTypes cacheType);

    /**
    * check, if cache is present
     *
     * @param cacheName name of cache
    */
    public boolean containsCache (String cacheName);

    /**
    * crate an new cache instance
     *
     * @param cacheName name of cache
     * @param type type of cache
     *
     * @return instance of new cache
    */
    public ICache createCache (String cacheName, CacheTypes type);

    /**
    * remove cache and cleanup values
     *
     * @param cacheName name of cache
    */
    public void removeCache (String cacheName);

    /**
    * list names of all caches
     *
     * @return list with all cache names
    */
    public List<String> listCacheNames ();

    /**
    * clean up outdated entries from all caches
    */
    public void cleanUp ();

    /**
    * create default cache manager
     *
     * @param localCacheDir local cache directory
     * @param hazelcastInstance instance of hazelcast
    */
// Path: erp-library/src/main/java/com.jukusoft/erp/lib/cache/impl/DefaultCacheManager.java
// public class DefaultCacheManager implements CacheManager {
// 
//     //local cache directory
//     protected File localCacheDir = null;
// 
//     //instance of hazelcast
//     protected HazelcastInstance hazelcastInstance = null;
// 
//     //instance of logger
//     protected ILogging logger = null;
// 
//     //map with all cache instances
//     protected Map<String,ICache> cacheMap = new ConcurrentHashMap<>();
// 
//     public DefaultCacheManager (File localCacheDir, HazelcastInstance hazelcastInstance, ILogging logger) {
//         this.localCacheDir = localCacheDir;
//         this.hazelcastInstance = hazelcastInstance;
//         this.logger = logger;
//     }
// 
//     @Override
//     public ICache getCache(String cacheName) {
//         return this.cacheMap.get(cacheName);
//     }
// 
//     @Override
//     public ICache getOrCreateCache(String cacheName, CacheTypes cacheType) {
//         //check, if cache is present
//         if (this.containsCache(cacheName)) {
//             //get cache
//             return this.getCache(cacheName);
//         } else {
//             //create new cache
//             return this.createCache(cacheName, cacheType);
//         }
//     }
// 
//     @Override
//     public boolean containsCache(String cacheName) {
//         return this.getCache(cacheName) != null;
//     }
// 
//     @Override
//     public ICache createCache(String cacheName, CacheTypes type) {
//         //first check, if cache already exists
//         if (this.getCache(cacheName) != null) {
//             throw new IllegalStateException("cache '" + cacheName + "' does already exists.");
//         }
// 
//         ICache cache = null;
// 
//         switch (type) {
//             case FILE_CACHE:
//                 cache = new FileSystemCache(localCacheDir.getAbsolutePath() + "/" + cacheName.toLowerCase() + "/", cacheName, this.logger);
//                 break;
// 
//             case LOCAL_MEMORY_CACHE:
//                 cache = new LocalMemoryCache(this.logger);
//                 break;
// 
//             case HAZELCAST_CACHE:
//                 cache = new HazelcastCache(this.hazelcastInstance, cacheName, this.logger);
//                 break;
// 
//             default:
//                 throw new IllegalArgumentException("Unknown cache type: " + type);
//         }
// 
//         this.cacheMap.put(cacheName, cache);
// 
//         return cache;
//     }
// 
//     @Override
//     public void removeCache(String cacheName) {
//         ICache cache = this.getCache(cacheName);
// 
//         //remove cache from map
//         this.cacheMap.remove(cacheName);
// 
//         //cleanUp cache if neccessary
//         if (cache != null) {
//             cache.cleanUp();
//         }
//     }
// 
//     @Override
//     public List<String> listCacheNames() {
//         List<String> list = new ArrayList<>();
// 
//         for (Map.Entry<String,ICache> entry : this.cacheMap.entrySet()) {
//             //add cache name to list
//             list.add(entry.getKey());
//         }
// 
//         return list;
//     }
// 
//     @Override
//     public void cleanUp() {
//         for (Map.Entry<String,ICache> entry : this.cacheMap.entrySet()) {
//             entry.getValue().cleanUp();
//         }
//     }
// 
// }
// 
// Path: erp-library/src/main/java/com.jukusoft/erp/lib/logging/ILogging.java
// public interface ILogging {
// 
//     public void debug (long messageID, String tag, String message);
// 
//     public void debug (String tag, String message);
// 
//     public void info (long messageID, String tag, String message);
// 
//     public void info (String tag, String message);
// 
//     public void warn (long messageID, String tag, String message);
// 
//     public void warn (String tag, String message);
// 
//     public void error (long messageID, String tag, String message);
// 
//     public void error (String tag, String message);
// 
// }


// Path: erp-library/src/main/java/com.jukusoft/erp/lib/cache/CacheManager.java
import com.hazelcast.core.HazelcastInstance;
import com.jukusoft.erp.lib.cache.impl.DefaultCacheManager;
import com.jukusoft.erp.lib.logging.ILogging;
import java.io.File;
import java.util.List;

package com.jukusoft.erp.lib.cache;



public interface CacheManager {

    /**
    * get instance of cache
     *
     * @param cacheName name of cache
     *
     * @return instance of cache or null, if cache doesnt exists
    */
    public ICache getCache (String cacheName);

    /**
     * get instance of cache or create an new one, if cache doesnt exists
     *
     * @param cacheName name of cache
     *
     * @return instance of cache or null, if cache doesnt exists
     */
    public ICache getOrCreateCache (String cacheName, CacheTypes cacheType);

    /**
    * check, if cache is present
     *
     * @param cacheName name of cache
    */
    public boolean containsCache (String cacheName);

    /**
    * crate an new cache instance
     *
     * @param cacheName name of cache
     * @param type type of cache
     *
     * @return instance of new cache
    */
    public ICache createCache (String cacheName, CacheTypes type);

    /**
    * remove cache and cleanup values
     *
     * @param cacheName name of cache
    */
    public void removeCache (String cacheName);

    /**
    * list names of all caches
     *
     * @return list with all cache names
    */
    public List<String> listCacheNames ();

    /**
    * clean up outdated entries from all caches
    */
    public void cleanUp ();

    /**
    * create default cache manager
     *
     * @param localCacheDir local cache directory
     * @param hazelcastInstance instance of hazelcast
    */
    public static CacheManager createDefaultCacheManager (File localCacheDir, HazelcastInstance hazelcastInstance, ILogging logger) {