001/*
002 * File   : $Source$
003 * Date   : $Date$
004 * Version: $Revision$
005 *
006 * This library is part of OpenCms -
007 * the Open Source Content Management System
008 *
009 * Copyright (C) 2002 - 2011 Alkacon Software (http://www.alkacon.com)
010 *
011 * This library is free software; you can redistribute it and/or
012 * modify it under the terms of the GNU Lesser General Public
013 * License as published by the Free Software Foundation; either
014 * version 2.1 of the License, or (at your option) any later version.
015 *
016 * This library is distributed in the hope that it will be useful,
017 * but WITHOUT ANY WARRANTY; without even the implied warranty of
018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019 * Lesser General Public License for more details.
020 *
021 * For further information about Alkacon Software, please see the
022 * company website: http://www.alkacon.com
023 *
024 * For further information about OpenCms, please see the
025 * project website: http://www.opencms.org
026 *
027 * You should have received a copy of the GNU Lesser General Public
028 * License along with this library; if not, write to the Free Software
029 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
030 */
031
032package org.opencms.ade.configuration;
033
034import org.opencms.db.CmsPublishedResource;
035import org.opencms.file.CmsResource;
036
037/**
038 * This is interface is intended to be used in combination with the {@link CmsGlobalConfigurationCacheEventHandler} class.<p>
039 *
040 * It provides several method which allow the mentioned event handler class to update the cache object implementing this
041 * interface.
042 */
043public interface I_CmsGlobalConfigurationCache {
044
045    /**
046     * Clears the cache.<p>
047     */
048    void clear();
049
050    /**
051     * Removes a published resource from the cache.<p>
052     *
053     * @param pubRes the published resource
054     */
055    void remove(CmsPublishedResource pubRes);
056
057    /**
058     * Removes a resource from the cache.<p>
059     *
060     * @param resource the resource to remove
061     */
062    void remove(CmsResource resource);
063
064    /**
065     * Updates the cache entry for the given published resource.<p>
066     *
067     * NOTE: Cache implementations should not directly read the updated resource in this method because it might interfere with other
068     * caches. Instead, the resource should be marked as updated and read the next time the cache is queried.
069     *
070     * @param pubRes a published resource
071     */
072    void update(CmsPublishedResource pubRes);
073
074    /**
075     * Updates the cache entry for the given resource.<p>
076     *
077     * NOTE: Cache implementations should not directly read the updated resource in this method because it might interfere with other
078     * caches. Instead, the resource should be marked as updated and read the next time the cache is queried.
079     *
080     * @param resource the resource for which the cache entry should be updated
081     */
082    void update(CmsResource resource);
083}