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 java.lang.Object implements CacheEventFilterConverter<K,V,C>
CacheEventFilterConverter
that uses an underlyingKeyValueFilterConverter
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 Classes Modifier and Type Class Description static class
KeyValueFilterConverterAsCacheEventFilterConverter.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 boolean
accept(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.C
convert(K key, V oldValue, Metadata oldMetadata, V newValue, Metadata newMetadata, EventType eventType)
Converts the given newValue into something different possibly.C
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 void
injectDependencies(ComponentRegistry cr)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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:CacheEventFilterConverter
Will both filter the entry and if passed subsequently convert the value to a new value. A returned value ofnull
will symbolize the value not passing the filter, so ensure your conversion will not returnnull
if you want this entry to be returned.- Specified by:
filterAndConvert
in 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
null
value converted value when it also passes the filter ornull
for 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:CacheEventConverter
Converts the given newValue into something different possibly.- Specified by:
convert
in 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:CacheEventFilter
Whether or not this event should be raised to the listener it is attached to.- Specified by:
accept
in 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(ComponentRegistry cr)
-
-