Package org.opencms.ade.configuration
Class CmsDetailNameCache
java.lang.Object
org.opencms.ade.configuration.CmsDetailNameCache
- All Implemented Interfaces:
I_CmsGlobalConfigurationCache
A cache which stores structure ids for URL names.
Note that this cache may in some cases contain outdated structure ids for URL names, if an URL name has been removed for a content but is not yet mapped to a different content.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Request attribute for telling the link substitution handler that it shouldn't use this cache.static final int
The delay between updates. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the cache.getDetailId
(String name) Gets the structure id for a given URL name.void
Initializes the cache by scheduling the update actions and loading the initial cache contents.void
remove
(CmsPublishedResource pubRes) Removes a published resource from the cache.void
remove
(CmsResource resource) Removes a resource from the cache.void
update
(CmsPublishedResource pubRes) Updates the cache entry for the given published resource.void
update
(CmsResource resource) Updates the cache entry for the given resource.void
Waits until the cache is potentially updated for the next time.
-
Field Details
-
DELAY_MILLIS
The delay between updates.- See Also:
-
ATTR_BYPASS
Request attribute for telling the link substitution handler that it shouldn't use this cache.- See Also:
-
-
Constructor Details
-
CmsDetailNameCache
Creates a new instance.- Parameters:
cms
- the CMS context to use
-
-
Method Details
-
clear
Description copied from interface:I_CmsGlobalConfigurationCache
Clears the cache.- Specified by:
clear
in interfaceI_CmsGlobalConfigurationCache
- See Also:
-
getDetailId
Gets the structure id for a given URL name.- Parameters:
name
- the URL name- Returns:
- the structure id for the URL name
-
initialize
Initializes the cache by scheduling the update actions and loading the initial cache contents. -
remove
Description copied from interface:I_CmsGlobalConfigurationCache
Removes a published resource from the cache.- Specified by:
remove
in interfaceI_CmsGlobalConfigurationCache
- Parameters:
pubRes
- the published resource- See Also:
-
remove
Description copied from interface:I_CmsGlobalConfigurationCache
Removes a resource from the cache.- Specified by:
remove
in interfaceI_CmsGlobalConfigurationCache
- Parameters:
resource
- the resource to remove- See Also:
-
update
Description copied from interface:I_CmsGlobalConfigurationCache
Updates the cache entry for the given published resource.NOTE: Cache implementations should not directly read the updated resource in this method because it might interfere with other caches. Instead, the resource should be marked as updated and read the next time the cache is queried.
- Specified by:
update
in interfaceI_CmsGlobalConfigurationCache
- Parameters:
pubRes
- a published resource- See Also:
-
update
Description copied from interface:I_CmsGlobalConfigurationCache
Updates the cache entry for the given resource.NOTE: Cache implementations should not directly read the updated resource in this method because it might interfere with other caches. Instead, the resource should be marked as updated and read the next time the cache is queried.
- Specified by:
update
in interfaceI_CmsGlobalConfigurationCache
- Parameters:
resource
- the resource for which the cache entry should be updated- See Also:
-
waitForUpdate
Waits until the cache is potentially updated for the next time.This does include updates where there is actually nothing to update.
-