Class NamedCacheClient<K,​V>

  • Type Parameters:
    K - the type of the cache keys
    V - the type of the cache values
    All Implemented Interfaces:
    com.tangosol.net.cache.CacheMap<K,​V>, com.tangosol.net.NamedCache<K,​V>, com.tangosol.net.NamedCollection, com.tangosol.net.NamedMap<K,​V>, com.tangosol.net.Releasable, com.tangosol.util.ConcurrentMap<K,​V>, com.tangosol.util.InvocableMap<K,​V>, com.tangosol.util.ObservableMap<K,​V>, com.tangosol.util.QueryMap<K,​V>, AutoCloseable, Map<K,​V>

    public class NamedCacheClient<K,​V>
    extends Object
    implements com.tangosol.net.NamedCache<K,​V>
    Implementation of a NamedCache that wraps an AsyncNamedCacheClient.
    Since:
    20.06
    Author:
    Jonathan Knight 2019.11.07
    • Method Detail

      • getAsyncClient

        public AsyncNamedCacheClient<K,​V> getAsyncClient()
        Return an asynchronous version of the client.
        Returns:
        an asynchronous version of the client
      • addIndex

        public <T,​E> void addIndex​(com.tangosol.util.ValueExtractor<? super T,​? extends E> valueExtractor,
                                         boolean sorted,
                                         Comparator<? super E> comparator)
        Specified by:
        addIndex in interface com.tangosol.util.QueryMap<K,​V>
      • addMapListener

        public void addMapListener​(com.tangosol.util.MapListener<? super K,​? super V> mapListener)
        Specified by:
        addMapListener in interface com.tangosol.util.ObservableMap<K,​V>
      • addMapListener

        public void addMapListener​(com.tangosol.util.MapListener<? super K,​? super V> mapListener,
                                   K key,
                                   boolean lite)
        Specified by:
        addMapListener in interface com.tangosol.util.ObservableMap<K,​V>
      • addMapListener

        public void addMapListener​(com.tangosol.util.MapListener<? super K,​? super V> mapListener,
                                   com.tangosol.util.Filter filter,
                                   boolean lite)
        Specified by:
        addMapListener in interface com.tangosol.util.ObservableMap<K,​V>
      • aggregate

        public <R> R aggregate​(Collection<? extends K> keys,
                               com.tangosol.util.InvocableMap.EntryAggregator<? super K,​? super V,​R> aggregator)
        Specified by:
        aggregate in interface com.tangosol.util.InvocableMap<K,​V>
      • aggregate

        public <R> R aggregate​(com.tangosol.util.Filter filter,
                               com.tangosol.util.InvocableMap.EntryAggregator<? super K,​? super V,​R> aggregator)
        Specified by:
        aggregate in interface com.tangosol.util.InvocableMap<K,​V>
      • clear

        public void clear()
        Specified by:
        clear in interface com.tangosol.util.ConcurrentMap<K,​V>
        Specified by:
        clear in interface Map<K,​V>
        Specified by:
        clear in interface com.tangosol.net.NamedMap<K,​V>
      • containsKey

        public boolean containsKey​(Object key)
        Specified by:
        containsKey in interface com.tangosol.util.ConcurrentMap<K,​V>
        Specified by:
        containsKey in interface Map<K,​V>
      • containsValue

        public boolean containsValue​(Object value)
        Specified by:
        containsValue in interface com.tangosol.util.ConcurrentMap<K,​V>
        Specified by:
        containsValue in interface Map<K,​V>
      • destroy

        public void destroy()
        Specified by:
        destroy in interface com.tangosol.net.NamedCollection
      • entrySet

        public Set<Map.Entry<K,​V>> entrySet​(com.tangosol.util.Filter filter)
        Specified by:
        entrySet in interface com.tangosol.util.QueryMap<K,​V>
      • entrySet

        public Set<Map.Entry<K,​V>> entrySet​(com.tangosol.util.Filter filter,
                                                  Comparator comparator)
        Specified by:
        entrySet in interface com.tangosol.util.QueryMap<K,​V>
      • get

        public V get​(Object key)
        Specified by:
        get in interface com.tangosol.util.ConcurrentMap<K,​V>
        Specified by:
        get in interface Map<K,​V>
      • getAll

        public Map<K,​V> getAll​(Collection<? extends K> keys)
        Specified by:
        getAll in interface com.tangosol.net.cache.CacheMap<K,​V>
        Specified by:
        getAll in interface com.tangosol.net.NamedMap<K,​V>
      • getCacheName

        public String getCacheName()
        Specified by:
        getCacheName in interface com.tangosol.net.NamedCache<K,​V>
      • getCacheService

        public com.tangosol.net.CacheService getCacheService()
        Specified by:
        getCacheService in interface com.tangosol.net.NamedCache<K,​V>
      • invoke

        public <R> R invoke​(K k,
                            com.tangosol.util.InvocableMap.EntryProcessor<K,​V,​R> entryProcessor)
        Specified by:
        invoke in interface com.tangosol.util.InvocableMap<K,​V>
      • invokeAll

        public <R> Map<K,​R> invokeAll​(Collection<? extends K> keys,
                                            com.tangosol.util.InvocableMap.EntryProcessor<K,​V,​R> entryProcessor)
        Specified by:
        invokeAll in interface com.tangosol.util.InvocableMap<K,​V>
      • invokeAll

        public <R> Map<K,​R> invokeAll​(com.tangosol.util.Filter filter,
                                            com.tangosol.util.InvocableMap.EntryProcessor<K,​V,​R> entryProcessor)
        Specified by:
        invokeAll in interface com.tangosol.util.InvocableMap<K,​V>
      • isActive

        public boolean isActive()
        Specified by:
        isActive in interface com.tangosol.net.NamedMap<K,​V>
        Specified by:
        isActive in interface com.tangosol.net.Releasable
      • isReady

        public boolean isReady()
        Specified by:
        isReady in interface com.tangosol.net.NamedMap<K,​V>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface com.tangosol.util.ConcurrentMap<K,​V>
        Specified by:
        isEmpty in interface Map<K,​V>
      • keySet

        public Set<K> keySet​(com.tangosol.util.Filter filter)
        Specified by:
        keySet in interface com.tangosol.util.QueryMap<K,​V>
      • keySet

        public Set<K> keySet()
        Specified by:
        keySet in interface Map<K,​V>
      • lock

        public boolean lock​(Object o,
                            long l)
        Specified by:
        lock in interface com.tangosol.util.ConcurrentMap<K,​V>
      • lock

        public boolean lock​(Object o)
        Specified by:
        lock in interface com.tangosol.util.ConcurrentMap<K,​V>
      • put

        public V put​(K key,
                     V value)
        Specified by:
        put in interface com.tangosol.net.cache.CacheMap<K,​V>
        Specified by:
        put in interface com.tangosol.util.ConcurrentMap<K,​V>
        Specified by:
        put in interface Map<K,​V>
      • put

        public V put​(K key,
                     V value,
                     long ttl)
        Specified by:
        put in interface com.tangosol.net.cache.CacheMap<K,​V>
        Specified by:
        put in interface com.tangosol.net.NamedCache<K,​V>
      • putAll

        public void putAll​(Map<? extends K,​? extends V> m)
        Specified by:
        putAll in interface com.tangosol.util.ConcurrentMap<K,​V>
        Specified by:
        putAll in interface Map<K,​V>
      • release

        public void release()
        Specified by:
        release in interface com.tangosol.net.Releasable
      • remove

        public V remove​(Object key)
        Specified by:
        remove in interface com.tangosol.util.ConcurrentMap<K,​V>
        Specified by:
        remove in interface Map<K,​V>
      • removeIndex

        public <T,​E> void removeIndex​(com.tangosol.util.ValueExtractor<? super T,​? extends E> valueExtractor)
        Specified by:
        removeIndex in interface com.tangosol.util.QueryMap<K,​V>
      • removeMapListener

        public void removeMapListener​(com.tangosol.util.MapListener<? super K,​? super V> mapListener)
        Specified by:
        removeMapListener in interface com.tangosol.util.ObservableMap<K,​V>
      • removeMapListener

        public void removeMapListener​(com.tangosol.util.MapListener<? super K,​? super V> mapListener,
                                      K key)
        Specified by:
        removeMapListener in interface com.tangosol.util.ObservableMap<K,​V>
      • removeMapListener

        public void removeMapListener​(com.tangosol.util.MapListener<? super K,​? super V> mapListener,
                                      com.tangosol.util.Filter filter)
        Specified by:
        removeMapListener in interface com.tangosol.util.ObservableMap<K,​V>
      • size

        public int size()
        Specified by:
        size in interface com.tangosol.util.ConcurrentMap<K,​V>
        Specified by:
        size in interface Map<K,​V>
      • unlock

        public boolean unlock​(Object o)
        Specified by:
        unlock in interface com.tangosol.util.ConcurrentMap<K,​V>
      • aggregate

        public <R> R aggregate​(com.tangosol.util.InvocableMap.EntryAggregator<? super K,​? super V,​R> aggregator)
        Specified by:
        aggregate in interface com.tangosol.util.InvocableMap<K,​V>
      • async

        public com.tangosol.net.AsyncNamedCache<K,​V> async()
        Specified by:
        async in interface com.tangosol.net.NamedCache<K,​V>
      • async

        public com.tangosol.net.AsyncNamedCache<K,​V> async​(com.tangosol.net.AsyncNamedMap.Option... options)
        Specified by:
        async in interface com.tangosol.net.NamedCache<K,​V>
        Specified by:
        async in interface com.tangosol.net.NamedMap<K,​V>
      • getOrDefault

        public V getOrDefault​(Object key,
                              V defaultValue)
        Specified by:
        getOrDefault in interface com.tangosol.util.InvocableMap<K,​V>
        Specified by:
        getOrDefault in interface Map<K,​V>
      • isDestroyed

        public boolean isDestroyed()
        Specified by:
        isDestroyed in interface com.tangosol.net.NamedCollection
      • isReleased

        public boolean isReleased()
        Specified by:
        isReleased in interface com.tangosol.net.Releasable
      • putIfAbsent

        public V putIfAbsent​(K key,
                             V value)
        Specified by:
        putIfAbsent in interface com.tangosol.util.InvocableMap<K,​V>
        Specified by:
        putIfAbsent in interface Map<K,​V>
      • remove

        public boolean remove​(Object key,
                              Object value)
        Specified by:
        remove in interface com.tangosol.util.InvocableMap<K,​V>
        Specified by:
        remove in interface Map<K,​V>
      • replace

        public boolean replace​(K key,
                               V oldValue,
                               V newValue)
        Specified by:
        replace in interface com.tangosol.util.InvocableMap<K,​V>
        Specified by:
        replace in interface Map<K,​V>
      • truncate

        public void truncate()
        Specified by:
        truncate in interface com.tangosol.net.NamedMap<K,​V>
      • values

        public Collection<V> values​(com.tangosol.util.Filter filter)
        Specified by:
        values in interface com.tangosol.util.QueryMap<K,​V>
      • values

        public Collection<V> values​(com.tangosol.util.Filter filter,
                                    Comparator comparator)
        Specified by:
        values in interface com.tangosol.util.QueryMap<K,​V>
      • handleCompletableFuture

        protected <T> T handleCompletableFuture​(CompletableFuture<T> future)
      • handleCompletableFuture

        protected <T> T handleCompletableFuture​(CompletableFuture<T> future,
                                                long cTimeoutMillis)