// Path: kraken_lib/src/main/java/com/github/marcosalis/kraken/cache/SecondLevelCache.java
// public enum ClearMode {
//     ALL,
//     EVICT_OLD
// }
// 
// Path: kraken_lib/src/main/java/com/github/marcosalis/kraken/cache/proxies/ContentProxy.java
// @Beta
// public interface ContentProxy {
// 
//     /**
//      * Completely clears the memory cache of this content manager.
//      */
//     public void clearMemoryCache();
// 
//     /**
//      * Synchronously clears permanent storage (DB or flash disk) cache items of this content proxy
//      * according to the passed {@link SimpleDiskCache.ClearMode}
//      */
//     public void clearDiskCache(SimpleDiskCache.ClearMode mode);
// 
//     /**
//      * Completely wipes any permanent storage (DB or flash disk) cache for this content proxy.
//      *
//      * Note: implementations must be asynchronous and non-blocking.
//      */
//     public void scheduleClearDiskCache();
// 
//     /**
//      * Synchronously wipe any kind of cache for this content proxy.
//      */
//     public void clearCache();
// 
// }


import android.app.Application;
import android.support.annotation.NonNull;
import com.github.marcosalis.kraken.cache.SecondLevelCache.ClearMode;
import com.github.marcosalis.kraken.cache.proxies.ContentProxy;
import com.google.common.annotations.Beta;
/*
 * Copyright 2013 Luluvise Ltd
 * Copyright 2013 Marco Salis - fast3r(at)gmail.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.marcosalis.kraken.cache.managers;



/**
 * General interface for an application global contents manager.<br> Provides methods to put and get
 * global content managers from a single endpoint, and utility functionalities to clear and manage
 * their caches.
 *
 * Can be used to allow dependencies injection when accessing a content manager.
 *
 * @param <E> The content identificator
 * @author Marco Salis
 * @since 1.0
 */
@Beta
public interface CachesManager<E> {

    /**
     * Register a content proxy into the manager.<br> This should only be done once, preferably in
     * the {@link Application#onCreate()} method.
     *
     * @param contentId The content proxy identificator object (preferably a String or an enum
     *                  type)
     * @param content   The content proxy instance
     * @return true if the content proxy was successfully added, false if another cache is already
     * registered with the same ID
     */
// Path: kraken_lib/src/main/java/com/github/marcosalis/kraken/cache/SecondLevelCache.java
// public enum ClearMode {
//     ALL,
//     EVICT_OLD
// }
// 
// Path: kraken_lib/src/main/java/com/github/marcosalis/kraken/cache/proxies/ContentProxy.java
// @Beta
// public interface ContentProxy {
// 
//     /**
//      * Completely clears the memory cache of this content manager.
//      */
//     public void clearMemoryCache();
// 
//     /**
//      * Synchronously clears permanent storage (DB or flash disk) cache items of this content proxy
//      * according to the passed {@link SimpleDiskCache.ClearMode}
//      */
//     public void clearDiskCache(SimpleDiskCache.ClearMode mode);
// 
//     /**
//      * Completely wipes any permanent storage (DB or flash disk) cache for this content proxy.
//      *
//      * Note: implementations must be asynchronous and non-blocking.
//      */
//     public void scheduleClearDiskCache();
// 
//     /**
//      * Synchronously wipe any kind of cache for this content proxy.
//      */
//     public void clearCache();
// 
// }


// Path: kraken_lib/src/main/java/com/github/marcosalis/kraken/cache/managers/CachesManager.java
import android.app.Application;
import android.support.annotation.NonNull;
import com.github.marcosalis.kraken.cache.SecondLevelCache.ClearMode;
import com.github.marcosalis.kraken.cache.proxies.ContentProxy;
import com.google.common.annotations.Beta;

/*
 * Copyright 2013 Luluvise Ltd
 * Copyright 2013 Marco Salis - fast3r(at)gmail.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.marcosalis.kraken.cache.managers;



/**
 * General interface for an application global contents manager.<br> Provides methods to put and get
 * global content managers from a single endpoint, and utility functionalities to clear and manage
 * their caches.
 *
 * Can be used to allow dependencies injection when accessing a content manager.
 *
 * @param <E> The content identificator
 * @author Marco Salis
 * @since 1.0
 */
@Beta
public interface CachesManager<E> {

    /**
     * Register a content proxy into the manager.<br> This should only be done once, preferably in
     * the {@link Application#onCreate()} method.
     *
     * @param contentId The content proxy identificator object (preferably a String or an enum
     *                  type)
     * @param content   The content proxy instance
     * @return true if the content proxy was successfully added, false if another cache is already
     * registered with the same ID
     */
    public boolean registerContent(@NonNull E contentId, @NonNull ContentProxy content);