Package org.opencms.loader.imagecache
Class CmsImageCacheMaintenanceCleaner
java.lang.Object
org.opencms.loader.imagecache.CmsImageCacheMaintenanceCleaner
Streams timestamp-based image cache cleanup through bounded delete batches.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceReceives progress after each delete batch.static final classAccumulated cleanup counters. -
Method Summary
Modifier and TypeMethodDescriptiondelete(CmsImageCacheMaintenanceService service, Instant cutoff, int batchSize, int maxDeletes, Duration maxRuntime, CmsImageCacheMaintenanceCleaner.I_ProgressListener listener) Deletes entries whose last-modified timestamp is before the cutoff, subject to per-run limits.delete(CmsImageCacheMaintenanceService service, Instant cutoff, int batchSize, CmsImageCacheMaintenanceCleaner.I_ProgressListener listener) Deletes entries whose last-modified timestamp is before the cutoff.
-
Method Details
-
delete
public static CmsImageCacheMaintenanceCleaner.Result delete(CmsImageCacheMaintenanceService service, Instant cutoff, int batchSize, CmsImageCacheMaintenanceCleaner.I_ProgressListener listener) throws Exception Deletes entries whose last-modified timestamp is before the cutoff.A
nullcutoff selects all entries. Entries without a timestamp are not selected by a time-based cleanup.- Parameters:
service- the maintenance servicecutoff- the exclusive last-modified cutoff, ornullfor all entriesbatchSize- the maximum number of entries per delete requestlistener- the optional progress listener- Returns:
- the accumulated cleanup result
- Throws:
Exception- if listing, deletion or progress processing fails
-
delete
public static CmsImageCacheMaintenanceCleaner.Result delete(CmsImageCacheMaintenanceService service, Instant cutoff, int batchSize, int maxDeletes, Duration maxRuntime, CmsImageCacheMaintenanceCleaner.I_ProgressListener listener) throws Exception Deletes entries whose last-modified timestamp is before the cutoff, subject to per-run limits.The runtime limit is soft: an already started backend delete request is allowed to finish before the run is stopped.
- Parameters:
service- the maintenance servicecutoff- the exclusive last-modified cutoff, ornullfor all entriesbatchSize- the maximum number of entries per delete requestmaxDeletes- the maximum number of delete attempts in this runmaxRuntime- the maximum runtime, ornullfor no runtime limitlistener- the optional progress listener- Returns:
- the accumulated cleanup result
- Throws:
Exception- if listing, deletion or progress processing fails
-