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>
CacheEventFilterConverter that uses an underlying KeyValueFilterConverter to 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 ClassesModifier and TypeClassDescriptionstatic class -
Constructor Summary
ConstructorsConstructorDescriptionKeyValueFilterConverterAsCacheEventFilterConverter(KeyValueFilterConverter<K, V, C> keyValueFilterConverter) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept(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.convert(K key, V oldValue, Metadata oldMetadata, V newValue, Metadata newMetadata, EventType eventType) Converts the given newValue into something different possibly.filterAndConvert(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 voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.infinispan.notifications.cachelistener.filter.CacheEventConverter
useRequestFormatMethods inherited from interface org.infinispan.notifications.cachelistener.filter.CacheEventFilterConverter
format
-
Constructor Details
-
KeyValueFilterConverterAsCacheEventFilterConverter
public KeyValueFilterConverterAsCacheEventFilterConverter(KeyValueFilterConverter<K, V, C> keyValueFilterConverter)
-
-
Method Details
-
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
-