Class ManagedRemoteCache<K,​V>

  • All Implemented Interfaces:
    ConcurrentMap<K,​V>, Function<Registration,​Registration>, UnaryOperator<Registration>, Map<K,​V>, org.infinispan.client.hotrod.impl.InternalRemoteCache<K,​V>, org.infinispan.client.hotrod.RemoteCache<K,​V>, org.infinispan.commons.api.AsyncCache<K,​V>, org.infinispan.commons.api.BasicCache<K,​V>, org.infinispan.commons.api.Lifecycle, org.infinispan.commons.api.TransactionalCache

    public class ManagedRemoteCache<K,​V>
    extends org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,​V>
    implements org.infinispan.client.hotrod.impl.InternalRemoteCache<K,​V>, UnaryOperator<Registration>
    RemoteCache decorator that handles registration on start() and deregistration on stop().
    Author:
    Paul Ferraro
    • Constructor Detail

      • ManagedRemoteCache

        public ManagedRemoteCache​(RemoteCacheContainer container,
                                  org.infinispan.client.hotrod.RemoteCacheManager manager,
                                  org.infinispan.client.hotrod.RemoteCache<K,​V> cache,
                                  Registrar<String> registrar)
    • Method Detail

      • isTransactional

        public boolean isTransactional()
        Specified by:
        isTransactional in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • getTransactionManager

        public jakarta.transaction.TransactionManager getTransactionManager()
        Specified by:
        getTransactionManager in interface org.infinispan.commons.api.TransactionalCache
      • start

        public void start()
        Specified by:
        start in interface org.infinispan.commons.api.Lifecycle
      • stop

        public void stop()
        Specified by:
        stop in interface org.infinispan.commons.api.Lifecycle
      • getRemoteCacheContainer

        public RemoteCacheContainer getRemoteCacheContainer()
        Specified by:
        getRemoteCacheContainer in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • getRemoteCacheManager

        @Deprecated
        public org.infinispan.client.hotrod.RemoteCacheManager getRemoteCacheManager()
        Deprecated.
        Specified by:
        getRemoteCacheManager in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • addClientListener

        public void addClientListener​(Object listener)
        Specified by:
        addClientListener in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • addClientListener

        public void addClientListener​(Object listener,
                                      Object[] filterFactoryParams,
                                      Object[] converterFactoryParams)
        Specified by:
        addClientListener in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • clientStatistics

        public org.infinispan.client.hotrod.impl.ClientStatistics clientStatistics()
        Specified by:
        clientStatistics in interface org.infinispan.client.hotrod.impl.InternalRemoteCache<K,​V>
        Specified by:
        clientStatistics in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • entrySet

        public org.infinispan.commons.util.CloseableIteratorSet<Map.Entry<K,​V>> entrySet​(org.infinispan.commons.util.IntSet segments)
        Specified by:
        entrySet in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • execute

        public <T> T execute​(String taskName,
                             Map<String,​?> params)
        Specified by:
        execute in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • getCacheTopologyInfo

        public org.infinispan.client.hotrod.CacheTopologyInfo getCacheTopologyInfo()
        Specified by:
        getCacheTopologyInfo in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • getDataFormat

        public org.infinispan.client.hotrod.DataFormat getDataFormat()
        Specified by:
        getDataFormat in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • getListeners

        @Deprecated
        public Set<Object> getListeners()
        Deprecated.
        Specified by:
        getListeners in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • getProtocolVersion

        public String getProtocolVersion()
        Specified by:
        getProtocolVersion in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • keySet

        public org.infinispan.commons.util.CloseableIteratorSet<K> keySet​(org.infinispan.commons.util.IntSet segments)
        Specified by:
        keySet in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • removeClientListener

        public void removeClientListener​(Object listener)
        Specified by:
        removeClientListener in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • replaceWithVersionAsync

        public CompletableFuture<Boolean> replaceWithVersionAsync​(K key,
                                                                  V newValue,
                                                                  long version,
                                                                  long lifespanSeconds,
                                                                  TimeUnit lifespanTimeUnit,
                                                                  long maxIdle,
                                                                  TimeUnit maxIdleTimeUnit)
        Specified by:
        replaceWithVersionAsync in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • retrieveEntries

        public org.infinispan.commons.util.CloseableIterator<Map.Entry<Object,​Object>> retrieveEntries​(String filterConverterFactory,
                                                                                                             Object[] filterConverterParams,
                                                                                                             Set<Integer> segments,
                                                                                                             int batchSize)
        Specified by:
        retrieveEntries in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • retrieveEntriesByQuery

        public org.infinispan.commons.util.CloseableIterator<Map.Entry<Object,​Object>> retrieveEntriesByQuery​(org.infinispan.query.dsl.Query<?> filterQuery,
                                                                                                                    Set<Integer> segments,
                                                                                                                    int batchSize)
        Specified by:
        retrieveEntriesByQuery in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • retrieveEntriesWithMetadata

        public org.infinispan.commons.util.CloseableIterator<Map.Entry<Object,​org.infinispan.client.hotrod.MetadataValue<Object>>> retrieveEntriesWithMetadata​(Set<Integer> segments,
                                                                                                                                                                     int batchSize)
        Specified by:
        retrieveEntriesWithMetadata in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • publishEntries

        public <E> org.reactivestreams.Publisher<Map.Entry<K,​E>> publishEntries​(String filterConverterFactory,
                                                                                      Object[] filterConverterParams,
                                                                                      Set<Integer> segments,
                                                                                      int batchSize)
        Specified by:
        publishEntries in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • publishEntriesByQuery

        public <E> org.reactivestreams.Publisher<Map.Entry<K,​E>> publishEntriesByQuery​(org.infinispan.query.dsl.Query<?> filterQuery,
                                                                                             Set<Integer> segments,
                                                                                             int batchSize)
        Specified by:
        publishEntriesByQuery in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • publishEntriesWithMetadata

        public org.reactivestreams.Publisher<Map.Entry<K,​org.infinispan.client.hotrod.MetadataValue<V>>> publishEntriesWithMetadata​(Set<Integer> segments,
                                                                                                                                          int batchSize)
        Specified by:
        publishEntriesWithMetadata in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • serverStatistics

        public org.infinispan.client.hotrod.ServerStatistics serverStatistics()
        Specified by:
        serverStatistics in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • streaming

        public org.infinispan.client.hotrod.StreamingRemoteCache<K> streaming()
        Specified by:
        streaming in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • values

        public org.infinispan.commons.util.CloseableIteratorCollection<V> values​(org.infinispan.commons.util.IntSet segments)
        Specified by:
        values in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • withDataFormat

        public <T,​U> org.infinispan.client.hotrod.impl.InternalRemoteCache<T,​U> withDataFormat​(org.infinispan.client.hotrod.DataFormat dataFormat)
        Specified by:
        withDataFormat in interface org.infinispan.client.hotrod.impl.InternalRemoteCache<K,​V>
        Specified by:
        withDataFormat in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • withFlags

        public org.infinispan.client.hotrod.impl.InternalRemoteCache<K,​V> withFlags​(org.infinispan.client.hotrod.Flag... flags)
        Specified by:
        withFlags in interface org.infinispan.client.hotrod.impl.InternalRemoteCache<K,​V>
        Specified by:
        withFlags in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • getName

        public String getName()
        Specified by:
        getName in interface org.infinispan.commons.api.BasicCache<K,​V>
      • getVersion

        public String getVersion()
        Specified by:
        getVersion in interface org.infinispan.commons.api.BasicCache<K,​V>
      • clearAsync

        public CompletableFuture<Void> clearAsync()
        Specified by:
        clearAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface Map<K,​V>
      • computeAsync

        public CompletableFuture<V> computeAsync​(K key,
                                                 BiFunction<? super K,​? super V,​? extends V> remappingFunction,
                                                 long lifespan,
                                                 TimeUnit lifespanUnit,
                                                 long maxIdle,
                                                 TimeUnit maxIdleUnit)
        Specified by:
        computeAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Specified by:
        computeAsync in class org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,​V>
      • computeIfAbsentAsync

        public CompletableFuture<V> computeIfAbsentAsync​(K key,
                                                         Function<? super K,​? extends V> mappingFunction,
                                                         long lifespan,
                                                         TimeUnit lifespanUnit,
                                                         long maxIdle,
                                                         TimeUnit maxIdleUnit)
        Specified by:
        computeIfAbsentAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Specified by:
        computeIfAbsentAsync in class org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,​V>
      • computeIfPresentAsync

        public CompletableFuture<V> computeIfPresentAsync​(K key,
                                                          BiFunction<? super K,​? super V,​? extends V> remappingFunction,
                                                          long lifespan,
                                                          TimeUnit lifespanUnit,
                                                          long maxIdle,
                                                          TimeUnit maxIdleUnit)
        Specified by:
        computeIfPresentAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Specified by:
        computeIfPresentAsync in class org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,​V>
      • containsKeyAsync

        public CompletableFuture<Boolean> containsKeyAsync​(K key)
        Specified by:
        containsKeyAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Specified by:
        containsKeyAsync in class org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,​V>
      • getAllAsync

        public CompletableFuture<Map<K,​V>> getAllAsync​(Set<?> keys)
        Specified by:
        getAllAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Specified by:
        getAllAsync in class org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,​V>
      • getAsync

        public CompletableFuture<V> getAsync​(K key)
        Specified by:
        getAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Specified by:
        getAsync in class org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,​V>
      • getWithMetadataAsync

        public CompletableFuture<org.infinispan.client.hotrod.MetadataValue<V>> getWithMetadataAsync​(K key)
        Specified by:
        getWithMetadataAsync in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
        Specified by:
        getWithMetadataAsync in class org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,​V>
      • mergeAsync

        public CompletableFuture<V> mergeAsync​(K key,
                                               V value,
                                               BiFunction<? super V,​? super V,​? extends V> remappingFunction,
                                               long lifespan,
                                               TimeUnit lifespanUnit,
                                               long maxIdleTime,
                                               TimeUnit maxIdleTimeUnit)
        Specified by:
        mergeAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Specified by:
        mergeAsync in class org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,​V>
      • putAllAsync

        public CompletableFuture<Void> putAllAsync​(Map<? extends K,​? extends V> data,
                                                   long lifespan,
                                                   TimeUnit lifespanUnit,
                                                   long maxIdle,
                                                   TimeUnit maxIdleUnit)
        Specified by:
        putAllAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Specified by:
        putAllAsync in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
        Specified by:
        putAllAsync in class org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,​V>
      • putAsync

        public CompletableFuture<V> putAsync​(K key,
                                             V value,
                                             long lifespan,
                                             TimeUnit lifespanUnit,
                                             long maxIdle,
                                             TimeUnit maxIdleUnit)
        Specified by:
        putAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Specified by:
        putAsync in class org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,​V>
      • putIfAbsentAsync

        public CompletableFuture<V> putIfAbsentAsync​(K key,
                                                     V value,
                                                     long lifespan,
                                                     TimeUnit lifespanUnit,
                                                     long maxIdle,
                                                     TimeUnit maxIdleUnit)
        Specified by:
        putIfAbsentAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Specified by:
        putIfAbsentAsync in class org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,​V>
      • removeAsync

        public CompletableFuture<V> removeAsync​(Object key)
        Specified by:
        removeAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Specified by:
        removeAsync in class org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,​V>
      • removeAsync

        public CompletableFuture<Boolean> removeAsync​(Object key,
                                                      Object value)
        Specified by:
        removeAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Specified by:
        removeAsync in class org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,​V>
      • removeWithVersionAsync

        public CompletableFuture<Boolean> removeWithVersionAsync​(K key,
                                                                 long version)
        Specified by:
        removeWithVersionAsync in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
        Specified by:
        removeWithVersionAsync in class org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,​V>
      • replaceAll

        public void replaceAll​(BiFunction<? super K,​? super V,​? extends V> function)
        Specified by:
        replaceAll in interface ConcurrentMap<K,​V>
        Specified by:
        replaceAll in interface Map<K,​V>
        Specified by:
        replaceAll in class org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,​V>
      • replaceAsync

        public CompletableFuture<V> replaceAsync​(K key,
                                                 V value,
                                                 long lifespan,
                                                 TimeUnit lifespanUnit,
                                                 long maxIdle,
                                                 TimeUnit maxIdleUnit)
        Specified by:
        replaceAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Specified by:
        replaceAsync in class org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,​V>
      • replaceAsync

        public CompletableFuture<Boolean> replaceAsync​(K key,
                                                       V oldValue,
                                                       V newValue,
                                                       long lifespan,
                                                       TimeUnit lifespanUnit,
                                                       long maxIdle,
                                                       TimeUnit maxIdleUnit)
        Specified by:
        replaceAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Specified by:
        replaceAsync in class org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,​V>
      • sizeAsync

        public CompletableFuture<Long> sizeAsync()
        Specified by:
        sizeAsync in interface org.infinispan.commons.api.AsyncCache<K,​V>
        Specified by:
        sizeAsync in class org.infinispan.client.hotrod.impl.RemoteCacheSupport<K,​V>
      • serverStatisticsAsync

        public CompletionStage<org.infinispan.client.hotrod.ServerStatistics> serverStatisticsAsync()
        Specified by:
        serverStatisticsAsync in interface org.infinispan.client.hotrod.RemoteCache<K,​V>
      • keyIterator

        public org.infinispan.commons.util.CloseableIterator<K> keyIterator​(org.infinispan.commons.util.IntSet segments)
        Specified by:
        keyIterator in interface org.infinispan.client.hotrod.impl.InternalRemoteCache<K,​V>
      • entryIterator

        public org.infinispan.commons.util.CloseableIterator<Map.Entry<K,​V>> entryIterator​(org.infinispan.commons.util.IntSet segments)
        Specified by:
        entryIterator in interface org.infinispan.client.hotrod.impl.InternalRemoteCache<K,​V>
      • getWithMetadataAsync

        public org.infinispan.client.hotrod.impl.operations.RetryAwareCompletionStage<org.infinispan.client.hotrod.MetadataValue<V>> getWithMetadataAsync​(K key,
                                                                                                                                                          SocketAddress preferredAddress)
        Specified by:
        getWithMetadataAsync in interface org.infinispan.client.hotrod.impl.InternalRemoteCache<K,​V>
      • hasForceReturnFlag

        public boolean hasForceReturnFlag()
        Specified by:
        hasForceReturnFlag in interface org.infinispan.client.hotrod.impl.InternalRemoteCache<K,​V>
      • resolveStorage

        public void resolveStorage​(boolean objectStorage)
        Specified by:
        resolveStorage in interface org.infinispan.client.hotrod.impl.InternalRemoteCache<K,​V>
      • init

        public void init​(org.infinispan.client.hotrod.impl.operations.OperationsFactory operationsFactory,
                         org.infinispan.client.hotrod.configuration.Configuration configuration,
                         ObjectName jmxParent)
        Specified by:
        init in interface org.infinispan.client.hotrod.impl.InternalRemoteCache<K,​V>
      • init

        public void init​(org.infinispan.client.hotrod.impl.operations.OperationsFactory operationsFactory,
                         org.infinispan.client.hotrod.configuration.Configuration configuration)
        Specified by:
        init in interface org.infinispan.client.hotrod.impl.InternalRemoteCache<K,​V>
      • getOperationsFactory

        public org.infinispan.client.hotrod.impl.operations.OperationsFactory getOperationsFactory()
        Specified by:
        getOperationsFactory in interface org.infinispan.client.hotrod.impl.InternalRemoteCache<K,​V>
      • isObjectStorage

        public boolean isObjectStorage()
        Specified by:
        isObjectStorage in interface org.infinispan.client.hotrod.impl.InternalRemoteCache<K,​V>
      • keyAsObjectIfNeeded

        public K keyAsObjectIfNeeded​(Object key)
        Specified by:
        keyAsObjectIfNeeded in interface org.infinispan.client.hotrod.impl.InternalRemoteCache<K,​V>
      • keyToBytes

        public byte[] keyToBytes​(Object object)
        Specified by:
        keyToBytes in interface org.infinispan.client.hotrod.impl.InternalRemoteCache<K,​V>
      • ping

        public CompletionStage<org.infinispan.client.hotrod.impl.operations.PingResponse> ping()
        Specified by:
        ping in interface org.infinispan.client.hotrod.impl.InternalRemoteCache<K,​V>
      • addNearCacheListener

        public SocketAddress addNearCacheListener​(Object listener,
                                                  int bloomBits)
        Specified by:
        addNearCacheListener in interface org.infinispan.client.hotrod.impl.InternalRemoteCache<K,​V>
      • updateBloomFilter

        public CompletionStage<Void> updateBloomFilter()
        Specified by:
        updateBloomFilter in interface org.infinispan.client.hotrod.impl.InternalRemoteCache<K,​V>