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

org.infinispan.hotrod.HotRodAsyncCache Maven / Gradle / Ivy

There is a newer version: 14.0.32.Final
Show newest version
package org.infinispan.hotrod;

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

import org.infinispan.api.async.AsyncCache;
import org.infinispan.api.async.AsyncCacheEntryProcessor;
import org.infinispan.api.async.AsyncContainer;
import org.infinispan.api.async.AsyncQuery;
import org.infinispan.api.async.AsyncStreamingCache;
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.hotrod.impl.cache.RemoteCache;

/**
 * @since 14.0
 **/
public class HotRodAsyncCache implements AsyncCache {
   private final HotRod hotrod;
   private final RemoteCache remoteCache;

   HotRodAsyncCache(HotRod hotrod, RemoteCache remoteCache) {
      this.hotrod = hotrod;
      this.remoteCache = remoteCache;
   }

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

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

   @Override
   public AsyncContainer container() {
      return hotrod.async();
   }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

   @Override
   public  AsyncQuery query(String query, CacheOptions options) {
      return new HotRodAsyncQuery(query, options);
   }

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

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

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

   @Override
   public AsyncStreamingCache streaming() {
      return new HotRodAsyncStreamingCache(hotrod, remoteCache);
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy