Class CmsStoragePolicyEngine

java.lang.Object
org.opencms.db.storage.policy.CmsStoragePolicyEngine

public class CmsStoragePolicyEngine extends Object
Engine for evaluating storage policies to determine the appropriate storage location for binary content.

This engine allows the registration of rules and whitelist exceptions. It evaluates whether a blob should be stored in a specialized storage.

  • Constructor Details

  • Method Details

    • addStorageRule

      Adds a rule that triggers offloading.
      Parameters:
      storageRule - the rule to add
    • addWhitelistRule

      Adds a whitelist rule. If this rule matches, the content is always stored locally.
      Parameters:
      storageRule - the rule to add
    • isWhitelisted

      public boolean isWhitelisted(CmsStoragePolicyContext context)
      Returns true if the given content matches any whitelist rule.
      Parameters:
      context - the storage policy context
      Returns:
      true if whitelisted
    • shouldStoreInStorage

      Evaluates if the given content should be stored in the external storage.

      First checks the whitelist. If not whitelisted, it checks if any storage rule applies.

      Parameters:
      context - the storage policy context
      Returns:
      true if external storage is required