org.opencms.xml.containerpage
Class CmsADECache

java.lang.Object
  extended by org.opencms.cache.CmsVfsCache
      extended by org.opencms.xml.containerpage.CmsADECache
All Implemented Interfaces:
I_CmsEventListener

public final class CmsADECache
extends CmsVfsCache

Cache object instance for simultaneously cache online and offline items.

Since:
7.6

Field Summary
 
Fields inherited from interface org.opencms.main.I_CmsEventListener
EVENT_BEFORE_PUBLISH_PROJECT, EVENT_CLEAR_CACHES, EVENT_CLEAR_OFFLINE_CACHES, EVENT_CLEAR_ONLINE_CACHES, EVENT_CLEAR_PRINCIPAL_CACHES, EVENT_FLEX_CACHE_CLEAR, EVENT_FLEX_PURGE_JSP_REPOSITORY, EVENT_FULLSTATIC_EXPORT, EVENT_GROUP_MODIFIED, EVENT_LOGIN_USER, EVENT_OU_MODIFIED, EVENT_PROJECT_MODIFIED, EVENT_PROPERTY_DEFINITION_CREATED, EVENT_PROPERTY_DEFINITION_MODIFIED, EVENT_PROPERTY_MODIFIED, EVENT_PUBLISH_PROJECT, EVENT_REBUILD_SEARCHINDEXES, EVENT_RESOURCE_AND_PROPERTIES_MODIFIED, EVENT_RESOURCE_COPIED, EVENT_RESOURCE_CREATED, EVENT_RESOURCE_DELETED, EVENT_RESOURCE_MODIFIED, EVENT_RESOURCE_MOVED, EVENT_RESOURCES_AND_PROPERTIES_MODIFIED, EVENT_RESOURCES_MODIFIED, EVENT_SITEMAP_CHANGED, EVENT_UPDATE_EXPORTS, EVENT_USER_MODIFIED, KEY_CHANGE, KEY_DBCONTEXT, KEY_GROUP_ID, KEY_GROUP_NAME, KEY_INDEX_NAMES, KEY_OU_ID, KEY_OU_NAME, KEY_PROJECTID, KEY_PUBLISHID, KEY_PUBLISHLIST, KEY_REPORT, KEY_RESOURCE, KEY_RESOURCES, KEY_USER_ACTION, KEY_USER_ID, KEY_USER_NAME, LISTENERS_FOR_ALL_EVENTS, VALUE_GROUP_MODIFIED_ACTION_CREATE, VALUE_GROUP_MODIFIED_ACTION_DELETE, VALUE_GROUP_MODIFIED_ACTION_WRITE, VALUE_OU_MODIFIED_ACTION_CREATE, VALUE_OU_MODIFIED_ACTION_DELETE, VALUE_USER_MODIFIED_ACTION_ADD_USER_TO_GROUP, VALUE_USER_MODIFIED_ACTION_CREATE_USER, VALUE_USER_MODIFIED_ACTION_DELETE_USER, VALUE_USER_MODIFIED_ACTION_REMOVE_USER_FROM_GROUP, VALUE_USER_MODIFIED_ACTION_RESET_PASSWORD, VALUE_USER_MODIFIED_ACTION_SET_OU, VALUE_USER_MODIFIED_ACTION_WRITE_USER
 
Constructor Summary
CmsADECache(CmsMemoryMonitor memMonitor, CmsADECacheSettings cacheSettings)
          Initializes the cache.
 
Method Summary
protected  void flush(boolean online)
          Flushes the caches.
 void flushContainerPages(boolean online)
          Flushes the container pages cache.
 void flushGroupContainers(boolean online)
          Flushes the group containers cache.
 CmsXmlContainerPage getCacheContainerPage(String key, boolean online)
          Returns the cached container page under the given key and for the given project.
 CmsXmlGroupContainer getCacheGroupContainer(String key, boolean online)
          Returns the cached group container under the given key and for the given project.
 String getCacheKey(CmsUUID structureId, boolean keepEncoding)
          Returns the cache key for the given parameters.
 void setCacheContainerPage(String key, CmsXmlContainerPage containerPage, boolean online)
          Caches the given container page under the given key and for the given project.
 void setCacheGroupContainer(String key, CmsXmlGroupContainer groupContainer, boolean online)
          Caches the given group container under the given key and for the given project.
 void uncacheContainerPage(CmsUUID structureId, boolean online)
          Removes the container page identified by its structure id from the cache.
 void uncacheGroupContainer(CmsUUID structureId, boolean online)
          Removes the group container identified by its structure id from the cache.
protected  void uncacheResource(CmsResource resource)
          Removes a cached resource from the cache.
 
Methods inherited from class org.opencms.cache.CmsVfsCache
cmsEvent, registerEventListener, shutdown, uncacheResources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsADECache

public CmsADECache(CmsMemoryMonitor memMonitor,
                   CmsADECacheSettings cacheSettings)
Initializes the cache. Only intended to be called during startup.

Parameters:
memMonitor - the memory monitor instance
cacheSettings - the system cache settings
See Also:
OpenCmsCore.initConfiguration(org.opencms.configuration.CmsParameterConfiguration)
Method Detail

flushContainerPages

public void flushContainerPages(boolean online)
Flushes the container pages cache.

Parameters:
online - if to flush the online or offline cache

flushGroupContainers

public void flushGroupContainers(boolean online)
Flushes the group containers cache.

Parameters:
online - if to flush the online or offline cache

getCacheContainerPage

public CmsXmlContainerPage getCacheContainerPage(String key,
                                                 boolean online)
Returns the cached container page under the given key and for the given project.

Parameters:
key - the cache key
online - if cached in online or offline project
Returns:
the cached container page or null if not found

getCacheGroupContainer

public CmsXmlGroupContainer getCacheGroupContainer(String key,
                                                   boolean online)
Returns the cached group container under the given key and for the given project.

Parameters:
key - the cache key
online - if cached in online or offline project
Returns:
the cached group container or null if not found

getCacheKey

public String getCacheKey(CmsUUID structureId,
                          boolean keepEncoding)
Returns the cache key for the given parameters.

Parameters:
structureId - the container page's structure id
keepEncoding - if to keep the encoding while unmarshalling
Returns:
the cache key for the given container page and parameters

setCacheContainerPage

public void setCacheContainerPage(String key,
                                  CmsXmlContainerPage containerPage,
                                  boolean online)
Caches the given container page under the given key and for the given project.

Parameters:
key - the cache key
containerPage - the object to cache
online - if to cache in online or offline project

setCacheGroupContainer

public void setCacheGroupContainer(String key,
                                   CmsXmlGroupContainer groupContainer,
                                   boolean online)
Caches the given group container under the given key and for the given project.

Parameters:
key - the cache key
groupContainer - the object to cache
online - if to cache in online or offline project

uncacheContainerPage

public void uncacheContainerPage(CmsUUID structureId,
                                 boolean online)
Removes the container page identified by its structure id from the cache.

Parameters:
structureId - the container page's structure id
online - if online or offline

uncacheGroupContainer

public void uncacheGroupContainer(CmsUUID structureId,
                                  boolean online)
Removes the group container identified by its structure id from the cache.

Parameters:
structureId - the group container's structure id
online - if online or offline

flush

protected void flush(boolean online)
Description copied from class: CmsVfsCache
Flushes the caches.

Specified by:
flush in class CmsVfsCache
Parameters:
online - if to flush the online or offline caches
See Also:
CmsVfsCache.flush(boolean)

uncacheResource

protected void uncacheResource(CmsResource resource)
Description copied from class: CmsVfsCache
Removes a cached resource from the cache.

Specified by:
uncacheResource in class CmsVfsCache
Parameters:
resource - the resource
See Also:
CmsVfsCache.uncacheResource(org.opencms.file.CmsResource)