org.infinispan.server.hotrod.KeyValueVersionConverterFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infinispan-server-hotrod-jakarta Show documentation
Show all versions of infinispan-server-hotrod-jakarta Show documentation
Infinispan Hot Rod Server Jakarta EE
The newest version!
package org.infinispan.server.hotrod;
import org.infinispan.notifications.cachelistener.filter.CacheEventConverter;
import org.infinispan.notifications.cachelistener.filter.CacheEventConverterFactory;
class KeyValueVersionConverterFactory implements CacheEventConverterFactory {
private KeyValueVersionConverterFactory() {
}
public static KeyValueVersionConverterFactory SINGLETON = new KeyValueVersionConverterFactory();
@Override
public CacheEventConverter getConverter(Object[] params) {
KeyValueVersionConverter converter;
// If a parameter is sent, we consider we want the old value. Don't consider the value
// Related to RemoteApplicationPublishedBridge where expiration and deletion events need the value
// https://issues.jboss.org/browse/ISPN-9634
if (params != null && params.length > 0) {
converter = KeyValueVersionConverter.INCLUDING_OLD_VALUE_CONVERTER;
} else {
converter = KeyValueVersionConverter.EXCLUDING_OLD_VALUE_CONVERTER;
}
return (CacheEventConverter) converter;
}
}