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 -
Constructor Summary
ConstructorsConstructorDescriptionCatalogAccessPolicyAndVendorAwareCacheKeyEnhancer(com.broadleafcommerce.data.tracking.core.policy.trackable.marketplace.vendor.VendorAwareTrackablePolicyUtils vendorAwareTrackablePolicyUtils) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaccountForCatalogTargetingCatalogAccessPolicies(@NonNull com.fasterxml.jackson.databind.node.ObjectNode cacheKey, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Enhances thecacheKeyfor any appliedCatalogAccessPoliciesthat target Catalogs.protected voidaccountForProductTargetingCatalogAccessPolicies(@NonNull com.fasterxml.jackson.databind.node.ObjectNode cacheKey, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Enhances thecacheKeyfor any appliedCatalogAccessPoliciesthat target Products.voidenhanceCacheKeyWithVendorConsiderations(@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, getRestrictedAuthoritiesGrantedToRequestedVendorMethods inherited from class com.broadleafcommerce.data.tracking.core.cache.marketplace.vendor.DefaultVendorAwareCacheKeyEnhancer
addPropertiesToCacheKey, containsAuthorityRoot, getCurrentPolicyRequirements, getPermissionRoots, getVendorAwareTrackablePolicyUtils, getVendorRefsByRelevantRestrictedAuthority
-
Field Details
-
CATALOG_ACCESS_POLICIES_PARAM
- See Also:
-
-
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:
enhanceCacheKeyWithVendorConsiderationsin interfacecom.broadleafcommerce.data.tracking.core.cache.marketplace.vendor.VendorAwareCacheKeyEnhancer- Overrides:
enhanceCacheKeyWithVendorConsiderationsin classcom.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 thecacheKeyfor any appliedCatalogAccessPoliciesthat target Products.CatalogAccessPolicyContextInfoCustomizershould add anadditional propertyto thecontextInfothat is a collection of the policies being applied.- Parameters:
cacheKey- the cache key object on which to add any vendor privilege considerationscontextInfo- 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 thecacheKeyfor any appliedCatalogAccessPoliciesthat target Catalogs.Since this type of Policy is applied in
CatalogContextRequestHydrator, we cannot look at an attribute likeaccountForProductTargetingCatalogAccessPolicies(ObjectNode, ContextInfo). Instead, we can look for the affects of an applied policy, namely a difference inInheritanceLines.- Parameters:
cacheKey- the cache key object on which to add any vendor privilege considerationscontextInfo- the context info supplied to the operation being cached.
-