@Beta @FunctionalInterface public interface CacheFilter
ResilienceConfiguration, a
GenericCacheKey, and a cache entry.| Modifier and Type | Method and Description |
|---|---|
static CacheFilter |
and(CacheFilter firstFilter,
CacheFilter... additionalFilters)
Creates a new
CacheFilter instance which represents the conjunction of all passed cache filters. |
static CacheFilter |
keyMatchesParameters()
Creates a
CacheFilter, which matches all cache entries associated with GenericCacheKeys that are
accessible with respect to the parameters in the ResilienceConfiguration.CacheConfiguration in the
corresponding ResilienceConfiguration. |
static CacheFilter |
keyMatchesParameters(Iterable<Object> parameters)
Creates a
CacheFilter, which includes all cache entries associated with GenericCacheKeys that are
accessible with respect to the passed parameters. |
static CacheFilter |
keyMatchesPrincipal()
Creates a
CacheFilter, which matches all cache entries associated with GenericCacheKeys that are
accessible with respect to the Principal used at the time when the CacheFilter is applied.Whether the CacheFilter considers the Principal, depends on the ResilienceIsolationMode
stored in the corresponding ResilienceConfiguration. |
static CacheFilter |
keyMatchesPrincipal(Principal principal)
Creates a
CacheFilter, which includes all cache entries associated with GenericCacheKeys that are
accessible with respect to the passed Principal. |
static CacheFilter |
keyMatchesTenant()
Creates a
CacheFilter, which matches all cache entries associated with GenericCacheKeys that are
accessible with respect to the Tenant used at the time when the CacheFilter is applied.Whether the CacheFilter considers the Tenant, depends on the ResilienceIsolationMode
stored in the corresponding ResilienceConfiguration. |
static CacheFilter |
keyMatchesTenant(Tenant tenant)
Creates a
CacheFilter, which includes all cache entries associated with GenericCacheKeys that are
accessible with respect to the passed Tenant. |
boolean |
matches(ResilienceConfiguration configuration,
GenericCacheKey<?,?> cacheKey,
Object cacheEntry)
Determines whether a specific cache entry matches the expectations of this cache filter.
|
static CacheFilter |
or(CacheFilter firstFilter,
CacheFilter... additionalFilters)
Creates a new
CacheFilter instance which represents the disjunction of all passed cache filters. |
boolean matches(@Nonnull ResilienceConfiguration configuration, @Nonnull GenericCacheKey<?,?> cacheKey, @Nullable Object cacheEntry)
configuration - The ResilienceConfiguration that is used for the current cache access operation.cacheKey - The GenericCacheKey that is associated with the current cache entry.cacheEntry - The actual cache entry.true if the cache entry should be included, false otherwise.@Nonnull static CacheFilter keyMatchesTenant(@Nonnull Tenant tenant)
CacheFilter, which includes all cache entries associated with GenericCacheKeys that are
accessible with respect to the passed Tenant.tenant - The tenantCacheFilter that respects the provided tenant.@Nonnull static CacheFilter keyMatchesPrincipal()
CacheFilter, which matches all cache entries associated with GenericCacheKeys that are
accessible with respect to the Principal used at the time when the CacheFilter is applied.CacheFilter considers the Principal, depends on the ResilienceIsolationMode
stored in the corresponding ResilienceConfiguration.CacheFilter that respects principal isolation.@Nonnull static CacheFilter keyMatchesPrincipal(@Nonnull Principal principal)
CacheFilter, which includes all cache entries associated with GenericCacheKeys that are
accessible with respect to the passed Principal.principal - The principalCacheFilter that respects the provided principal id@Nonnull static CacheFilter keyMatchesTenant()
CacheFilter, which matches all cache entries associated with GenericCacheKeys that are
accessible with respect to the Tenant used at the time when the CacheFilter is applied.CacheFilter considers the Tenant, depends on the ResilienceIsolationMode
stored in the corresponding ResilienceConfiguration.CacheFilter that respects tenant isolation.@Nonnull static CacheFilter keyMatchesParameters()
CacheFilter, which matches all cache entries associated with GenericCacheKeys that are
accessible with respect to the parameters in the ResilienceConfiguration.CacheConfiguration in the
corresponding ResilienceConfiguration.CacheFilter that respects the cache parameters@Nonnull static CacheFilter keyMatchesParameters(@Nonnull Iterable<Object> parameters)
CacheFilter, which includes all cache entries associated with GenericCacheKeys that are
accessible with respect to the passed parameters.parameters - The parametersCacheFilter that respects the provided parameters@Nonnull static CacheFilter and(@Nonnull CacheFilter firstFilter, @Nonnull CacheFilter... additionalFilters)
CacheFilter instance which represents the conjunction of all passed cache filters.firstFilter - The first cache filter for the conjunctionadditionalFilters - All additional cache filters which shall be applied as one conjunction@Nonnull static CacheFilter or(@Nonnull CacheFilter firstFilter, @Nonnull CacheFilter... additionalFilters)
CacheFilter instance which represents the disjunction of all passed cache filters.firstFilter - The first cache filter for the disjunctionadditionalFilters - All additional cache filters which shall be applied as one disjunctionCopyright © 2022 SAP SE. All rights reserved.