com.github.lontime.shaded.org.redisson.api.RedissonReactiveClient Maven / Gradle / Ivy
/**
* Copyright (c) 2013-2021 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.github.lontime.shaded.org.redisson.api;
import com.github.lontime.shaded.org.redisson.client.codec.Codec;
import com.github.lontime.shaded.org.redisson.codec.JsonCodec;
import com.github.lontime.shaded.org.redisson.config.Config;
import java.util.List;
/**
* Main Redisson interface for access
* to all redisson objects with Reactive interface.
*
* @see RedissonRxClient
* @see RedissonClient
*
* @author Nikita Koksharov
*
*/
public interface RedissonReactiveClient {
/**
* Returns time-series instance by name
*
* @param type of value
* @param name - name of instance
* @return RTimeSeries object
*/
RTimeSeriesReactive getTimeSeries(String name);
/**
* Returns time-series instance by name
* using provided codec
for values.
*
* @param type of value
* @param name - name of instance
* @param codec - codec for values
* @return RTimeSeries object
*/
RTimeSeriesReactive getTimeSeries(String name, Codec codec);
/**
* Returns stream instance by name
*
* Requires Redis 5.0.0 and higher.
*
* @param type of key
* @param type of value
* @param name of stream
* @return RStream object
*/
RStreamReactive getStream(String name);
/**
* Returns stream instance by name
* using provided codec
for entries.
*
* Requires Redis 5.0.0 and higher.
*
* @param type of key
* @param type of value
* @param name - name of stream
* @param codec - codec for entry
* @return RStream object
*/
RStreamReactive getStream(String name, Codec codec);
/**
* Returns geospatial items holder instance by name
.
*
* @param type of value
* @param name - name of object
* @return Geo object
*/
RGeoReactive getGeo(String name);
/**
* Returns geospatial items holder instance by name
* using provided codec for geospatial members.
*
* @param type of value
* @param name - name of object
* @param codec - codec for value
* @return Geo object
*/
RGeoReactive getGeo(String name, Codec codec);
/**
* Returns rate limiter instance by name
*
* @param name of rate limiter
* @return RateLimiter object
*/
RRateLimiterReactive getRateLimiter(String name);
/**
* Returns binary stream holder instance by name
*
* @param name of binary stream
* @return BinaryStream object
*/
RBinaryStreamReactive getBinaryStream(String name);
/**
* Returns semaphore instance by name
*
* @param name - name of object
* @return Semaphore object
*/
RSemaphoreReactive getSemaphore(String name);
/**
* Returns semaphore instance by name.
* Supports lease time parameter for each acquired permit.
*
* @param name - name of object
* @return PermitExpirableSemaphore object
*/
RPermitExpirableSemaphoreReactive getPermitExpirableSemaphore(String name);
/**
* Returns ReadWriteLock instance by name.
*
* To increase reliability during failover, all operations wait for propagation to all Redis slaves.
*
* @param name - name of object
* @return Lock object
*/
RReadWriteLockReactive getReadWriteLock(String name);
/**
* Returns Lock instance by name.
*
* Implements a fair locking so it guarantees an acquire order by threads.
*
* To increase reliability during failover, all operations wait for propagation to all Redis slaves.
*
* @param name - name of object
* @return Lock object
*/
RLockReactive getFairLock(String name);
/**
* Returns Lock instance by name.
*
* Implements a non-fair locking so doesn't guarantees an acquire order by threads.
*
* To increase reliability during failover, all operations wait for propagation to all Redis slaves.
*
* @param name - name of object
* @return Lock object
*/
RLockReactive getLock(String name);
/**
* Returns Spin lock instance by name.
*
* Implements a non-fair locking so doesn't guarantees an acquire order by threads.
*
* Lock doesn't use a pub/sub mechanism
*
* @param name - name of object
* @return Lock object
*/
RLockReactive getSpinLock(String name);
/**
* Returns Spin lock instance by name with specified back off options.
*
* Implements a non-fair locking so doesn't guarantees an acquire order by threads.
*
* Lock doesn't use a pub/sub mechanism
*
* @param name - name of object
* @return Lock object
*/
RLockReactive getSpinLock(String name, LockOptions.BackOff backOff);
/**
* Returns MultiLock instance associated with specified locks
*
* @param locks - collection of locks
* @return MultiLock object
*/
RLockReactive getMultiLock(RLockReactive... locks);
/*
* Use getMultiLock(RLockReactive) method instead
*/
@Deprecated
RLockReactive getMultiLock(RLock... locks);
/*
* Use getMultiLock method instead. Returned instance uses Redis Slave synchronization
*/
@Deprecated
RLockReactive getRedLock(RLock... locks);
/**
* Returns CountDownLatch instance by name.
*
* @param name - name of object
* @return CountDownLatch object
*/
RCountDownLatchReactive getCountDownLatch(String name);
/**
* Returns set-based cache instance by name
.
* Supports value eviction with a given TTL value.
*
*
If eviction is not required then it's better to use regular map {@link #getSet(String, Codec)}.
*
* @param type of values
* @param name - name of object
* @return SetCache object
*/
RSetCacheReactive getSetCache(String name);
/**
* Returns set-based cache instance by name
.
* Supports value eviction with a given TTL value.
*
* If eviction is not required then it's better to use regular map {@link #getSet(String, Codec)}.
*
* @param type of values
* @param name - name of object
* @param codec - codec for values
* @return SetCache object
*/
RSetCacheReactive getSetCache(String name, Codec codec);
/**
* 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 {@link #getMap(String, Codec)}.
*
* @param type of keys
* @param type of values
* @param name - name of object
* @param codec - codec for values
* @return MapCache object
*/
RMapCacheReactive getMapCache(String name, Codec codec);
/**
* 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 {@link #getMap(String, Codec, MapOptions)}.
*
* @param type of key
* @param type of value
* @param name - object name
* @param codec - codec for keys and values
* @param options - map options
* @return MapCache object
*/
RMapCacheReactive getMapCache(String name, Codec codec, MapOptions options);
/**
* 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 {@link #getMap(String)}.
*
* @param type of keys
* @param type of values
* @param name - name of object
* @return MapCache object
*/
RMapCacheReactive getMapCache(String name);
/**
* 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 {@link #getMap(String, MapOptions)}.
*
* @param type of key
* @param type of value
* @param name - name of object
* @param options - map options
* @return MapCache object
*/
RMapCacheReactive getMapCache(String name, MapOptions options);
/**
* Returns object holder instance by name
*
* @param type of value
* @param name - name of object
* @return Bucket object
*/
RBucketReactive getBucket(String name);
/**
* Returns object holder instance by name
* using provided codec for object.
*
* @param type of value
* @param name - name of object
* @param codec - codec for value
* @return Bucket object
*/
RBucketReactive getBucket(String name, Codec codec);
/**
* Returns interface for mass operations with Bucket objects.
*
* @return Buckets
*/
RBucketsReactive getBuckets();
/**
* Returns interface for mass operations with Bucket objects
* using provided codec for object.
*
* @param codec - codec for bucket objects
* @return Buckets
*/
RBucketsReactive getBuckets(Codec codec);
/**
* Returns a list of object holder instances by a key pattern
*
* @param type of value
* @param pattern - pattern for name of buckets
* @return list of buckets
*/
List> findBuckets(String pattern);
/**
* Returns JSON data holder instance by name using provided codec.
*
* @param type of value
* @param name name of object
* @param codec codec for values
* @return JsonBucket object
*/
RJsonBucketReactive getJsonBucket(String name, JsonCodec codec);
/**
* Returns HyperLogLog instance by name.
*
* @param type of values
* @param name - name of object
* @return HyperLogLog object
*/
RHyperLogLogReactive getHyperLogLog(String name);
/**
* Returns HyperLogLog instance by name
* using provided codec for hll objects.
*
* @param type of values
* @param name - name of object
* @param codec - codec of values
* @return HyperLogLog object
*/
RHyperLogLogReactive getHyperLogLog(String name, Codec codec);
/**
* Returns id generator by name.
*
* @param name - name of object
* @return IdGenerator object
*/
RIdGeneratorReactive getIdGenerator(String name);
/**
* Returns list instance by name.
*
* @param type of values
* @param name - name of object
* @return List object
*/
RListReactive getList(String name);
/**
* Returns list instance by name
* using provided codec for list objects.
*
* @param type of values
* @param name - name of object
* @param codec - codec for values
* @return List object
*/
RListReactive getList(String name, Codec codec);
/**
* Returns List based Multimap instance by name.
*
* @param type of key
* @param type of value
* @param name - name of object
* @return ListMultimap object
*/
RListMultimapReactive getListMultimap(String name);
/**
* Returns List based Multimap instance by name
* using provided codec for both map keys and values.
*
* @param type of key
* @param type of value
* @param name - name of object
* @param codec - codec for keys and values
* @return RListMultimapReactive object
*/
RListMultimapReactive getListMultimap(String name, Codec codec);
/**
* Returns List based Multimap cache instance by name.
* Supports key eviction by specifying a time to live.
* If eviction is not required then it's better to use regular list multimap {@link #getListMultimap(String)}.
*
* @param type of key
* @param type of value
* @param name - name of object
* @return RListMultimapCacheReactive object
*/
RListMultimapCacheReactive getListMultimapCache(String name);
/**
* Returns List based Multimap cache instance by name using provided codec for both map keys and values.
* Supports key eviction by specifying a time to live.
* If eviction is not required then it's better to use regular list multimap {@link #getListMultimap(String, Codec)}.
*
* @param type of key
* @param type of value
* @param name - name of object
* @param codec - codec for keys and values
* @return RListMultimapCacheReactive object
*/
RListMultimapCacheReactive getListMultimapCache(String name, Codec codec);
/**
* Returns Set based Multimap instance by name.
*
* @param type of key
* @param type of value
* @param name - name of object
* @return SetMultimap object
*/
RSetMultimapReactive getSetMultimap(String name);
/**
* Returns Set based Multimap instance by name
* using provided codec for both map keys and values.
*
* @param type of key
* @param type of value
* @param name - name of object
* @param codec - codec for keys and values
* @return SetMultimap object
*/
RSetMultimapReactive getSetMultimap(String name, Codec codec);
/**
* Returns Set based Multimap cache instance by name.
* Supports key eviction by specifying a time to live.
* If eviction is not required then it's better to use regular set multimap {@link #getSetMultimap(String)}.
*
* @param type of key
* @param type of value
* @param name - name of object
* @return RSetMultimapCacheReactive object
*/
RSetMultimapCacheReactive getSetMultimapCache(String name);
/**
* Returns Set based Multimap cache instance by name using provided codec for both map keys and values.
* Supports key eviction by specifying a time to live.
* If eviction is not required then it's better to use regular set multimap {@link #getSetMultimap(String, Codec)}.
*
* @param type of key
* @param type of value
* @param name - name of object
* @param codec - codec for keys and values
* @return RSetMultimapCacheReactive object
*/
RSetMultimapCacheReactive getSetMultimapCache(String name, Codec codec);
/**
* Returns map instance by name.
*
* @param type of keys
* @param type of values
* @param name - name of object
* @return Map object
*/
RMapReactive getMap(String name);
/**
* Returns map instance by name.
*
* @param type of key
* @param type of value
* @param name - name of object
* @param options - map options
* @return Map object
*/
RMapReactive getMap(String name, MapOptions options);
/**
* Returns map instance by name
* using provided codec for both map keys and values.
*
* @param type of keys
* @param type of values
* @param name - name of object
* @param codec - codec for keys and values
* @return Map object
*/
RMapReactive getMap(String name, Codec codec);
/**
* Returns map instance by name
* using provided codec for both map keys and values.
*
* @param type of key
* @param type of value
* @param name - name of object
* @param codec - codec for keys and values
* @param options - map options
* @return Map object
*/
RMapReactive getMap(String name, Codec codec, MapOptions options);
/**
* Returns set instance by name.
*
* @param type of values
* @param name - name of object
* @return Set object
*/
RSetReactive getSet(String name);
/**
* Returns set instance by name
* using provided codec for set objects.
*
* @param type of values
* @param name - name of set
* @param codec - codec for values
* @return Set object
*/
RSetReactive getSet(String name, Codec codec);
/**
* Returns Redis Sorted Set instance by name.
* This sorted set sorts objects by object score.
*
* @param type of values
* @param name of scored sorted set
* @return ScoredSortedSet object
*/
RScoredSortedSetReactive getScoredSortedSet(String name);
/**
* Returns Redis Sorted Set instance by name
* using provided codec for sorted set objects.
* This sorted set sorts objects by object score.
*
* @param type of values
* @param name - name of scored sorted set
* @param codec - codec for values
* @return ScoredSortedSet object
*/
RScoredSortedSetReactive getScoredSortedSet(String name, Codec codec);
/**
* 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
*
* @param name - name of object
* @return LexSortedSet object
*/
RLexSortedSetReactive getLexSortedSet(String name);
/**
* Returns Sharded Topic instance by name.
*
* Messages are delivered to message listeners connected to the same Topic.
*
*
* @param name - name of object
* @return Topic object
*/
RShardedTopicReactive getShardedTopic(String name);
/**
* Returns Sharded Topic instance by name using provided codec for messages.
*
* Messages are delivered to message listeners connected to the same Topic.
*
*
* @param name - name of object
* @param codec - codec for message
* @return Topic object
*/
RShardedTopicReactive getShardedTopic(String name, Codec codec);
/**
* Returns topic instance by name.
*
* @param name - name of object
* @return Topic object
*/
RTopicReactive getTopic(String name);
/**
* Returns topic instance by name
* using provided codec for messages.
*
* @param name - name of object
* @param codec - codec for message
* @return Topic object
*/
RTopicReactive getTopic(String name, Codec codec);
/**
* Returns reliable topic instance by name.
*
* Dedicated Redis connection is allocated per instance (subscriber) of this object.
* Messages are delivered to all listeners attached to the same Redis setup.
*
* Requires Redis 5.0.0 and higher.
*
* @param name - name of object
* @return ReliableTopic object
*/
RReliableTopicReactive getReliableTopic(String name);
/**
* Returns reliable topic instance by name
* using provided codec for messages.
*
* Dedicated Redis connection is allocated per instance (subscriber) of this object.
* Messages are delivered to all listeners attached to the same Redis setup.
*
* Requires Redis 5.0.0 and higher.
*
* @param name - name of object
* @param codec - codec for message
* @return ReliableTopic object
*/
RReliableTopicReactive getReliableTopic(String name, Codec codec);
/**
* 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
*
* @param pattern of the topic
* @return PatternTopic object
*/
RPatternTopicReactive getPatternTopic(String pattern);
/**
* 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
*
* @param pattern of the topic
* @param codec - codec for message
* @return PatternTopic object
*/
RPatternTopicReactive getPatternTopic(String pattern, Codec codec);
/**
* Returns queue instance by name.
*
* @param type of values
* @param name - name of object
* @return Queue object
*/
RQueueReactive getQueue(String name);
/**
* Returns queue instance by name
* using provided codec for queue objects.
*
* @param type of values
* @param name - name of object
* @param codec - codec for values
* @return Queue object
*/
RQueueReactive getQueue(String name, Codec codec);
/**
* Returns RingBuffer based queue.
*
* @param value type
* @param name - name of object
* @return RingBuffer object
*/
RRingBufferReactive getRingBuffer(String name);
/**
* Returns RingBuffer based queue.
*
* @param value type
* @param name - name of object
* @param codec - codec for values
* @return RingBuffer object
*/
RRingBufferReactive getRingBuffer(String name, Codec codec);
/**
* Returns blocking queue instance by name.
*
* @param type of values
* @param name - name of object
* @return BlockingQueue object
*/
RBlockingQueueReactive getBlockingQueue(String name);
/**
* Returns blocking queue instance by name
* using provided codec for queue objects.
*
* @param type of values
* @param name - name of object
* @param codec - code for values
* @return BlockingQueue object
*/
RBlockingQueueReactive getBlockingQueue(String name, Codec codec);
/**
* Returns unbounded blocking deque instance by name.
*
* @param type of value
* @param name - name of object
* @return BlockingDeque object
*/
RBlockingDequeReactive getBlockingDeque(String name);
/**
* Returns unbounded blocking deque instance by name
* using provided codec for deque objects.
*
* @param type of value
* @param name - name of object
* @param codec - deque objects codec
* @return BlockingDeque object
*/
RBlockingDequeReactive getBlockingDeque(String name, Codec codec);
/**
* Returns transfer queue instance by name.
*
* @param type of values
* @param name - name of object
* @return TransferQueue object
*/
RTransferQueueReactive getTransferQueue(String name);
/**
* Returns transfer queue instance by name
* using provided codec for queue objects.
*
* @param type of values
* @param name - name of object
* @param codec - code for values
* @return TransferQueue object
*/
RTransferQueueReactive getTransferQueue(String name, Codec codec);
/**
* Returns deque instance by name.
*
* @param type of values
* @param name - name of object
* @return Deque object
*/
RDequeReactive getDeque(String name);
/**
* Returns deque instance by name
* using provided codec for deque objects.
*
* @param type of values
* @param name - name of object
* @param codec - coded for values
* @return Deque object
*/
RDequeReactive getDeque(String name, Codec codec);
/**
* Returns "atomic long" instance by name.
*
* @param name of the "atomic long"
* @return AtomicLong object
*/
RAtomicLongReactive getAtomicLong(String name);
/**
* Returns "atomic double" instance by name.
*
* @param name of the "atomic double"
* @return AtomicLong object
*/
RAtomicDoubleReactive getAtomicDouble(String name);
/**
* Returns object for remote operations prefixed with the default name (redisson_remote_service)
*
* @return RemoteService object
*/
RRemoteService getRemoteService();
/**
* Returns object for remote operations prefixed with the default name (redisson_remote_service)
* and uses provided codec for method arguments and result.
*
* @param codec - codec for response and request
* @return RemoteService object
*/
RRemoteService getRemoteService(Codec codec);
/**
* Returns object for remote operations prefixed with the specified name
*
* @param name - the name used as the Redis key prefix for the services
* @return RemoteService object
*/
RRemoteService getRemoteService(String name);
/**
* Returns object for remote operations prefixed with the specified name
* and uses provided codec for method arguments and result.
*
* @param name - the name used as the Redis key prefix for the services
* @param codec - codec for response and request
* @return RemoteService object
*/
RRemoteService getRemoteService(String name, Codec codec);
/**
* Returns bitSet instance by name.
*
* @param name - name of object
* @return BitSet object
*/
RBitSetReactive getBitSet(String name);
/**
* Returns interface for Redis Function feature
*
* @return function object
*/
RFunctionReactive getFunction();
/**
* Returns interface for Redis Function feature using provided codec
*
* @param codec - codec for params and result
* @return function interface
*/
RFunctionReactive getFunction(Codec codec);
/**
* Returns script operations object
*
* @return Script object
*/
RScriptReactive getScript();
/**
* Returns script operations object using provided codec.
*
* @param codec - codec for params and result
* @return Script object
*/
RScriptReactive getScript(Codec codec);
/**
* Creates transaction with READ_COMMITTED isolation level.
*
* @param options - transaction configuration
* @return Transaction object
*/
RTransactionReactive createTransaction(TransactionOptions options);
/**
* Return batch object which executes group of
* command in pipeline.
*
* See http://redis.io/topics/pipelining
*
* @param options - batch configuration
* @return Batch object
*/
RBatchReactive createBatch(BatchOptions options);
/**
* Return batch object which executes group of
* command in pipeline.
*
* See http://redis.io/topics/pipelining
*
* @return Batch object
*/
RBatchReactive createBatch();
/**
* Returns keys operations.
* Each of Redis/Redisson object associated with own key
*
* @return Keys object
*/
RKeysReactive getKeys();
/**
* Shuts down Redisson instance NOT Redis server
*/
void shutdown();
/**
* Allows to get configuration provided
* during Redisson instance creation. Further changes on
* this object not affect Redisson instance.
*
* @return Config object
*/
Config getConfig();
/**
* Get Redis nodes group for server operations
*
* @return NodesGroup object
*/
NodesGroup getNodesGroup();
/**
* Get Redis cluster nodes group for server operations
*
* @return NodesGroup object
*/
NodesGroup getClusterNodesGroup();
/**
* Returns {@code true} if this Redisson instance has been shut down.
*
* @return true
if this Redisson instance has been shut down otherwise false
*/
boolean isShutdown();
/**
* Returns {@code true} if this Redisson instance was started to be shutdown
* or was shutdown {@link #isShutdown()} already.
*
* @return true
if this Redisson instance was started to be shutdown
* or was shutdown {@link #isShutdown()} already otherwise false
*/
boolean isShuttingDown();
/**
* Returns id of this Redisson instance
*
* @return id
*/
String getId();
}