Package org.redisson

Class RedissonRx

  • All Implemented Interfaces:
    RedissonRxClient

    public class RedissonRx
    extends Object
    implements RedissonRxClient
    Main infrastructure class allows to get access to all Redisson objects on top of Redis server.
    Author:
    Nikita Koksharov
    • Constructor Detail

      • RedissonRx

        protected RedissonRx​(Config config)
    • Method Detail

      • getStream

        public <K,​V> RStreamRx<K,​V> getStream​(String name)
        Description copied from interface: RedissonRxClient
        Returns stream instance by name

        Requires Redis 5.0.0 and higher.

        Specified by:
        getStream in interface RedissonRxClient
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - of stream
        Returns:
        RStream object
      • getStream

        public <K,​V> RStreamRx<K,​V> getStream​(String name,
                                                          Codec codec)
        Description copied from interface: RedissonRxClient
        Returns stream instance by name using provided codec for entries.

        Requires Redis 5.0.0 and higher.

        Specified by:
        getStream in interface RedissonRxClient
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of stream
        codec - - codec for entry
        Returns:
        RStream object
      • getGeo

        public <V> RGeoRx<V> getGeo​(String name)
        Description copied from interface: RedissonRxClient
        Returns geospatial items holder instance by name.
        Specified by:
        getGeo in interface RedissonRxClient
        Type Parameters:
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        Geo object
      • getGeo

        public <V> RGeoRx<V> getGeo​(String name,
                                    Codec codec)
        Description copied from interface: RedissonRxClient
        Returns geospatial items holder instance by name using provided codec for geospatial members.
        Specified by:
        getGeo in interface RedissonRxClient
        Type Parameters:
        V - type of value
        Parameters:
        name - - name of object
        codec - - codec for value
        Returns:
        Geo object
      • getFairLock

        public RLockRx getFairLock​(String name)
        Description copied from interface: RedissonRxClient
        Returns lock instance by name.

        Implements a fair locking so it guarantees an acquire order by threads.

        Specified by:
        getFairLock in interface RedissonRxClient
        Parameters:
        name - - name of object
        Returns:
        Lock object
      • getLock

        public RLockRx getLock​(String name)
        Description copied from interface: RedissonRxClient
        Returns lock instance by name.

        Implements a non-fair locking so doesn't guarantee an acquire order by threads.

        Specified by:
        getLock in interface RedissonRxClient
        Parameters:
        name - - name of object
        Returns:
        Lock object
      • getMapCache

        public <K,​V> RMapCacheRx<K,​V> getMapCache​(String name,
                                                              Codec codec)
        Description copied from interface: RedissonRxClient
        Returns map-based cache instance by name using provided codec for both cache keys and values. Supports entry eviction with a given MaxIdleTime and TTL settings.

        If eviction is not required then it's better to use regular map RedissonRxClient.getMap(String, Codec).

        Specified by:
        getMapCache in interface RedissonRxClient
        Type Parameters:
        K - type of keys
        V - type of values
        Parameters:
        name - - name of object
        codec - - codec for values
        Returns:
        MapCache object
      • getMapCache

        public <K,​V> RMapCacheRx<K,​V> getMapCache​(String name)
        Description copied from interface: RedissonRxClient
        Returns map-based cache instance by name. Supports entry eviction with a given MaxIdleTime and TTL settings.

        If eviction is not required then it's better to use regular map RedissonRxClient.getMap(String).

        Specified by:
        getMapCache in interface RedissonRxClient
        Type Parameters:
        K - type of keys
        V - type of values
        Parameters:
        name - - name of object
        Returns:
        MapCache object
      • getBucket

        public <V> RBucketRx<V> getBucket​(String name)
        Description copied from interface: RedissonRxClient
        Returns object holder instance by name
        Specified by:
        getBucket in interface RedissonRxClient
        Type Parameters:
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        Bucket object
      • getBucket

        public <V> RBucketRx<V> getBucket​(String name,
                                          Codec codec)
        Description copied from interface: RedissonRxClient
        Returns object holder instance by name using provided codec for object.
        Specified by:
        getBucket in interface RedissonRxClient
        Type Parameters:
        V - type of value
        Parameters:
        name - - name of object
        codec - - codec for value
        Returns:
        Bucket object
      • getHyperLogLog

        public <V> RHyperLogLogRx<V> getHyperLogLog​(String name)
        Description copied from interface: RedissonRxClient
        Returns HyperLogLog instance by name.
        Specified by:
        getHyperLogLog in interface RedissonRxClient
        Type Parameters:
        V - type of values
        Parameters:
        name - - name of object
        Returns:
        HyperLogLog object
      • getHyperLogLog

        public <V> RHyperLogLogRx<V> getHyperLogLog​(String name,
                                                    Codec codec)
        Description copied from interface: RedissonRxClient
        Returns HyperLogLog instance by name using provided codec for hll objects.
        Specified by:
        getHyperLogLog in interface RedissonRxClient
        Type Parameters:
        V - type of values
        Parameters:
        name - - name of object
        codec - - codec of values
        Returns:
        HyperLogLog object
      • getList

        public <V> RListRx<V> getList​(String name)
        Description copied from interface: RedissonRxClient
        Returns list instance by name.
        Specified by:
        getList in interface RedissonRxClient
        Type Parameters:
        V - type of values
        Parameters:
        name - - name of object
        Returns:
        List object
      • getList

        public <V> RListRx<V> getList​(String name,
                                      Codec codec)
        Description copied from interface: RedissonRxClient
        Returns list instance by name using provided codec for list objects.
        Specified by:
        getList in interface RedissonRxClient
        Type Parameters:
        V - type of values
        Parameters:
        name - - name of object
        codec - - codec for values
        Returns:
        List object
      • getListMultimap

        public <K,​V> RListMultimapRx<K,​V> getListMultimap​(String name)
        Description copied from interface: RedissonRxClient
        Returns List based Multimap instance by name.
        Specified by:
        getListMultimap in interface RedissonRxClient
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        ListMultimap object
      • getListMultimap

        public <K,​V> RListMultimapRx<K,​V> getListMultimap​(String name,
                                                                      Codec codec)
        Description copied from interface: RedissonRxClient
        Returns List based Multimap instance by name using provided codec for both map keys and values.
        Specified by:
        getListMultimap in interface RedissonRxClient
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of object
        codec - - codec for keys and values
        Returns:
        RListMultimapReactive object
      • getSetMultimap

        public <K,​V> RSetMultimapRx<K,​V> getSetMultimap​(String name)
        Description copied from interface: RedissonRxClient
        Returns Set based Multimap instance by name.
        Specified by:
        getSetMultimap in interface RedissonRxClient
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        SetMultimap object
      • getSetMultimap

        public <K,​V> RSetMultimapRx<K,​V> getSetMultimap​(String name,
                                                                    Codec codec)
        Description copied from interface: RedissonRxClient
        Returns Set based Multimap instance by name using provided codec for both map keys and values.
        Specified by:
        getSetMultimap in interface RedissonRxClient
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of object
        codec - - codec for keys and values
        Returns:
        SetMultimap object
      • getMap

        public <K,​V> RMapRx<K,​V> getMap​(String name)
        Description copied from interface: RedissonRxClient
        Returns map instance by name.
        Specified by:
        getMap in interface RedissonRxClient
        Type Parameters:
        K - type of keys
        V - type of values
        Parameters:
        name - - name of object
        Returns:
        Map object
      • getMap

        public <K,​V> RMapRx<K,​V> getMap​(String name,
                                                    Codec codec)
        Description copied from interface: RedissonRxClient
        Returns map instance by name using provided codec for both map keys and values.
        Specified by:
        getMap in interface RedissonRxClient
        Type Parameters:
        K - type of keys
        V - type of values
        Parameters:
        name - - name of object
        codec - - codec for keys and values
        Returns:
        Map object
      • getSet

        public <V> RSetRx<V> getSet​(String name)
        Description copied from interface: RedissonRxClient
        Returns set instance by name.
        Specified by:
        getSet in interface RedissonRxClient
        Type Parameters:
        V - type of values
        Parameters:
        name - - name of object
        Returns:
        Set object
      • getSet

        public <V> RSetRx<V> getSet​(String name,
                                    Codec codec)
        Description copied from interface: RedissonRxClient
        Returns set instance by name using provided codec for set objects.
        Specified by:
        getSet in interface RedissonRxClient
        Type Parameters:
        V - type of values
        Parameters:
        name - - name of set
        codec - - codec for values
        Returns:
        Set object
      • getScoredSortedSet

        public <V> RScoredSortedSetRx<V> getScoredSortedSet​(String name)
        Description copied from interface: RedissonRxClient
        Returns Redis Sorted Set instance by name. This sorted set sorts objects by object score.
        Specified by:
        getScoredSortedSet in interface RedissonRxClient
        Type Parameters:
        V - type of values
        Parameters:
        name - of scored sorted set
        Returns:
        ScoredSortedSet object
      • getScoredSortedSet

        public <V> RScoredSortedSetRx<V> getScoredSortedSet​(String name,
                                                            Codec codec)
        Description copied from interface: RedissonRxClient
        Returns Redis Sorted Set instance by name using provided codec for sorted set objects. This sorted set sorts objects by object score.
        Specified by:
        getScoredSortedSet in interface RedissonRxClient
        Type Parameters:
        V - type of values
        Parameters:
        name - - name of scored sorted set
        codec - - codec for values
        Returns:
        ScoredSortedSet object
      • getLexSortedSet

        public RLexSortedSetRx getLexSortedSet​(String name)
        Description copied from interface: RedissonRxClient
        Returns String based Redis Sorted Set instance by name All elements are inserted with the same score during addition, in order to force lexicographical ordering
        Specified by:
        getLexSortedSet in interface RedissonRxClient
        Parameters:
        name - - name of object
        Returns:
        LexSortedSet object
      • getTopic

        public RTopicRx getTopic​(String name,
                                 Codec codec)
        Description copied from interface: RedissonRxClient
        Returns topic instance by name using provided codec for messages.
        Specified by:
        getTopic in interface RedissonRxClient
        Parameters:
        name - - name of object
        codec - - codec for message
        Returns:
        Topic object
      • getPatternTopic

        public RPatternTopicRx getPatternTopic​(String pattern)
        Description copied from interface: RedissonRxClient
        Returns topic instance satisfies by pattern name. Supported glob-style patterns: h?llo subscribes to hello, hallo and hxllo h*llo subscribes to hllo and heeeello h[ae]llo subscribes to hello and hallo, but not hillo
        Specified by:
        getPatternTopic in interface RedissonRxClient
        Parameters:
        pattern - of the topic
        Returns:
        PatternTopic object
      • getPatternTopic

        public RPatternTopicRx getPatternTopic​(String pattern,
                                               Codec codec)
        Description copied from interface: RedissonRxClient
        Returns topic instance satisfies by pattern name using provided codec for messages. Supported glob-style patterns: h?llo subscribes to hello, hallo and hxllo h*llo subscribes to hllo and heeeello h[ae]llo subscribes to hello and hallo, but not hillo
        Specified by:
        getPatternTopic in interface RedissonRxClient
        Parameters:
        pattern - of the topic
        codec - - codec for message
        Returns:
        PatternTopic object
      • getQueue

        public <V> RQueueRx<V> getQueue​(String name)
        Description copied from interface: RedissonRxClient
        Returns queue instance by name.
        Specified by:
        getQueue in interface RedissonRxClient
        Type Parameters:
        V - type of values
        Parameters:
        name - - name of object
        Returns:
        Queue object
      • getQueue

        public <V> RQueueRx<V> getQueue​(String name,
                                        Codec codec)
        Description copied from interface: RedissonRxClient
        Returns queue instance by name using provided codec for queue objects.
        Specified by:
        getQueue in interface RedissonRxClient
        Type Parameters:
        V - type of values
        Parameters:
        name - - name of object
        codec - - codec for values
        Returns:
        Queue object
      • getBlockingQueue

        public <V> RBlockingQueueRx<V> getBlockingQueue​(String name,
                                                        Codec codec)
        Description copied from interface: RedissonRxClient
        Returns blocking queue instance by name using provided codec for queue objects.
        Specified by:
        getBlockingQueue in interface RedissonRxClient
        Type Parameters:
        V - type of values
        Parameters:
        name - - name of object
        codec - - code for values
        Returns:
        BlockingQueue object
      • getDeque

        public <V> RDequeRx<V> getDeque​(String name)
        Description copied from interface: RedissonRxClient
        Returns deque instance by name.
        Specified by:
        getDeque in interface RedissonRxClient
        Type Parameters:
        V - type of values
        Parameters:
        name - - name of object
        Returns:
        Deque object
      • getDeque

        public <V> RDequeRx<V> getDeque​(String name,
                                        Codec codec)
        Description copied from interface: RedissonRxClient
        Returns deque instance by name using provided codec for deque objects.
        Specified by:
        getDeque in interface RedissonRxClient
        Type Parameters:
        V - type of values
        Parameters:
        name - - name of object
        codec - - coded for values
        Returns:
        Deque object
      • getScript

        public RScriptRx getScript​(Codec codec)
        Description copied from interface: RedissonRxClient
        Returns script operations object using provided codec.
        Specified by:
        getScript in interface RedissonRxClient
        Parameters:
        codec - - codec for params and result
        Returns:
        Script object
      • getKeys

        public RKeysRx getKeys()
        Description copied from interface: RedissonRxClient
        Returns keys operations. Each of Redis/Redisson object associated with own key
        Specified by:
        getKeys in interface RedissonRxClient
        Returns:
        Keys object
      • getConfig

        public Config getConfig()
        Description copied from interface: RedissonRxClient
        Allows to get configuration provided during Redisson instance creation. Further changes on this object not affect Redisson instance.
        Specified by:
        getConfig in interface RedissonRxClient
        Returns:
        Config object
      • isShutdown

        public boolean isShutdown()
        Description copied from interface: RedissonRxClient
        Returns true if this Redisson instance has been shut down.
        Specified by:
        isShutdown in interface RedissonRxClient
        Returns:
        true if this Redisson instance has been shut down otherwise false
      • enableRedissonReferenceSupport

        protected void enableRedissonReferenceSupport()
      • getMapCache

        public <K,​V> RMapCacheRx<K,​V> getMapCache​(String name,
                                                              Codec codec,
                                                              MapOptions<K,​V> options)
        Description copied from interface: RedissonRxClient
        Returns map-based cache instance by name using provided codec for both cache keys and values. Supports entry eviction with a given MaxIdleTime and TTL settings.

        If eviction is not required then it's better to use regular map RedissonRxClient.getMap(String, Codec, MapOptions).

        Specified by:
        getMapCache in interface RedissonRxClient
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - object name
        codec - - codec for keys and values
        options - - map options
        Returns:
        MapCache object
      • getMapCache

        public <K,​V> RMapCacheRx<K,​V> getMapCache​(String name,
                                                              MapOptions<K,​V> options)
        Description copied from interface: RedissonRxClient
        Returns map-based cache instance by name. Supports entry eviction with a given MaxIdleTime and TTL settings.

        If eviction is not required then it's better to use regular map RedissonRxClient.getMap(String, MapOptions).

        Specified by:
        getMapCache in interface RedissonRxClient
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of object
        options - - map options
        Returns:
        MapCache object
      • getMap

        public <K,​V> RMapRx<K,​V> getMap​(String name,
                                                    MapOptions<K,​V> options)
        Description copied from interface: RedissonRxClient
        Returns map instance by name.
        Specified by:
        getMap in interface RedissonRxClient
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of object
        options - - map options
        Returns:
        Map object
      • getMap

        public <K,​V> RMapRx<K,​V> getMap​(String name,
                                                    Codec codec,
                                                    MapOptions<K,​V> options)
        Description copied from interface: RedissonRxClient
        Returns map instance by name using provided codec for both map keys and values.
        Specified by:
        getMap in interface RedissonRxClient
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        name - - name of object
        codec - - codec for keys and values
        options - - map options
        Returns:
        Map object
      • getBlockingDeque

        public <V> RBlockingDequeRx<V> getBlockingDeque​(String name)
        Description copied from interface: RedissonRxClient
        Returns unbounded blocking deque instance by name.
        Specified by:
        getBlockingDeque in interface RedissonRxClient
        Type Parameters:
        V - type of value
        Parameters:
        name - - name of object
        Returns:
        BlockingDeque object
      • getBlockingDeque

        public <V> RBlockingDequeRx<V> getBlockingDeque​(String name,
                                                        Codec codec)
        Description copied from interface: RedissonRxClient
        Returns unbounded blocking deque instance by name using provided codec for deque objects.
        Specified by:
        getBlockingDeque in interface RedissonRxClient
        Type Parameters:
        V - type of value
        Parameters:
        name - - name of object
        codec - - deque objects codec
        Returns:
        BlockingDeque object