Class CatalogAccessPolicyAndVendorAwareCacheKeyEnhancer

java.lang.Object
com.broadleafcommerce.data.tracking.core.cache.marketplace.vendor.DefaultVendorAwareCacheKeyEnhancer
com.broadleafcommerce.data.tracking.core.cache.marketplace.vendor.CatalogVendorAwareCacheKeyEnhancer
com.broadleafcommerce.catalog.cache.CatalogAccessPolicyAndVendorAwareCacheKeyEnhancer
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.cache.marketplace.vendor.VendorAwareCacheKeyEnhancer

public class CatalogAccessPolicyAndVendorAwareCacheKeyEnhancer extends com.broadleafcommerce.data.tracking.core.cache.marketplace.vendor.CatalogVendorAwareCacheKeyEnhancer
Includes information about CatalogAccessPolicies in the cache keys in addition to vendor information.
Author:
Nathan Moore (nathandmoore)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    CatalogAccessPolicyAndVendorAwareCacheKeyEnhancer(com.broadleafcommerce.data.tracking.core.policy.trackable.marketplace.vendor.VendorAwareTrackablePolicyUtils vendorAwareTrackablePolicyUtils)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    accountForCatalogTargetingCatalogAccessPolicies(@NonNull com.fasterxml.jackson.databind.node.ObjectNode cacheKey, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Enhances the cacheKey for any applied CatalogAccessPolicies that target Catalogs.
    protected void
    accountForProductTargetingCatalogAccessPolicies(@NonNull com.fasterxml.jackson.databind.node.ObjectNode cacheKey, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Enhances the cacheKey for any applied CatalogAccessPolicies that target Products.
    void
    enhanceCacheKeyWithVendorConsiderations(@NonNull com.fasterxml.jackson.databind.node.ObjectNode cacheKey, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
     

    Methods inherited from class com.broadleafcommerce.data.tracking.core.cache.marketplace.vendor.CatalogVendorAwareCacheKeyEnhancer

    addPropertiesToCacheKey, getRestrictedAuthoritiesGrantedToRequestedVendor

    Methods inherited from class com.broadleafcommerce.data.tracking.core.cache.marketplace.vendor.DefaultVendorAwareCacheKeyEnhancer

    addPropertiesToCacheKey, containsAuthorityRoot, getCurrentPolicyRequirements, getPermissionRoots, getVendorAwareTrackablePolicyUtils, getVendorRefsByRelevantRestrictedAuthority

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • CatalogAccessPolicyAndVendorAwareCacheKeyEnhancer

      public CatalogAccessPolicyAndVendorAwareCacheKeyEnhancer(com.broadleafcommerce.data.tracking.core.policy.trackable.marketplace.vendor.VendorAwareTrackablePolicyUtils vendorAwareTrackablePolicyUtils)
  • Method Details

    • enhanceCacheKeyWithVendorConsiderations

      public void enhanceCacheKeyWithVendorConsiderations(@NonNull @NonNull com.fasterxml.jackson.databind.node.ObjectNode cacheKey, @NonNull @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Specified by:
      enhanceCacheKeyWithVendorConsiderations in interface com.broadleafcommerce.data.tracking.core.cache.marketplace.vendor.VendorAwareCacheKeyEnhancer
      Overrides:
      enhanceCacheKeyWithVendorConsiderations in class com.broadleafcommerce.data.tracking.core.cache.marketplace.vendor.CatalogVendorAwareCacheKeyEnhancer
    • accountForProductTargetingCatalogAccessPolicies

      protected void accountForProductTargetingCatalogAccessPolicies(@NonNull @NonNull com.fasterxml.jackson.databind.node.ObjectNode cacheKey, @NonNull @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Enhances the cacheKey for any applied CatalogAccessPolicies that target Products.

      CatalogAccessPolicyContextInfoCustomizer should add an additional property to the contextInfo that is a collection of the policies being applied.

      Parameters:
      cacheKey - the cache key object on which to add any vendor privilege considerations
      contextInfo - the context info supplied to the operation being cached.
    • accountForCatalogTargetingCatalogAccessPolicies

      protected void accountForCatalogTargetingCatalogAccessPolicies(@NonNull @NonNull com.fasterxml.jackson.databind.node.ObjectNode cacheKey, @NonNull @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Enhances the cacheKey for any applied CatalogAccessPolicies that target Catalogs.

      Since this type of Policy is applied in CatalogContextRequestHydrator, we cannot look at an attribute like accountForProductTargetingCatalogAccessPolicies(ObjectNode, ContextInfo). Instead, we can look for the affects of an applied policy, namely a difference in InheritanceLines.

      Parameters:
      cacheKey - the cache key object on which to add any vendor privilege considerations
      contextInfo - the context info supplied to the operation being cached.