org.opencms.ade.configuration
public class CmsGlobalConfigurationCacheEventHandler extends java.lang.Object implements I_CmsEventListener
I_CmsGlobalConfigurationCache
.
It keeps a list of cache instance pairs, each containing one cache for the online mode and one for the offline mode,
and handles events caused by changed resources by notifying the cache instances.
Note that *all* changed resources will get passed to the underlying cache instances, so those instances will need to check
whether the resource passed into the update or remove methods is actually a resource with which the cache instance is concerned.
This class should be used if you have an indefinite number of configuration files at arbitrary locations in the VFS.
If you need to cache e.g. a single configuration file with a known, fixed path, using CmsVfsMemoryObjectCache
is
easier.
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 and Description |
---|
CmsGlobalConfigurationCacheEventHandler(CmsObject onlineCms)
Creates a new cache event handler.
|
Modifier and Type | Method and Description |
---|---|
void |
addCache(I_CmsGlobalConfigurationCache offlineCache,
I_CmsGlobalConfigurationCache onlineCache,
java.lang.String debugName)
Adds a new pair of cache instances which should be managed by this event handler.
|
void |
cmsEvent(CmsEvent event)
Acknowledge the occurrence of the specified event, implement this
method to check for CmsEvents in your class.
|
protected void |
offlineCacheClear()
Clears the offline caches.
|
protected void |
offlineCacheRemove(CmsPublishedResource resource)
Removes a resource from the offline caches.
|
protected void |
offlineCacheRemove(CmsResource resource)
Removes a resource from the offline caches.
|
protected void |
offlineCacheUpdate(CmsPublishedResource resource)
Updates a resource in the offline caches.
|
protected void |
offlineCacheUpdate(CmsResource resource)
Updates a resource in the offline caches.
|
protected void |
onlineCacheClear()
Clears the online caches.
|
protected void |
onlineCacheRemove(CmsPublishedResource resource)
Removes a resource from the online caches.
|
protected void |
onlineCacheRemove(CmsResource resource)
Removes a resource from the online caches.
|
protected void |
onlineCacheUpdate(CmsPublishedResource resource)
Updates a resource in the online caches.
|
protected void |
onlineCacheUpdate(CmsResource resource)
Updates a resource in the online caches.
|
public CmsGlobalConfigurationCacheEventHandler(CmsObject onlineCms)
onlineCms
- an online CMS objectpublic void addCache(I_CmsGlobalConfigurationCache offlineCache, I_CmsGlobalConfigurationCache onlineCache, java.lang.String debugName)
offlineCache
- the offline cache instanceonlineCache
- the online cache instancedebugName
- an identifier used for debuggingpublic void cmsEvent(CmsEvent event)
I_CmsEventListener
cmsEvent
in interface I_CmsEventListener
event
- CmsEvent that has occurredI_CmsEventListener.cmsEvent(org.opencms.main.CmsEvent)
protected void offlineCacheClear()
protected void offlineCacheRemove(CmsPublishedResource resource)
resource
- the resource to removeprotected void offlineCacheRemove(CmsResource resource)
resource
- the resource to removeprotected void offlineCacheUpdate(CmsPublishedResource resource)
resource
- the resource to updateprotected void offlineCacheUpdate(CmsResource resource)
resource
- the resource to updateprotected void onlineCacheClear()
protected void onlineCacheRemove(CmsPublishedResource resource)
resource
- the resource to removeprotected void onlineCacheRemove(CmsResource resource)
resource
- the resource to removeprotected void onlineCacheUpdate(CmsPublishedResource resource)
resource
- the resource to updateprotected void onlineCacheUpdate(CmsResource resource)
resource
- the resource to update