Package org.opencms.ade.configuration
Class CmsDetailNameCache
- java.lang.Object
-
- org.opencms.ade.configuration.CmsDetailNameCache
-
- All Implemented Interfaces:
I_CmsGlobalConfigurationCache
public class CmsDetailNameCache extends java.lang.Object implements 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
Fields Modifier and Type Field Description static int
DELAY_MILLIS
The delay between updates.
-
Constructor Summary
Constructors Constructor Description CmsDetailNameCache(CmsObject cms)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears the cache.CmsUUID
getDetailId(java.lang.String name)
Gets the structure id for a given URL name.void
initialize()
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
waitForUpdate()
Waits until the cache is potentially updated for the next time.
-
-
-
Field Detail
-
DELAY_MILLIS
public static final int DELAY_MILLIS
The delay between updates.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsDetailNameCache
public CmsDetailNameCache(CmsObject cms)
Creates a new instance.- Parameters:
cms
- the CMS context to use
-
-
Method Detail
-
clear
public void clear()
Description copied from interface:I_CmsGlobalConfigurationCache
Clears the cache.- Specified by:
clear
in interfaceI_CmsGlobalConfigurationCache
- See Also:
I_CmsGlobalConfigurationCache.clear()
-
getDetailId
public CmsUUID getDetailId(java.lang.String name)
Gets the structure id for a given URL name.- Parameters:
name
- the URL name- Returns:
- the structure id for the URL name
-
initialize
public void initialize()
Initializes the cache by scheduling the update actions and loading the initial cache contents.
-
remove
public void remove(CmsPublishedResource pubRes)
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:
I_CmsGlobalConfigurationCache.remove(org.opencms.db.CmsPublishedResource)
-
remove
public void remove(CmsResource resource)
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:
I_CmsGlobalConfigurationCache.remove(org.opencms.file.CmsResource)
-
update
public void update(CmsPublishedResource pubRes)
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:
I_CmsGlobalConfigurationCache.update(org.opencms.db.CmsPublishedResource)
-
update
public void update(CmsResource resource)
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:
I_CmsGlobalConfigurationCache.update(org.opencms.file.CmsResource)
-
waitForUpdate
public void waitForUpdate()
Waits until the cache is potentially updated for the next time.This does include updates where there is actually nothing to update.
-
-