Package org.opencms.loader.imagecache
Class CmsFsImageCacheMaintenance
java.lang.Object
org.opencms.loader.imagecache.CmsRfsImageCacheMaintenance
org.opencms.loader.imagecache.CmsFsImageCacheMaintenance
- All Implemented Interfaces:
I_CmsImageCacheMaintenance
Maintenance adapter for the shared file system image cache.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a maintenance adapter.CmsFsImageCacheMaintenance(CmsFsImageCache cache, boolean touchEnabled, int touchConcurrency) Creates a maintenance adapter. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterDelete(String key) Called after an entry has been deleted.execute(CmsImageCacheMaintenanceRequest request) Executes a maintenance request.Returns the backend identifier used for diagnostics and metrics.Returns the backend capabilities.Loads metadata for a single image cache entry.protected voidShared-FS deletes deliberately leave empty directories in place.voidStreams all image cache entries to a visitor.Methods inherited from class org.opencms.loader.imagecache.CmsRfsImageCacheMaintenance
getRepository, toPath
-
Constructor Details
-
CmsFsImageCacheMaintenance
Creates a maintenance adapter.- Parameters:
cache- the shared file system cache
-
CmsFsImageCacheMaintenance
public CmsFsImageCacheMaintenance(CmsFsImageCache cache, boolean touchEnabled, int touchConcurrency) Creates a maintenance adapter.- Parameters:
cache- the shared file system cachetouchEnabled- whether touching cache entries is enabledtouchConcurrency- the maximum number of concurrent touch operations
-
-
Method Details
-
execute
public CmsImageCacheMaintenanceResult execute(CmsImageCacheMaintenanceRequest request) throws Exception Description copied from interface:I_CmsImageCacheMaintenanceExecutes a maintenance request.- Specified by:
executein interfaceI_CmsImageCacheMaintenance- Overrides:
executein classCmsRfsImageCacheMaintenance- Parameters:
request- the request- Returns:
- the maintenance result
- Throws:
Exception- if the request can not be completed- See Also:
-
getBackendId
Description copied from interface:I_CmsImageCacheMaintenanceReturns the backend identifier used for diagnostics and metrics.- Specified by:
getBackendIdin interfaceI_CmsImageCacheMaintenance- Overrides:
getBackendIdin classCmsRfsImageCacheMaintenance- Returns:
- the backend identifier
- See Also:
-
getCapabilities
Description copied from interface:I_CmsImageCacheMaintenanceReturns the backend capabilities.- Specified by:
getCapabilitiesin interfaceI_CmsImageCacheMaintenance- Overrides:
getCapabilitiesin classCmsRfsImageCacheMaintenance- Returns:
- the backend capabilities
- See Also:
-
getEntry
Description copied from interface:I_CmsImageCacheMaintenanceLoads metadata for a single image cache entry.- Specified by:
getEntryin interfaceI_CmsImageCacheMaintenance- Overrides:
getEntryin classCmsRfsImageCacheMaintenance- Parameters:
key- the image cache key- Returns:
- the entry metadata, or
nullif the entry does not exist - Throws:
Exception- if the metadata can not be loaded- See Also:
-
visitEntries
Description copied from interface:I_CmsImageCacheMaintenanceStreams all image cache entries to a visitor.- Specified by:
visitEntriesin interfaceI_CmsImageCacheMaintenance- Overrides:
visitEntriesin classCmsRfsImageCacheMaintenance- Parameters:
visitor- the entry visitor- Throws:
Exception- if listing fails- See Also:
-
afterDelete
Description copied from class:CmsRfsImageCacheMaintenanceCalled after an entry has been deleted.- Overrides:
afterDeletein classCmsRfsImageCacheMaintenance- Parameters:
key- the deleted cache key- Throws:
Exception- if post-processing fails- See Also:
-
removeEmptyDirectories
Shared-FS deletes deliberately leave empty directories in place.Traversing the complete shared repository after every delete request would turn deletion of one image into a full NFS metadata scan. The directories are harmless and are removed by a complete cache clear.
- Overrides:
removeEmptyDirectoriesin classCmsRfsImageCacheMaintenance
-