Class DataTrackingKeyGen
- java.lang.Object
-
- com.broadleafcommerce.data.tracking.core.cache.DataTrackingKeyGen
-
public final class DataTrackingKeyGen extends Object
Factory class for generating Spring CacheKeyGenerator
instances 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 class
DataTrackingKeyGen.ApplicationKeyGenerator
static class
DataTrackingKeyGen.ApplicationWithInstantKeyGenerator
static class
DataTrackingKeyGen.ApplicationWithLocaleKeyGenerator
static class
DataTrackingKeyGen.ApplicationWithLocaleWithInstantKeyGenerator
static class
DataTrackingKeyGen.CatalogKeyGenerator
static class
DataTrackingKeyGen.CatalogWithInstantKeyGenerator
static class
DataTrackingKeyGen.CatalogWithLocaleKeyGenerator
static class
DataTrackingKeyGen.CatalogWithLocaleWithInstantKeyGenerator
static class
DataTrackingKeyGen.KeyType
static class
DataTrackingKeyGen.TenantKeyGenerator
static class
DataTrackingKeyGen.TenantWithInstantKeyGenerator
static class
DataTrackingKeyGen.TenantWithLocaleKeyGenerator
static class
DataTrackingKeyGen.TenantWithLocaleWithInstantKeyGenerator
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.broadleafcommerce.common.extension.cache.key.ContextKeyGen
of(DataTrackingKeyGen.KeyType keyType)
static com.broadleafcommerce.common.extension.cache.key.ContextKeyGen
ofCatalogWithVendorSupport(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.KeyType
vendorAwareTrackablePolicyUtils
- (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
-
-