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)
Returns a list of object holder instances by a key pattern.
|
void |
flushall()
Use
RKeys.flushall() |
void |
flushdb()
Use
RKeys.flushdb() |
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.
|
<V> List<RBucket<V>> |
getBuckets(String pattern)
|
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.
|
<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.
|
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.
|
<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.
|
<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)
Returns Redis object mapped by key.
|
<V> Map<String,V> |
loadBucketValues(String... keys)
Returns Redis object mapped by key.
|
void |
saveBuckets(Map<String,?> buckets)
Saves Redis object mapped by key.
|
void |
shutdown()
Shuts down Redisson instance NOT Redis server
|
public static RedissonClient create()
public static RedissonClient create(Config config)
config
- public static RedissonReactiveClient createReactive()
public static RedissonReactiveClient createReactive(Config config)
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 <V> List<RBucket<V>> findBuckets(String pattern)
RedissonClient
Returns a list of object holder instances by a key pattern.
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 h[^e]llo matches hallo, hbllo, ... but not hello h[a-b]llo matches hallo and hbllo
Use \ to escape special characters if you want to match them verbatim.
Uses KEYS
Redis command.
findBuckets
in interface RedissonClient
public <V> Map<String,V> loadBucketValues(Collection<String> keys)
RedissonClient
Returns Redis object mapped by key. Result Map is not contains key-value entry for null values.
Uses MGET
Redis command.
loadBucketValues
in interface RedissonClient
public <V> Map<String,V> loadBucketValues(String... keys)
RedissonClient
Returns Redis object mapped by key. Result Map is not contains key-value entry for null values.
Uses MGET
Redis command.
loadBucketValues
in interface RedissonClient
public void saveBuckets(Map<String,?> buckets)
RedissonClient
saveBuckets
in interface RedissonClient
public <V> List<RBucket<V>> getBuckets(String pattern)
RedissonClient
getBuckets
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> 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 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 <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 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 void flushdb()
RedissonClient
RKeys.flushdb()
flushdb
in interface RedissonClient
public void flushall()
RedissonClient
RKeys.flushall()
flushall
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.