Class DataTrackingKeyGen
- java.lang.Object
-
- com.broadleafcommerce.data.tracking.core.cache.DataTrackingKeyGen
-
public final class DataTrackingKeyGen extends Object
Factory class for generating Spring CacheKeyGeneratorinstances that fulfill common Broadleaf use cases. These are useful, as they include additional key fragments, such as tenant and locale related information that are not obvious from cached method signatures.- Author:
- Jeff Fischer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDataTrackingKeyGen.ApplicationKeyGeneratorstatic classDataTrackingKeyGen.ApplicationWithInstantKeyGeneratorstatic classDataTrackingKeyGen.ApplicationWithLocaleKeyGeneratorstatic classDataTrackingKeyGen.ApplicationWithLocaleWithInstantKeyGeneratorstatic classDataTrackingKeyGen.CatalogKeyGeneratorstatic classDataTrackingKeyGen.CatalogWithInstantKeyGeneratorstatic classDataTrackingKeyGen.CatalogWithLocaleKeyGeneratorstatic classDataTrackingKeyGen.CatalogWithLocaleWithInstantKeyGeneratorstatic classDataTrackingKeyGen.KeyTypestatic classDataTrackingKeyGen.TenantKeyGeneratorstatic classDataTrackingKeyGen.TenantWithInstantKeyGeneratorstatic classDataTrackingKeyGen.TenantWithLocaleKeyGeneratorstatic classDataTrackingKeyGen.TenantWithLocaleWithInstantKeyGenerator
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.broadleafcommerce.common.extension.cache.key.ContextKeyGenof(DataTrackingKeyGen.KeyType keyType)static com.broadleafcommerce.common.extension.cache.key.ContextKeyGenofCatalogWithVendorSupport(DataTrackingKeyGen.KeyType keyType, VendorAwareTrackablePolicyUtils vendorAwareTrackablePolicyUtils)When vendor processing is enabled, catalog-discriminated entities are also discriminated by the vendor their catalog is associated to.
-
-
-
Method Detail
-
of
public static com.broadleafcommerce.common.extension.cache.key.ContextKeyGen of(DataTrackingKeyGen.KeyType keyType)
-
ofCatalogWithVendorSupport
public static com.broadleafcommerce.common.extension.cache.key.ContextKeyGen ofCatalogWithVendorSupport(DataTrackingKeyGen.KeyType keyType, @Nullable VendorAwareTrackablePolicyUtils vendorAwareTrackablePolicyUtils)
When vendor processing is enabled, catalog-discriminated entities are also discriminated by the vendor their catalog is associated to. Cache key generation must incorporate the current authentication's vendor restrictions and current policy requirements to account for this, so this creates key generators that also consider the requisite vendor data.- Parameters:
keyType- a catalog-relatedDataTrackingKeyGen.KeyTypevendorAwareTrackablePolicyUtils- (optional) the vendor-aware trackable policy utils implementation used to determine the current authentication's privileges. May be null in the event vendor processing is disabled or if policy validation is disabled. If null, no vendor privilege considerations will be added to the key.- Returns:
- a key generator incorporating catalog information from context info method arguments and vendor privileges
- Throws:
IllegalArgumentException- if the key type is not a catalog type- See Also:
CatalogVendorAwareCacheKeyEnhancer
-
-