All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.hotrod.impl.cache.DelegatingRemoteCache Maven / Gradle / Ivy

The newest version!
package org.infinispan.hotrod.impl.cache;

import java.net.SocketAddress;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.Flow;

import jakarta.transaction.TransactionManager;

import org.infinispan.api.async.AsyncCacheEntryProcessor;
import org.infinispan.api.common.CacheEntry;
import org.infinispan.api.common.CacheEntryVersion;
import org.infinispan.api.common.CacheOptions;
import org.infinispan.api.common.CacheWriteOptions;
import org.infinispan.api.common.events.cache.CacheEntryEvent;
import org.infinispan.api.common.events.cache.CacheEntryEventType;
import org.infinispan.api.common.events.cache.CacheListenerOptions;
import org.infinispan.api.common.process.CacheEntryProcessorResult;
import org.infinispan.api.common.process.CacheProcessorOptions;
import org.infinispan.api.configuration.CacheConfiguration;
import org.infinispan.commons.util.CloseableIterator;
import org.infinispan.hotrod.impl.DataFormat;
import org.infinispan.hotrod.impl.HotRodTransport;
import org.infinispan.hotrod.impl.operations.CacheOperationsFactory;
import org.infinispan.hotrod.impl.operations.RetryAwareCompletionStage;
import org.reactivestreams.Publisher;

/**
 * Delegates all invocations to the provided underlying {@link RemoteCache} but provides extensibility to intercept when
 * a method is invoked.
 *
 * @param  key type
 * @param  value type
 */
public abstract class DelegatingRemoteCache implements RemoteCache {
   protected final RemoteCache delegate;

   protected DelegatingRemoteCache(RemoteCache delegate) {
      this.delegate = delegate;
   }

   abstract  RemoteCache newDelegatingCache(RemoteCache innerCache);

   @Override
   public CompletionStage configuration() {
      return delegate.configuration();
   }

   @Override
   public HotRodTransport getHotRodTransport() {
      return delegate.getHotRodTransport();
   }

   @Override
   public CacheOperationsFactory getOperationsFactory() {
      return delegate.getOperationsFactory();
   }

   @Override
   public CompletionStage get(K key, CacheOptions options) {
      return delegate.get(key, options);
   }

   @Override
   public CompletionStage> getEntry(K key, CacheOptions options) {
      return delegate.getEntry(key, options);
   }

   @Override
   public RetryAwareCompletionStage> getEntry(K key, CacheOptions options, SocketAddress listenerAddress) {
      return delegate.getEntry(key, options, listenerAddress);
   }

   @Override
   public CompletionStage> putIfAbsent(K key, V value, CacheWriteOptions options) {
      return delegate.putIfAbsent(key, value, options);
   }

   @Override
   public CompletionStage setIfAbsent(K key, V value, CacheWriteOptions options) {
      return delegate.setIfAbsent(key, value, options);
   }

   @Override
   public CompletionStage> put(K key, V value, CacheWriteOptions options) {
      return delegate.put(key, value, options);
   }

   @Override
   public CompletionStage set(K key, V value, CacheWriteOptions options) {
      return delegate.set(key, value, options);
   }

   @Override
   public CompletionStage replace(K key, V value, CacheEntryVersion version, CacheWriteOptions options) {
      return delegate.replace(key, value, version, options);
   }

   @Override
   public CompletionStage> getOrReplaceEntry(K key, V value, CacheEntryVersion version, CacheWriteOptions options) {
      return delegate.getOrReplaceEntry(key, value, version, options);
   }

   @Override
   public CompletionStage remove(K key, CacheOptions options) {
      return delegate.remove(key, options);
   }

   @Override
   public CompletionStage remove(K key, CacheEntryVersion version, CacheOptions options) {
      return delegate.remove(key, version, options);
   }

   @Override
   public CompletionStage> getAndRemove(K key, CacheOptions options) {
      return delegate.getAndRemove(key, options);
   }

   @Override
   public Flow.Publisher keys(CacheOptions options) {
      return delegate.keys(options);
   }

   @Override
   public Flow.Publisher> entries(CacheOptions options) {
      return delegate.entries(options);
   }

   @Override
   public CompletionStage putAll(Map entries, CacheWriteOptions options) {
      return delegate.putAll(entries, options);
   }

   @Override
   public CompletionStage putAll(Flow.Publisher> entries, CacheWriteOptions options) {
      return delegate.putAll(entries, options);
   }

   @Override
   public Flow.Publisher> getAll(Set keys, CacheOptions options) {
      return delegate.getAll(keys, options);
   }

   @Override
   public Flow.Publisher> getAll(CacheOptions options, K[] keys) {
      return delegate.getAll(options, keys);
   }

   @Override
   public Flow.Publisher removeAll(Set keys, CacheWriteOptions options) {
      return delegate.removeAll(keys, options);
   }

   @Override
   public Flow.Publisher removeAll(Flow.Publisher keys, CacheWriteOptions options) {
      return delegate.removeAll(keys, options);
   }

   @Override
   public Flow.Publisher> getAndRemoveAll(Set keys, CacheWriteOptions options) {
      return delegate.getAndRemoveAll(keys, options);
   }

   @Override
   public Flow.Publisher> getAndRemoveAll(Flow.Publisher keys, CacheWriteOptions options) {
      return delegate.getAndRemoveAll(keys, options);
   }

   @Override
   public CompletionStage estimateSize(CacheOptions options) {
      return delegate.estimateSize(options);
   }

   @Override
   public CompletionStage clear(CacheOptions options) {
      return delegate.clear(options);
   }

   @Override
   public CloseableIterator> retrieveEntries(String filterConverterFactory, Set segments, int batchSize) {
      return delegate.retrieveEntries(filterConverterFactory, segments, batchSize);
   }

   @Override
   public CloseableIterator> retrieveEntries(String filterConverterFactory, Object[] filterConverterParams, Set segments, int batchSize) {
      return delegate.retrieveEntries(filterConverterFactory, filterConverterParams, segments, batchSize);
   }

   @Override
   public Flow.Publisher> listen(CacheListenerOptions options, CacheEntryEventType[] types) {
      return delegate.listen(options, types);
   }

   @Override
   public  Flow.Publisher> process(Set keys, AsyncCacheEntryProcessor task, CacheOptions options) {
      return delegate.process(keys, task, options);
   }

   @Override
   public  Flow.Publisher> processAll(AsyncCacheEntryProcessor processor, CacheProcessorOptions options) {
      return delegate.processAll(processor, options);
   }

   @Override
   public  RemoteCache withDataFormat(DataFormat newDataFormat) {
      return delegate.withDataFormat(newDataFormat);
   }

   @Override
   public K keyAsObjectIfNeeded(Object key) {
      return delegate.keyAsObjectIfNeeded(key);
   }

   @Override
   public byte[] keyToBytes(Object o) {
      return delegate.keyToBytes(o);
   }

   @Override
   public byte[] valueToBytes(Object o) {
      return delegate.valueToBytes(o);
   }

   @Override
   public void resolveStorage(boolean objectStorage) {
      delegate.resolveStorage(objectStorage);
   }

   @Override
   public CompletionStage updateBloomFilter() {
      return delegate.updateBloomFilter();
   }

   @Override
   public SocketAddress addNearCacheListener(Object listener, int bloomFilterBits) {
      return delegate.addNearCacheListener(listener, bloomFilterBits);
   }

   @Override
   public String getName() {
      return delegate.getName();
   }

   @Override
   public DataFormat getDataFormat() {
      return delegate.getDataFormat();
   }

   @Override
   public  Publisher> publishEntries(String filterConverterFactory, Object[] filterConverterParams, Set segments, int batchSize) {
      return delegate.publishEntries(filterConverterFactory, filterConverterParams, segments, batchSize);
   }

   @Override
   public CloseableIterator> retrieveEntriesByQuery(RemoteQuery query, Set segments, int batchSize) {
      return delegate.retrieveEntriesByQuery(query, segments, batchSize);
   }

   @Override
   public  Publisher> publishEntriesByQuery(RemoteQuery query, Set segments, int batchSize) {
      return delegate.publishEntriesByQuery(query, segments, batchSize);
   }

   @Override
   public CloseableIterator> retrieveEntriesWithMetadata(Set segments, int batchSize) {
      return delegate.retrieveEntriesWithMetadata(segments, batchSize);
   }

   @Override
   public Publisher> publishEntriesWithMetadata(Set segments, int batchSize) {
      return delegate.publishEntriesWithMetadata(segments, batchSize);
   }

   @Override
   public TransactionManager getTransactionManager() {
      return delegate.getTransactionManager();
   }

   @Override
   public boolean isTransactional() {
      return delegate.isTransactional();
   }

   @Override
   public void close() throws Exception {
      delegate.close();
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy