Class CmsImageCacheMaintenanceCleaner

java.lang.Object
org.opencms.loader.imagecache.CmsImageCacheMaintenanceCleaner

public final class CmsImageCacheMaintenanceCleaner extends Object
Streams timestamp-based image cache cleanup through bounded delete batches.

  • Method Details

    • delete

      Deletes entries whose last-modified timestamp is before the cutoff.

      A null cutoff selects all entries. Entries without a timestamp are not selected by a time-based cleanup.

      Parameters:
      service - the maintenance service
      cutoff - the exclusive last-modified cutoff, or null for all entries
      batchSize - the maximum number of entries per delete request
      listener - 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 service
      cutoff - the exclusive last-modified cutoff, or null for all entries
      batchSize - the maximum number of entries per delete request
      maxDeletes - the maximum number of delete attempts in this run
      maxRuntime - the maximum runtime, or null for no runtime limit
      listener - the optional progress listener
      Returns:
      the accumulated cleanup result
      Throws:
      Exception - if listing, deletion or progress processing fails