Class CmsImageCacheConfiguration

java.lang.Object
org.opencms.configuration.CmsImageCacheConfiguration

public class CmsImageCacheConfiguration extends Object
Central configuration for image cache retention and maintenance.

The configuration is optional for the classic RFS cache. If it is not present in opencms-system.xml, isConfigured() returns false and the legacy image cache behavior applies. External FS and S3 image caches require an explicit configuration.

  • Field Details

  • Constructor Details

  • Method Details

    • createLegacyConfiguration

      Creates the configuration representing the absence of an imagecache element.

      Returns:
      the legacy configuration
    • appendToXml

      public org.dom4j.Element appendToXml(org.dom4j.Element parent)
      Appends this configuration to the given system configuration element.

      Nothing is appended for the internal legacy configuration.

      Parameters:
      parent - the system configuration element
      Returns:
      the appended image cache element, or null
    • getCleanupMaxDeletesPerRun

      Returns the maximum number of deletes per maintenance run.

      Returns:
      the maximum number of deletes per maintenance run
    • getCleanupMaxRuntime

      Returns the maximum runtime per maintenance run.

      Returns:
      the maximum runtime per maintenance run
    • getCleanupMaxRuntimeValue

      Returns the configured maximum runtime value.

      Returns:
      the configured maximum runtime value
    • getFsTouchConcurrency

      public int getFsTouchConcurrency()
      Returns the FS touch concurrency.

      Returns:
      the FS touch concurrency
    • getMaxAge

      public Duration getMaxAge()
      Returns the maximum cache entry age.

      Returns:
      the maximum cache entry age, or null for externally managed retention
    • getMaxAgeValue

      Returns the configured maximum cache entry age.

      Returns:
      the configured maximum cache entry age, or null for externally managed retention
    • getPolicyFingerprint

      Returns a stable fingerprint of the configured policy and maintenance settings.

      Returns:
      the configuration fingerprint
    • getRenewalJitter

      Returns the renewal jitter.

      Returns:
      the renewal jitter
    • getRenewalJitterValue

      Returns the effective renewal jitter value.

      Returns:
      the effective renewal jitter value
    • getRenewalWindow

      Returns the renewal window.

      Returns:
      the renewal window
    • getRenewalWindowValue

      Returns the effective renewal window value.

      Returns:
      the effective renewal window value
    • getRetentionMode

      Returns the retention mode.

      Returns:
      the retention mode, or null for the legacy configuration
    • getRfsTouchMinimumInterval

      Returns the RFS minimum touch interval.

      Returns:
      the RFS minimum touch interval
    • getRfsTouchMinimumIntervalValue

      Returns the configured RFS minimum touch interval.

      Returns:
      the configured RFS minimum touch interval
    • getS3CopyConcurrency

      public int getS3CopyConcurrency()
      Returns the S3 copy concurrency.

      Returns:
      the S3 copy concurrency
    • getS3DeleteBatchSize

      public int getS3DeleteBatchSize()
      Returns the S3 delete batch size.

      Returns:
      the S3 delete batch size
    • getS3DeleteConcurrency

      public int getS3DeleteConcurrency()
      Returns the S3 delete concurrency.

      Returns:
      the S3 delete concurrency
    • getS3MaxCopiesPerSecond

      Returns the maximum number of S3 copies per second.

      Returns:
      the maximum number of S3 copies per second
    • getS3RenewalQueueCapacity

      Returns the S3 renewal queue capacity.

      Returns:
      the S3 renewal queue capacity
    • isConfigured

      public boolean isConfigured()
      Returns whether the configuration was explicitly configured.

      Returns:
      whether the configuration was explicitly configured
    • setCleanup

      public void setCleanup(String maxDeletesPerRun, String maxRuntime)
      Sets the cleanup configuration.

      Parameters:
      maxDeletesPerRun - the maximum number of deletes per maintenance run
      maxRuntime - the maximum runtime per maintenance run
    • setFs

      public void setFs(String touchConcurrency)
      Sets the FS configuration.

      Parameters:
      touchConcurrency - the touch concurrency
    • setRetention

      public void setRetention(String mode, String maxAge, String renewalWindow, String renewalJitter)
      Sets the retention policy.

      Parameters:
      mode - the retention mode
      maxAge - the maximum cache entry age
      renewalWindow - the renewal window
      renewalJitter - the renewal jitter
    • setRfs

      public void setRfs(String touchMinimumInterval)
      Sets the RFS configuration.

      Parameters:
      touchMinimumInterval - the minimum touch interval
    • setS3

      public void setS3(String deleteBatchSize, String deleteConcurrency, String copyConcurrency, String maxCopiesPerSecond, String renewalQueueCapacity)
      Sets the S3 configuration.

      Parameters:
      deleteBatchSize - the delete batch size
      deleteConcurrency - the delete concurrency
      copyConcurrency - the copy concurrency
      maxCopiesPerSecond - the maximum number of copies per second
      renewalQueueCapacity - the renewal queue capacity
    • validate

      public void validate()
      Validates the complete configuration.