public class Redisson extends Object implements RedissonClient
Modifier and Type | Method and Description |
---|---|
static RedissonClient |
create()
Create sync/async Redisson instance with default config
|
static RedissonClient |
create(Config config)
Create sync/async Redisson instance with provided config
|
RBatch |
createBatch()
Return batch object which executes group of
command in pipeline.
|
static RedissonReactiveClient |
createReactive()
Create reactive Redisson instance with default config
|
static RedissonReactiveClient |
createReactive(Config config)
Create reactive Redisson instance with provided config
|
<V> List<RBucket<V>> |
findBuckets(String pattern)
|
RAtomicDouble |
getAtomicDouble(String name)
Returns atomicDouble instance by name.
|
RAtomicLong |
getAtomicLong(String name)
Returns atomicLong instance by name.
|
RBitSet |
getBitSet(String name)
Returns bitSet instance by name.
|
<V> RBlockingDeque<V> |
getBlockingDeque(String name)
Returns blocking deque instance by name.
|
<V> RBlockingDeque<V> |
getBlockingDeque(String name,
Codec codec)
Returns blocking deque instance by name
using provided codec for deque objects.
|
<V> RBlockingQueue<V> |
getBlockingQueue(String name)
Returns blocking queue instance by name.
|
<V> RBlockingQueue<V> |
getBlockingQueue(String name,
Codec codec)
Returns blocking queue instance by name
using provided codec for queue objects.
|
<V> RBloomFilter<V> |
getBloomFilter(String name)
Returns bloom filter instance by name.
|
<V> RBloomFilter<V> |
getBloomFilter(String name,
Codec codec)
Returns bloom filter instance by name
using provided codec for objects.
|
<V> RBucket<V> |
getBucket(String name)
Returns object holder instance by name.
|
<V> RBucket<V> |
getBucket(String name,
Codec codec)
Returns object holder instance by name
using provided codec for object.
|
RBuckets |
getBuckets()
Returns interface for mass operations with Bucket objects.
|
RBuckets |
getBuckets(Codec codec)
Returns interface for mass operations with Bucket objects
using provided codec for object.
|
NodesGroup<ClusterNode> |
getClusterNodesGroup()
Get Redis cluster nodes group for server operations
|
Config |
getConfig()
Allows to get configuration provided
during Redisson instance creation.
|
RCountDownLatch |
getCountDownLatch(String name)
Returns countDownLatch instance by name.
|
<V> RDeque<V> |
getDeque(String name)
Returns deque instance by name.
|
<V> RDeque<V> |
getDeque(String name,
Codec codec)
Returns deque instance by name
using provided codec for deque objects.
|
RLock |
getFairLock(String name)
Returns lock instance by name.
|
<V> RGeo<V> |
getGeo(String name)
Returns geospatial items holder instance by
name . |
<V> RGeo<V> |
getGeo(String name,
Codec codec)
Returns geospatial items holder instance by
name
using provided codec for geospatial members. |
<V> RHyperLogLog<V> |
getHyperLogLog(String name)
Returns HyperLogLog instance by name.
|
<V> RHyperLogLog<V> |
getHyperLogLog(String name,
Codec codec)
Returns HyperLogLog instance by name
using provided codec for hll objects.
|
RKeys |
getKeys()
Returns interface with methods for Redis keys.
|
RLexSortedSet |
getLexSortedSet(String name)
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
|
<V> RList<V> |
getList(String name)
Returns list instance by name.
|
<V> RList<V> |
getList(String name,
Codec codec)
Returns list instance by name
using provided codec for list objects.
|
<K,V> RListMultimap<K,V> |
getListMultimap(String name)
Returns List based Multimap instance by name.
|
<K,V> RListMultimap<K,V> |
getListMultimap(String name,
Codec codec)
Returns List based Multimap instance by name
using provided codec for both map keys and values.
|
<K,V> RListMultimapCache<K,V> |
getListMultimapCache(String name)
Returns List based Multimap instance by name.
|
<K,V> RListMultimapCache<K,V> |
getListMultimapCache(String name,
Codec codec)
Returns List based Multimap instance by name
using provided codec for both map keys and values.
|
RLock |
getLock(String name)
Returns lock instance by name.
|
<K,V> RMap<K,V> |
getMap(String name)
Returns map instance by name.
|
<K,V> RMap<K,V> |
getMap(String name,
Codec codec)
Returns map instance by name
using provided codec for both map keys and values.
|
<K,V> RMapCache<K,V> |
getMapCache(String name)
Returns map-based cache instance by name.
|
<K,V> RMapCache<K,V> |
getMapCache(String name,
Codec codec)
Returns map-based cache instance by
name
using provided codec for both cache keys and values. |
NodesGroup<Node> |
getNodesGroup()
Get Redis nodes group for server operations
|
<M> RPatternTopic<M> |
getPatternTopic(String pattern)
Returns topic instance satisfies by pattern name.
|
<M> RPatternTopic<M> |
getPatternTopic(String pattern,
Codec codec)
Returns topic instance satisfies by pattern name
using provided codec for messages.
|
<V> RQueue<V> |
getQueue(String name)
Returns queue instance by name.
|
<V> RQueue<V> |
getQueue(String name,
Codec codec)
Returns queue instance by name
using provided codec for queue objects.
|
RReadWriteLock |
getReadWriteLock(String name)
Returns readWriteLock instance by name.
|
RRemoteService |
getRemoteSerivce()
Returns object for remote operations prefixed with the default name (redisson_remote_service)
|
RRemoteService |
getRemoteSerivce(Codec codec)
Returns object for remote operations prefixed with the default name (redisson_remote_service)
and uses provided codec for method arguments and result.
|
RRemoteService |
getRemoteSerivce(String name)
Returns object for remote operations prefixed with the specified name
|
RRemoteService |
getRemoteSerivce(String name,
Codec codec)
Returns object for remote operations prefixed with the specified name
and uses provided codec for method arguments and result.
|
<V> RScoredSortedSet<V> |
getScoredSortedSet(String name)
Returns Redis Sorted Set instance by name.
|
<V> RScoredSortedSet<V> |
getScoredSortedSet(String name,
Codec codec)
Returns Redis Sorted Set instance by name
using provided codec for sorted set objects.
|
RScript |
getScript()
Returns script operations object
|
RSemaphore |
getSemaphore(String name)
Returns semaphore instance by name
|
<V> RSet<V> |
getSet(String name)
Returns set instance by name.
|
<V> RSet<V> |
getSet(String name,
Codec codec)
Returns set instance by name
using provided codec for set objects.
|
<V> RSetCache<V> |
getSetCache(String name)
Returns set-based cache instance by
name . |
<V> RSetCache<V> |
getSetCache(String name,
Codec codec)
Returns set-based cache instance by
name . |
<K,V> RSetMultimap<K,V> |
getSetMultimap(String name)
Returns Set based Multimap instance by name.
|
<K,V> RSetMultimap<K,V> |
getSetMultimap(String name,
Codec codec)
Returns Set based Multimap instance by name
using provided codec for both map keys and values.
|
<K,V> RSetMultimapCache<K,V> |
getSetMultimapCache(String name)
Returns Set based Multimap instance by name.
|
<K,V> RSetMultimapCache<K,V> |
getSetMultimapCache(String name,
Codec codec)
Returns Set based Multimap instance by name
using provided codec for both map keys and values.
|
<V> RSortedSet<V> |
getSortedSet(String name)
Returns sorted set instance by name.
|
<V> RSortedSet<V> |
getSortedSet(String name,
Codec codec)
Returns sorted set instance by name
using provided codec for sorted set objects.
|
<M> RTopic<M> |
getTopic(String name)
Returns topic instance by name.
|
<M> RTopic<M> |
getTopic(String name,
Codec codec)
Returns topic instance by name
using provided codec for messages.
|
boolean |
isShutdown()
Returns
true if this Redisson instance has been shut down. |
boolean |
isShuttingDown()
Returns
true if this Redisson instance was started to be shutdown
or was shutdown RedissonClient.isShutdown() already. |
<V> Map<String,V> |
loadBucketValues(Collection<String> keys)
|
<V> Map<String,V> |
loadBucketValues(String... keys)
|
void |
saveBuckets(Map<String,?> buckets)
|
void |
shutdown()
Shuts down Redisson instance NOT Redis server
This equates to invoke shutdown(2, 15, TimeUnit.SECONDS);
|
void |
shutdown(long quietPeriod,
long timeout,
TimeUnit unit)
Shuts down Redisson instance NOT Redis server
Shutdown ensures that no tasks are submitted for 'the quiet period'
(usually a couple seconds) before it shuts itself down.
|
public static RedissonClient create()
public static RedissonClient create(Config config)
config
- public static RedissonReactiveClient createReactive()
public static RedissonReactiveClient createReactive(Config config)
public <V> RGeo<V> getGeo(String name)
RedissonClient
name
.getGeo
in interface RedissonClient
public <V> RGeo<V> getGeo(String name, Codec codec)
RedissonClient
name
using provided codec for geospatial members.getGeo
in interface RedissonClient
public <V> RBucket<V> getBucket(String name)
RedissonClient
getBucket
in interface RedissonClient
name
- of objectpublic <V> RBucket<V> getBucket(String name, Codec codec)
RedissonClient
getBucket
in interface RedissonClient
name
- of objectpublic RBuckets getBuckets()
RedissonClient
getBuckets
in interface RedissonClient
public RBuckets getBuckets(Codec codec)
RedissonClient
getBuckets
in interface RedissonClient
public <V> List<RBucket<V>> findBuckets(String pattern)
RedissonClient
findBuckets
in interface RedissonClient
public <V> Map<String,V> loadBucketValues(Collection<String> keys)
RedissonClient
loadBucketValues
in interface RedissonClient
public <V> Map<String,V> loadBucketValues(String... keys)
RedissonClient
loadBucketValues
in interface RedissonClient
public void saveBuckets(Map<String,?> buckets)
RedissonClient
saveBuckets
in interface RedissonClient
public <V> RHyperLogLog<V> getHyperLogLog(String name)
RedissonClient
getHyperLogLog
in interface RedissonClient
name
- of objectpublic <V> RHyperLogLog<V> getHyperLogLog(String name, Codec codec)
RedissonClient
getHyperLogLog
in interface RedissonClient
name
- of objectpublic <V> RList<V> getList(String name)
RedissonClient
getList
in interface RedissonClient
name
- of objectpublic <V> RList<V> getList(String name, Codec codec)
RedissonClient
getList
in interface RedissonClient
name
- of objectpublic <K,V> RListMultimap<K,V> getListMultimap(String name)
RedissonClient
getListMultimap
in interface RedissonClient
public <K,V> RListMultimap<K,V> getListMultimap(String name, Codec codec)
RedissonClient
getListMultimap
in interface RedissonClient
public <K,V> RMap<K,V> getMap(String name)
RedissonClient
getMap
in interface RedissonClient
name
- of mappublic <K,V> RSetMultimap<K,V> getSetMultimap(String name)
RedissonClient
getSetMultimap
in interface RedissonClient
public <K,V> RSetMultimapCache<K,V> getSetMultimapCache(String name)
RedissonClient
If eviction is not required then it's better to use regular map RedissonClient.getSetMultimap(String)
.
getSetMultimapCache
in interface RedissonClient
public <K,V> RSetMultimapCache<K,V> getSetMultimapCache(String name, Codec codec)
RedissonClient
If eviction is not required then it's better to use regular map RedissonClient.getSetMultimap(String, Codec)
.
getSetMultimapCache
in interface RedissonClient
public <K,V> RListMultimapCache<K,V> getListMultimapCache(String name)
RedissonClient
If eviction is not required then it's better to use regular map RedissonClient.getSetMultimap(String)
.
getListMultimapCache
in interface RedissonClient
public <K,V> RListMultimapCache<K,V> getListMultimapCache(String name, Codec codec)
RedissonClient
If eviction is not required then it's better to use regular map RedissonClient.getSetMultimap(String, Codec)
.
getListMultimapCache
in interface RedissonClient
public <K,V> RSetMultimap<K,V> getSetMultimap(String name, Codec codec)
RedissonClient
getSetMultimap
in interface RedissonClient
public <V> RSetCache<V> getSetCache(String name)
RedissonClient
name
.
Supports value eviction with a given TTL value.
If eviction is not required then it's better to use regular map RedissonClient.getSet(String, Codec)
.
getSetCache
in interface RedissonClient
public <V> RSetCache<V> getSetCache(String name, Codec codec)
RedissonClient
name
.
Supports value eviction with a given TTL value.
If eviction is not required then it's better to use regular map RedissonClient.getSet(String, Codec)
.
getSetCache
in interface RedissonClient
public <K,V> RMapCache<K,V> getMapCache(String name)
RedissonClient
If eviction is not required then it's better to use regular map RedissonClient.getMap(String)
.
getMapCache
in interface RedissonClient
public <K,V> RMapCache<K,V> getMapCache(String name, Codec codec)
RedissonClient
name
using provided codec
for both cache keys and values.
Supports entry eviction with a given TTL value.
If eviction is not required then it's better to use regular map RedissonClient.getMap(String, Codec)
.
getMapCache
in interface RedissonClient
public <K,V> RMap<K,V> getMap(String name, Codec codec)
RedissonClient
getMap
in interface RedissonClient
name
- of mappublic RLock getLock(String name)
RedissonClient
getLock
in interface RedissonClient
name
- of lockpublic RLock getFairLock(String name)
RedissonClient
getFairLock
in interface RedissonClient
public RReadWriteLock getReadWriteLock(String name)
RedissonClient
getReadWriteLock
in interface RedissonClient
public <V> RSet<V> getSet(String name)
RedissonClient
getSet
in interface RedissonClient
name
- of setpublic <V> RSet<V> getSet(String name, Codec codec)
RedissonClient
getSet
in interface RedissonClient
name
- of setpublic RScript getScript()
RedissonClient
getScript
in interface RedissonClient
public RRemoteService getRemoteSerivce()
RedissonClient
getRemoteSerivce
in interface RedissonClient
public RRemoteService getRemoteSerivce(String name)
RedissonClient
getRemoteSerivce
in interface RedissonClient
name
- The name used as the Redis key prefix for the servicespublic RRemoteService getRemoteSerivce(Codec codec)
RedissonClient
getRemoteSerivce
in interface RedissonClient
public RRemoteService getRemoteSerivce(String name, Codec codec)
RedissonClient
getRemoteSerivce
in interface RedissonClient
name
- The name used as the Redis key prefix for the servicespublic <V> RSortedSet<V> getSortedSet(String name)
RedissonClient
getSortedSet
in interface RedissonClient
name
- of sorted setpublic <V> RSortedSet<V> getSortedSet(String name, Codec codec)
RedissonClient
getSortedSet
in interface RedissonClient
name
- of sorted setpublic <V> RScoredSortedSet<V> getScoredSortedSet(String name)
RedissonClient
getScoredSortedSet
in interface RedissonClient
name
- of scored sorted setpublic <V> RScoredSortedSet<V> getScoredSortedSet(String name, Codec codec)
RedissonClient
getScoredSortedSet
in interface RedissonClient
name
- of scored sorted setpublic RLexSortedSet getLexSortedSet(String name)
RedissonClient
getLexSortedSet
in interface RedissonClient
public <M> RTopic<M> getTopic(String name)
RedissonClient
getTopic
in interface RedissonClient
name
- of topicpublic <M> RTopic<M> getTopic(String name, Codec codec)
RedissonClient
getTopic
in interface RedissonClient
name
- of topicpublic <M> RPatternTopic<M> getPatternTopic(String pattern)
RedissonClient
getPatternTopic
in interface RedissonClient
pattern
- of the topicpublic <M> RPatternTopic<M> getPatternTopic(String pattern, Codec codec)
RedissonClient
getPatternTopic
in interface RedissonClient
pattern
- of the topicpublic <V> RQueue<V> getQueue(String name)
RedissonClient
getQueue
in interface RedissonClient
name
- of queuepublic <V> RQueue<V> getQueue(String name, Codec codec)
RedissonClient
getQueue
in interface RedissonClient
name
- of queuepublic <V> RBlockingQueue<V> getBlockingQueue(String name)
RedissonClient
getBlockingQueue
in interface RedissonClient
name
- of queuepublic <V> RBlockingQueue<V> getBlockingQueue(String name, Codec codec)
RedissonClient
getBlockingQueue
in interface RedissonClient
name
- of queuepublic <V> RDeque<V> getDeque(String name)
RedissonClient
getDeque
in interface RedissonClient
name
- of dequepublic <V> RDeque<V> getDeque(String name, Codec codec)
RedissonClient
getDeque
in interface RedissonClient
name
- of dequepublic <V> RBlockingDeque<V> getBlockingDeque(String name)
RedissonClient
getBlockingDeque
in interface RedissonClient
name
- of dequepublic <V> RBlockingDeque<V> getBlockingDeque(String name, Codec codec)
RedissonClient
getBlockingDeque
in interface RedissonClient
name
- of dequepublic RAtomicLong getAtomicLong(String name)
RedissonClient
getAtomicLong
in interface RedissonClient
name
- of atomicLongpublic RAtomicDouble getAtomicDouble(String name)
RedissonClient
getAtomicDouble
in interface RedissonClient
name
- of atomicLongpublic RCountDownLatch getCountDownLatch(String name)
RedissonClient
getCountDownLatch
in interface RedissonClient
name
- of countDownLatchpublic RBitSet getBitSet(String name)
RedissonClient
getBitSet
in interface RedissonClient
name
- of bitSetpublic RSemaphore getSemaphore(String name)
RedissonClient
getSemaphore
in interface RedissonClient
name
- of semaphorepublic <V> RBloomFilter<V> getBloomFilter(String name)
RedissonClient
getBloomFilter
in interface RedissonClient
name
- of bloom filterpublic <V> RBloomFilter<V> getBloomFilter(String name, Codec codec)
RedissonClient
getBloomFilter
in interface RedissonClient
name
- of bloom filterpublic RKeys getKeys()
RedissonClient
getKeys
in interface RedissonClient
public RBatch createBatch()
RedissonClient
createBatch
in interface RedissonClient
public void shutdown()
RedissonClient
shutdown
in interface RedissonClient
public void shutdown(long quietPeriod, long timeout, TimeUnit unit)
RedissonClient
shutdown
in interface RedissonClient
quietPeriod
- the quiet period as described in the documentationtimeout
- the maximum amount of time to wait until the executor is RedissonClient.shutdown()
regardless if a task was submitted during the quiet periodunit
- the unit of quietPeriod
and timeout
public Config getConfig()
RedissonClient
getConfig
in interface RedissonClient
public NodesGroup<Node> getNodesGroup()
RedissonClient
getNodesGroup
in interface RedissonClient
public NodesGroup<ClusterNode> getClusterNodesGroup()
RedissonClient
getClusterNodesGroup
in interface RedissonClient
public boolean isShutdown()
RedissonClient
true
if this Redisson instance has been shut down.isShutdown
in interface RedissonClient
public boolean isShuttingDown()
RedissonClient
true
if this Redisson instance was started to be shutdown
or was shutdown RedissonClient.isShutdown()
already.isShuttingDown
in interface RedissonClient
Copyright © 2014–2016. All rights reserved.