Package org.opencms.configuration
Class CmsImageCacheConfiguration
java.lang.Object
org.opencms.configuration.CmsImageCacheConfiguration
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRetention modes. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault maximum number of deletes per maintenance run.static final StringDefault maximum runtime per maintenance run.static final intDefault FS touch concurrency.static final StringDefault RFS minimum touch interval.static final intDefault S3 copy concurrency.static final intDefault S3 delete batch size.static final intDefault S3 delete concurrency.static final intDefault maximum number of S3 copies per second.static final intDefault S3 renewal queue capacity. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a configuration populated from an explicit XML element. -
Method Summary
Modifier and TypeMethodDescriptionorg.dom4j.ElementappendToXml(org.dom4j.Element parent) Appends this configuration to the given system configuration element.static CmsImageCacheConfigurationCreates the configuration representing the absence of animagecacheelement.intReturns the maximum number of deletes per maintenance run.Returns the maximum runtime per maintenance run.Returns the configured maximum runtime value.intReturns the FS touch concurrency.Returns the maximum cache entry age.Returns the configured maximum cache entry age.Returns a stable fingerprint of the configured policy and maintenance settings.Returns the renewal jitter.Returns the effective renewal jitter value.Returns the renewal window.Returns the effective renewal window value.Returns the retention mode.Returns the RFS minimum touch interval.Returns the configured RFS minimum touch interval.intReturns the S3 copy concurrency.intReturns the S3 delete batch size.intReturns the S3 delete concurrency.intReturns the maximum number of S3 copies per second.intReturns the S3 renewal queue capacity.booleanReturns whether the configuration was explicitly configured.voidsetCleanup(String maxDeletesPerRun, String maxRuntime) Sets the cleanup configuration.voidSets the FS configuration.voidsetRetention(String mode, String maxAge, String renewalWindow, String renewalJitter) Sets the retention policy.voidSets the RFS configuration.voidsetS3(String deleteBatchSize, String deleteConcurrency, String copyConcurrency, String maxCopiesPerSecond, String renewalQueueCapacity) Sets the S3 configuration.voidvalidate()Validates the complete configuration.
-
Field Details
-
DEFAULT_CLEANUP_MAX_DELETES_PER_RUN
Default maximum number of deletes per maintenance run.- See Also:
-
DEFAULT_CLEANUP_MAX_RUNTIME
Default maximum runtime per maintenance run.- See Also:
-
DEFAULT_FS_TOUCH_CONCURRENCY
Default FS touch concurrency.- See Also:
-
DEFAULT_RFS_TOUCH_MINIMUM_INTERVAL
Default RFS minimum touch interval.- See Also:
-
DEFAULT_S3_COPY_CONCURRENCY
Default S3 copy concurrency.- See Also:
-
DEFAULT_S3_DELETE_BATCH_SIZE
Default S3 delete batch size.- See Also:
-
DEFAULT_S3_DELETE_CONCURRENCY
Default S3 delete concurrency.- See Also:
-
DEFAULT_S3_MAX_COPIES_PER_SECOND
Default maximum number of S3 copies per second.- See Also:
-
DEFAULT_S3_RENEWAL_QUEUE_CAPACITY
Default S3 renewal queue capacity.- See Also:
-
-
Constructor Details
-
CmsImageCacheConfiguration
public CmsImageCacheConfiguration()Creates a configuration populated from an explicit XML element.
-
-
Method Details
-
createLegacyConfiguration
Creates the configuration representing the absence of animagecacheelement.- Returns:
- the legacy configuration
-
appendToXml
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
Returns the FS touch concurrency.- Returns:
- the FS touch concurrency
-
getMaxAge
Returns the maximum cache entry age.- Returns:
- the maximum cache entry age, or
nullfor externally managed retention
-
getMaxAgeValue
Returns the configured maximum cache entry age.- Returns:
- the configured maximum cache entry age, or
nullfor 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
nullfor 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
Returns the S3 copy concurrency.- Returns:
- the S3 copy concurrency
-
getS3DeleteBatchSize
Returns the S3 delete batch size.- Returns:
- the S3 delete batch size
-
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
Returns whether the configuration was explicitly configured.- Returns:
- whether the configuration was explicitly configured
-
setCleanup
Sets the cleanup configuration.- Parameters:
maxDeletesPerRun- the maximum number of deletes per maintenance runmaxRuntime- the maximum runtime per maintenance run
-
setFs
Sets the FS configuration.- Parameters:
touchConcurrency- the touch concurrency
-
setRetention
Sets the retention policy.- Parameters:
mode- the retention modemaxAge- the maximum cache entry agerenewalWindow- the renewal windowrenewalJitter- the renewal jitter
-
setRfs
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 sizedeleteConcurrency- the delete concurrencycopyConcurrency- the copy concurrencymaxCopiesPerSecond- the maximum number of copies per secondrenewalQueueCapacity- the renewal queue capacity
-
validate
Validates the complete configuration.
-