Class KeyValueFilterConverterAsCacheEventFilterConverter<K,V,C>
- java.lang.Object
-
- org.infinispan.notifications.cachelistener.filter.KeyValueFilterConverterAsCacheEventFilterConverter<K,V,C>
-
- All Implemented Interfaces:
CacheEventConverter<K,V,C>,CacheEventFilter<K,V>,CacheEventFilterConverter<K,V,C>
public class KeyValueFilterConverterAsCacheEventFilterConverter<K,V,C> extends Object implements CacheEventFilterConverter<K,V,C>
CacheEventFilterConverterthat uses an underlyingKeyValueFilterConverterto do the conversion and filtering. The new value and metadata are used as arguments to the underlying filter converter as it doesn't take both new and old.- Since:
- 9.4
- Author:
- wburns
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classKeyValueFilterConverterAsCacheEventFilterConverter.Externalizer
-
Constructor Summary
Constructors Constructor Description KeyValueFilterConverterAsCacheEventFilterConverter(KeyValueFilterConverter<K,V,C> keyValueFilterConverter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccept(K key, V oldValue, Metadata oldMetadata, V newValue, Metadata newMetadata, EventType eventType)Whether or not this event should be raised to the listener it is attached to.Cconvert(K key, V oldValue, Metadata oldMetadata, V newValue, Metadata newMetadata, EventType eventType)Converts the given newValue into something different possibly.CfilterAndConvert(K key, V oldValue, Metadata oldMetadata, V newValue, Metadata newMetadata, EventType eventType)Will both filter the entry and if passed subsequently convert the value to a new value.protected voidinjectDependencies(org.infinispan.factories.ComponentRegistry cr)-
Methods inherited from interface org.infinispan.notifications.cachelistener.filter.CacheEventConverter
useRequestFormat
-
Methods inherited from interface org.infinispan.notifications.cachelistener.filter.CacheEventFilterConverter
format
-
-
-
-
Constructor Detail
-
KeyValueFilterConverterAsCacheEventFilterConverter
public KeyValueFilterConverterAsCacheEventFilterConverter(KeyValueFilterConverter<K,V,C> keyValueFilterConverter)
-
-
Method Detail
-
filterAndConvert
public C filterAndConvert(K key, V oldValue, Metadata oldMetadata, V newValue, Metadata newMetadata, EventType eventType)
Description copied from interface:CacheEventFilterConverterWill both filter the entry and if passed subsequently convert the value to a new value. A returned value ofnullwill symbolize the value not passing the filter, so ensure your conversion will not returnnullif you want this entry to be returned.- Specified by:
filterAndConvertin interfaceCacheEventFilterConverter<K,V,C>- Parameters:
key- The key for the entry that was changed for the eventoldValue- The previous value before the event takes placeoldMetadata- The old value before the event takes placenewValue- The new value for the entry after the event takes placenewMetadata- The new metadata for the entry after the event takes placeeventType- The type of event that is being raised- Returns:
- A non
nullvalue converted value when it also passes the filter ornullfor when it doesn't pass the filter
-
convert
public C convert(K key, V oldValue, Metadata oldMetadata, V newValue, Metadata newMetadata, EventType eventType)
Description copied from interface:CacheEventConverterConverts the given newValue into something different possibly.- Specified by:
convertin interfaceCacheEventConverter<K,V,C>- Parameters:
key- The key for the entry that was changed for the eventoldValue- The previous value before the event takes placeoldMetadata- The old value before the event takes placenewValue- The new value for the entry after the event takes placenewMetadata- The new metadata for the entry after the event takes placeeventType- The type of event that is being raised- Returns:
- The converted value to be used in the event
-
accept
public boolean accept(K key, V oldValue, Metadata oldMetadata, V newValue, Metadata newMetadata, EventType eventType)
Description copied from interface:CacheEventFilterWhether or not this event should be raised to the listener it is attached to.- Specified by:
acceptin interfaceCacheEventFilter<K,V>- Parameters:
key- The key for the entry that was changed for the eventoldValue- The previous value before the event takes placeoldMetadata- The old value before the event takes placenewValue- The new value for the entry after the event takes placenewMetadata- The new metadata for the entry after the event takes placeeventType- The type of event that is being raised- Returns:
- Whether or not to notify the listener
-
injectDependencies
protected void injectDependencies(org.infinispan.factories.ComponentRegistry cr)
-
-