Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.redisson.RedissonReactive Maven / Gradle / Ivy
Go to download
Easy Redis Java client and Real-Time Data Platform. Valkey compatible. Sync/Async/RxJava3/Reactive API. Client side caching. Over 50 Redis based Java objects and services: JCache API, Apache Tomcat, Hibernate, Spring, Set, Multimap, SortedSet, Map, List, Queue, Deque, Semaphore, Lock, AtomicLong, Map Reduce, Bloom filter, Scheduler, RPC
/**
* Copyright (c) 2013-2024 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 org.redisson;
import org.redisson.api.LocalCachedMapOptions;
import org.redisson.api.MapCacheOptions;
import org.redisson.api.MapOptions;
import org.redisson.api.*;
import org.redisson.api.options.*;
import org.redisson.client.codec.Codec;
import org.redisson.codec.JsonCodec;
import org.redisson.config.Config;
import org.redisson.config.ConfigSupport;
import org.redisson.connection.ConnectionManager;
import org.redisson.eviction.EvictionScheduler;
import org.redisson.liveobject.core.RedissonObjectBuilder;
import org.redisson.reactive.*;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
/**
* Main infrastructure class allows to get access
* to all Redisson objects on top of Redis server.
*
* @author Nikita Koksharov
*
*/
public class RedissonReactive implements RedissonReactiveClient {
protected final WriteBehindService writeBehindService;
protected final EvictionScheduler evictionScheduler;
protected final CommandReactiveExecutor commandExecutor;
protected final ConnectionManager connectionManager;
@Deprecated
protected RedissonReactive(Config config) {
Config configCopy = new Config(config);
connectionManager = ConfigSupport.createConnectionManager(configCopy);
RedissonObjectBuilder objectBuilder = null;
if (config.isReferenceEnabled()) {
objectBuilder = new RedissonObjectBuilder(this);
}
commandExecutor = new CommandReactiveService(connectionManager, objectBuilder);
evictionScheduler = new EvictionScheduler(commandExecutor);
writeBehindService = new WriteBehindService(commandExecutor);
}
protected RedissonReactive(ConnectionManager connectionManager, EvictionScheduler evictionScheduler,
WriteBehindService writeBehindService) {
this.connectionManager = connectionManager;
RedissonObjectBuilder objectBuilder = null;
if (connectionManager.getServiceManager().getCfg().isReferenceEnabled()) {
objectBuilder = new RedissonObjectBuilder(this);
}
commandExecutor = new CommandReactiveService(connectionManager, objectBuilder);
this.evictionScheduler = evictionScheduler;
this.writeBehindService = writeBehindService;
}
public CommandReactiveExecutor getCommandExecutor() {
return commandExecutor;
}
@Override
public RStreamReactive getStream(String name) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonStream(commandExecutor, name), RStreamReactive.class);
}
@Override
public RStreamReactive getStream(String name, Codec codec) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonStream(codec, commandExecutor, name), RStreamReactive.class);
}
@Override
public RStreamReactive getStream(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return ReactiveProxyBuilder.create(commandExecutor,
new RedissonStream(params.getCodec(), ca, params.getName()), RStreamReactive.class);
}
@Override
public RSearchReactive getSearch() {
return getSearch((Codec) null);
}
@Override
public RSearchReactive getSearch(Codec codec) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonSearch(codec, commandExecutor), RSearchReactive.class);
}
@Override
public RSearchReactive getSearch(OptionalOptions options) {
OptionalParams params = (OptionalParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return ReactiveProxyBuilder.create(commandExecutor, new RedissonSearch(params.getCodec(), ca), RSearchReactive.class);
}
@Override
public RGeoReactive getGeo(String name) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonGeo(commandExecutor, name, null),
new RedissonScoredSortedSetReactive(commandExecutor, name), RGeoReactive.class);
}
@Override
public RGeoReactive getGeo(String name, Codec codec) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonGeo(codec, commandExecutor, name, null),
new RedissonScoredSortedSetReactive(codec, commandExecutor, name), RGeoReactive.class);
}
@Override
public RGeoReactive getGeo(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return ReactiveProxyBuilder.create(commandExecutor,
new RedissonGeo(params.getCodec(), ca, params.getName(), null),
new RedissonScoredSortedSetReactive(params.getCodec(), ca, params.getName()), RGeoReactive.class);
}
@Override
public RLockReactive getFairLock(String name) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonFairLock(commandExecutor, name), RLockReactive.class);
}
@Override
public RLockReactive getFairLock(CommonOptions options) {
CommonParams params = (CommonParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return ReactiveProxyBuilder.create(commandExecutor, new RedissonFairLock(ca, params.getName()), RLockReactive.class);
}
@Override
public RRateLimiterReactive getRateLimiter(String name) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonRateLimiter(commandExecutor, name), RRateLimiterReactive.class);
}
@Override
public RRateLimiterReactive getRateLimiter(CommonOptions options) {
CommonParams params = (CommonParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return ReactiveProxyBuilder.create(commandExecutor, new RedissonRateLimiter(ca, params.getName()), RRateLimiterReactive.class);
}
@Override
public RBinaryStreamReactive getBinaryStream(String name) {
RedissonBinaryStream stream = new RedissonBinaryStream(commandExecutor, name);
return ReactiveProxyBuilder.create(commandExecutor, stream,
new RedissonBinaryStreamReactive(commandExecutor, stream), RBinaryStreamReactive.class);
}
@Override
public RBinaryStreamReactive getBinaryStream(CommonOptions options) {
CommonParams params = (CommonParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
RedissonBinaryStream stream = new RedissonBinaryStream(ca, params.getName());
return ReactiveProxyBuilder.create(commandExecutor, stream,
new RedissonBinaryStreamReactive(ca, stream), RBinaryStreamReactive.class);
}
@Override
public RSemaphoreReactive getSemaphore(String name) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonSemaphore(commandExecutor, name), RSemaphoreReactive.class);
}
@Override
public RSemaphoreReactive getSemaphore(CommonOptions options) {
CommonParams params = (CommonParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return ReactiveProxyBuilder.create(commandExecutor, new RedissonSemaphore(ca, params.getName()), RSemaphoreReactive.class);
}
@Override
public RPermitExpirableSemaphoreReactive getPermitExpirableSemaphore(String name) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonPermitExpirableSemaphore(commandExecutor, name), RPermitExpirableSemaphoreReactive.class);
}
@Override
public RPermitExpirableSemaphoreReactive getPermitExpirableSemaphore(CommonOptions options) {
CommonParams params = (CommonParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return ReactiveProxyBuilder.create(commandExecutor,
new RedissonPermitExpirableSemaphore(ca, params.getName()), RPermitExpirableSemaphoreReactive.class);
}
@Override
public RReadWriteLockReactive getReadWriteLock(String name) {
return new RedissonReadWriteLockReactive(commandExecutor, name);
}
@Override
public RReadWriteLockReactive getReadWriteLock(CommonOptions options) {
CommonParams params = (CommonParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return new RedissonReadWriteLockReactive(ca, params.getName());
}
@Override
public RLockReactive getLock(String name) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonLock(commandExecutor, name), RLockReactive.class);
}
@Override
public RLockReactive getLock(CommonOptions options) {
CommonParams params = (CommonParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return ReactiveProxyBuilder.create(commandExecutor, new RedissonLock(ca, params.getName()), RLockReactive.class);
}
@Override
public RLockReactive getSpinLock(String name) {
return getSpinLock(name, LockOptions.defaults());
}
@Override
public RLockReactive getSpinLock(String name, LockOptions.BackOff backOff) {
RedissonSpinLock spinLock = new RedissonSpinLock(commandExecutor, name, backOff);
return ReactiveProxyBuilder.create(commandExecutor, spinLock, RLockReactive.class);
}
@Override
public RFencedLockReactive getFencedLock(String name) {
RedissonFencedLock lock = new RedissonFencedLock(commandExecutor, name);
return ReactiveProxyBuilder.create(commandExecutor, lock, RFencedLockReactive.class);
}
@Override
public RFencedLockReactive getFencedLock(CommonOptions options) {
CommonParams params = (CommonParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
RedissonFencedLock lock = new RedissonFencedLock(ca, params.getName());
return ReactiveProxyBuilder.create(commandExecutor, lock, RFencedLockReactive.class);
}
@Override
public RLockReactive getMultiLock(RLockReactive... locks) {
RLock[] ls = Arrays.stream(locks)
.map(l -> new RedissonLock(commandExecutor, l.getName()))
.toArray(RLock[]::new);
return ReactiveProxyBuilder.create(commandExecutor, new RedissonMultiLock(ls), RLockReactive.class);
}
@Override
public RLockReactive getMultiLock(String group, Collection values) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonFasterMultiLock(commandExecutor, group, values), RLockReactive.class);
}
@Override
public RLockReactive getMultiLock(RLock... locks) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonMultiLock(locks), RLockReactive.class);
}
@Override
public RLockReactive getRedLock(RLock... locks) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonRedLock(locks), RLockReactive.class);
}
@Override
public RCountDownLatchReactive getCountDownLatch(String name) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonCountDownLatch(commandExecutor, name), RCountDownLatchReactive.class);
}
@Override
public RCountDownLatchReactive getCountDownLatch(CommonOptions options) {
CommonParams params = (CommonParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return ReactiveProxyBuilder.create(commandExecutor, new RedissonCountDownLatch(ca, params.getName()), RCountDownLatchReactive.class);
}
@Override
public RMapCacheReactive getMapCache(String name, Codec codec) {
RMapCache map = new RedissonMapCache(codec, evictionScheduler, commandExecutor, name, null, null, writeBehindService);
return ReactiveProxyBuilder.create(commandExecutor, map,
new RedissonMapCacheReactive<>(map, commandExecutor), RMapCacheReactive.class);
}
@Override
public RMapCacheReactive getMapCache(String name) {
RMapCache map = new RedissonMapCache(evictionScheduler, commandExecutor, name, null, null, writeBehindService);
return ReactiveProxyBuilder.create(commandExecutor, map,
new RedissonMapCacheReactive<>(map, commandExecutor), RMapCacheReactive.class);
}
@Override
public RMapCacheReactive getMapCache(org.redisson.api.options.MapCacheOptions options) {
MapCacheParams params = (MapCacheParams) options;
MapCacheOptions ops = createOptions(params);
CommandReactiveExecutor ca = commandExecutor.copy(params);
RMapCache map = new RedissonMapCache<>(params.getCodec(), evictionScheduler, ca,
params.getName(), null, ops, writeBehindService);
return ReactiveProxyBuilder.create(commandExecutor, map,
new RedissonMapCacheReactive<>(map, ca), RMapCacheReactive.class);
}
@Override
public RMapCacheNativeReactive getMapCacheNative(String name) {
RMapCacheNative map = new RedissonMapCacheNative<>(commandExecutor, name, null, null, writeBehindService);
return ReactiveProxyBuilder.create(commandExecutor, map,
new RedissonMapCacheReactive<>(map, commandExecutor), RMapCacheNativeReactive.class);
}
@Override
public RMapCacheNativeReactive getMapCacheNative(String name, Codec codec) {
RMapCacheNative map = new RedissonMapCacheNative<>(codec, commandExecutor, name, null, null, writeBehindService);
return ReactiveProxyBuilder.create(commandExecutor, map,
new RedissonMapCacheReactive<>(map, commandExecutor), RMapCacheNativeReactive.class);
}
@Override
public RMapCacheNativeReactive getMapCacheNative(org.redisson.api.options.MapOptions options) {
MapParams params = (MapParams) options;
MapOptions ops = createOptions(params);
CommandReactiveExecutor ca = commandExecutor.copy(params);
RMapCacheNative map = new RedissonMapCacheNative<>(params.getCodec(), ca,
params.getName(), null, ops, writeBehindService);
return ReactiveProxyBuilder.create(commandExecutor, map,
new RedissonMapCacheReactive<>(map, ca), RMapCacheNativeReactive.class);
}
private static MapOptions createOptions(MapParams params) {
MapOptions ops = MapOptions.defaults()
.loader(params.getLoader())
.loaderAsync(params.getLoaderAsync())
.writer(params.getWriter())
.writerAsync(params.getWriterAsync())
.writeBehindDelay(params.getWriteBehindDelay())
.writeBehindBatchSize(params.getWriteBehindBatchSize())
.writerRetryInterval(Duration.ofMillis(params.getWriteRetryInterval()));
if (params.getWriteMode() != null) {
ops.writeMode(MapOptions.WriteMode.valueOf(params.getWriteMode().toString()));
}
if (params.getWriteRetryAttempts() > 0) {
ops.writerRetryAttempts(params.getWriteRetryAttempts());
}
return ops;
}
private static MapCacheOptions createOptions(MapCacheParams params) {
MapCacheOptions ops = MapCacheOptions.defaults()
.loader(params.getLoader())
.loaderAsync(params.getLoaderAsync())
.writer(params.getWriter())
.writerAsync(params.getWriterAsync())
.writeBehindDelay(params.getWriteBehindDelay())
.writeBehindBatchSize(params.getWriteBehindBatchSize())
.writerRetryInterval(Duration.ofMillis(params.getWriteRetryInterval()));
if (params.getWriteMode() != null) {
ops.writeMode(MapOptions.WriteMode.valueOf(params.getWriteMode().toString()));
}
if (params.getWriteRetryAttempts() > 0) {
ops.writerRetryAttempts(params.getWriteRetryAttempts());
}
if (params.isRemoveEmptyEvictionTask()) {
ops.removeEmptyEvictionTask();
}
return ops;
}
@Override
public RBucketReactive getBucket(String name) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonBucket(commandExecutor, name), RBucketReactive.class);
}
@Override
public RBucketReactive getBucket(String name, Codec codec) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonBucket(codec, commandExecutor, name), RBucketReactive.class);
}
@Override
public RBucketReactive getBucket(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return ReactiveProxyBuilder.create(commandExecutor,
new RedissonBucket(params.getCodec(), ca, params.getName()), RBucketReactive.class);
}
@Override
public RBucketsReactive getBuckets() {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonBuckets(commandExecutor), RBucketsReactive.class);
}
@Override
public RBucketsReactive getBuckets(Codec codec) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonBuckets(codec, commandExecutor), RBucketsReactive.class);
}
@Override
public RBucketsReactive getBuckets(OptionalOptions options) {
OptionalParams params = (OptionalParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return ReactiveProxyBuilder.create(commandExecutor, new RedissonBuckets(params.getCodec(), ca), RBucketsReactive.class);
}
@Override
public List> findBuckets(String pattern) {
RKeys redissonKeys = new RedissonKeys(commandExecutor);
Iterable keys = redissonKeys.getKeysByPattern(pattern);
List> buckets = new ArrayList>();
for (Object key : keys) {
if (key != null) {
buckets.add(this.getBucket(key.toString()));
}
}
return buckets;
}
@Override
public RJsonBucketReactive getJsonBucket(String name, JsonCodec codec) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonJsonBucket(codec, commandExecutor, name), RJsonBucketReactive.class);
}
@Override
public RJsonBucketReactive getJsonBucket(JsonBucketOptions options) {
JsonBucketParams params = (JsonBucketParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return ReactiveProxyBuilder.create(commandExecutor,
new RedissonJsonBucket(params.getCodec(), ca, params.getName()), RJsonBucketReactive.class);
}
@Override
public RJsonBucketsReactive getJsonBuckets(JsonCodec codec) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonJsonBuckets(codec, commandExecutor), RJsonBucketsReactive.class);
}
@Override
public RHyperLogLogReactive getHyperLogLog(String name) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonHyperLogLog(commandExecutor, name), RHyperLogLogReactive.class);
}
@Override
public RHyperLogLogReactive getHyperLogLog(String name, Codec codec) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonHyperLogLog(codec, commandExecutor, name), RHyperLogLogReactive.class);
}
@Override
public RHyperLogLogReactive getHyperLogLog(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return ReactiveProxyBuilder.create(commandExecutor,
new RedissonHyperLogLog(params.getCodec(), ca, params.getName()), RHyperLogLogReactive.class);
}
@Override
public RIdGeneratorReactive getIdGenerator(String name) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonIdGenerator(commandExecutor, name), RIdGeneratorReactive.class);
}
@Override
public RIdGeneratorReactive getIdGenerator(CommonOptions options) {
CommonParams params = (CommonParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return ReactiveProxyBuilder.create(commandExecutor, new RedissonIdGenerator(ca, params.getName()), RIdGeneratorReactive.class);
}
@Override
public RListReactive getList(String name) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonList(commandExecutor, name, null),
new RedissonListReactive(commandExecutor, name), RListReactive.class);
}
@Override
public RListReactive getList(String name, Codec codec) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonList(codec, commandExecutor, name, null),
new RedissonListReactive(codec, commandExecutor, name), RListReactive.class);
}
@Override
public RListReactive getList(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return ReactiveProxyBuilder.create(commandExecutor, new RedissonList(params.getCodec(), ca, params.getName(), null),
new RedissonListReactive(params.getCodec(), ca, params.getName()), RListReactive.class);
}
@Override
public RListMultimapReactive getListMultimap(String name) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonListMultimap(commandExecutor, name),
new RedissonListMultimapReactive(commandExecutor, name), RListMultimapReactive.class);
}
@Override
public RListMultimapReactive getListMultimap(String name, Codec codec) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonListMultimap(codec, commandExecutor, name),
new RedissonListMultimapReactive(codec, commandExecutor, name), RListMultimapReactive.class);
}
@Override
public RListMultimapReactive getListMultimap(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return ReactiveProxyBuilder.create(commandExecutor, new RedissonListMultimap(params.getCodec(), ca, params.getName()),
new RedissonListMultimapReactive(params.getCodec(), ca, params.getName()), RListMultimapReactive.class);
}
@Override
public RSetMultimapReactive getSetMultimap(String name) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonSetMultimap(commandExecutor, name),
new RedissonSetMultimapReactive(commandExecutor, name, this), RSetMultimapReactive.class);
}
@Override
public RSetMultimapReactive getSetMultimap(String name, Codec codec) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonSetMultimap(codec, commandExecutor, name),
new RedissonSetMultimapReactive(codec, commandExecutor, name, this), RSetMultimapReactive.class);
}
@Override
public RSetMultimapReactive getSetMultimap(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return ReactiveProxyBuilder.create(commandExecutor, new RedissonSetMultimap(params.getCodec(), ca, params.getName()),
new RedissonSetMultimapReactive(params.getCodec(), ca, params.getName(), this), RSetMultimapReactive.class);
}
@Override
public RListMultimapCacheReactive getListMultimapCache(String name) {
RedissonListMultimapCache listMultimap = new RedissonListMultimapCache<>(evictionScheduler, commandExecutor, name);
return ReactiveProxyBuilder.create(commandExecutor, listMultimap,
new RedissonListMultimapCacheReactive(listMultimap, commandExecutor), RListMultimapCacheReactive.class);
}
@Override
public RListMultimapCacheReactive getListMultimapCache(String name, Codec codec) {
RedissonListMultimapCache listMultimap = new RedissonListMultimapCache<>(evictionScheduler, codec, commandExecutor, name);
return ReactiveProxyBuilder.create(commandExecutor, listMultimap,
new RedissonListMultimapCacheReactive<>(listMultimap, commandExecutor), RListMultimapCacheReactive.class);
}
@Override
public RListMultimapCacheReactive getListMultimapCache(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
RedissonListMultimapCache listMultimap = new RedissonListMultimapCache<>(evictionScheduler, params.getCodec(), ca, params.getName());
return ReactiveProxyBuilder.create(commandExecutor, listMultimap,
new RedissonListMultimapCacheReactive<>(listMultimap, ca), RListMultimapCacheReactive.class);
}
@Override
public RListMultimapCacheNativeReactive getListMultimapCacheNative(String name) {
RedissonListMultimapCacheNative listMultimap = new RedissonListMultimapCacheNative<>(commandExecutor, name);
return ReactiveProxyBuilder.create(commandExecutor, listMultimap,
new RedissonListMultimapCacheReactive<>(listMultimap, commandExecutor), RListMultimapCacheNativeReactive.class);
}
@Override
public RListMultimapCacheNativeReactive getListMultimapCacheNative(String name, Codec codec) {
RedissonListMultimapCacheNative listMultimap = new RedissonListMultimapCacheNative<>(codec, commandExecutor, name);
return ReactiveProxyBuilder.create(commandExecutor, listMultimap,
new RedissonListMultimapCacheReactive<>(listMultimap, commandExecutor), RListMultimapCacheNativeReactive.class);
}
@Override
public RListMultimapCacheNativeReactive getListMultimapCacheNative(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
RedissonListMultimapCacheNative listMultimap = new RedissonListMultimapCacheNative<>(params.getCodec(), ca, params.getName());
return ReactiveProxyBuilder.create(commandExecutor, listMultimap,
new RedissonListMultimapCacheReactive<>(listMultimap, ca), RListMultimapCacheNativeReactive.class);
}
@Override
public RSetMultimapCacheReactive getSetMultimapCache(String name) {
RedissonSetMultimapCache setMultimap = new RedissonSetMultimapCache<>(evictionScheduler, commandExecutor, name);
return ReactiveProxyBuilder.create(commandExecutor, setMultimap,
new RedissonSetMultimapCacheReactive(setMultimap, commandExecutor, this), RSetMultimapCacheReactive.class);
}
@Override
public RSetMultimapCacheReactive getSetMultimapCache(String name, Codec codec) {
RedissonSetMultimapCache setMultimap = new RedissonSetMultimapCache<>(evictionScheduler, codec, commandExecutor, name);
return ReactiveProxyBuilder.create(commandExecutor, setMultimap,
new RedissonSetMultimapCacheReactive(setMultimap, commandExecutor, this), RSetMultimapCacheReactive.class);
}
@Override
public RSetMultimapCacheReactive getSetMultimapCache(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
RedissonSetMultimapCache setMultimap = new RedissonSetMultimapCache<>(evictionScheduler, params.getCodec(), ca, params.getName());
return ReactiveProxyBuilder.create(commandExecutor, setMultimap,
new RedissonSetMultimapCacheReactive(setMultimap, ca, this), RSetMultimapCacheReactive.class);
}
@Override
public RSetMultimapCacheNativeReactive getSetMultimapCacheNative(String name) {
RedissonSetMultimapCacheNative setMultimap = new RedissonSetMultimapCacheNative<>(commandExecutor, name);
return ReactiveProxyBuilder.create(commandExecutor, setMultimap,
new RedissonSetMultimapCacheReactive(setMultimap, commandExecutor, this), RSetMultimapCacheNativeReactive.class);
}
@Override
public RSetMultimapCacheNativeReactive getSetMultimapCacheNative(String name, Codec codec) {
RedissonSetMultimapCacheNative setMultimap = new RedissonSetMultimapCacheNative<>(codec, commandExecutor, name);
return ReactiveProxyBuilder.create(commandExecutor, setMultimap,
new RedissonSetMultimapCacheReactive(setMultimap, commandExecutor, this), RSetMultimapCacheNativeReactive.class);
}
@Override
public RSetMultimapCacheNativeReactive getSetMultimapCacheNative(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
RedissonSetMultimapCacheNative setMultimap = new RedissonSetMultimapCacheNative<>(params.getCodec(), ca, params.getName());
return ReactiveProxyBuilder.create(commandExecutor, setMultimap,
new RedissonSetMultimapCacheReactive(setMultimap, ca, this), RSetMultimapCacheNativeReactive.class);
}
@Override
public RMapReactive getMap(String name) {
RedissonMap map = new RedissonMap(commandExecutor, name, null, null, writeBehindService);
return ReactiveProxyBuilder.create(commandExecutor, map,
new RedissonMapReactive(map, commandExecutor), RMapReactive.class);
}
@Override
public RMapReactive getMap(String name, Codec codec) {
RedissonMap map = new RedissonMap(codec, commandExecutor, name, null, null, writeBehindService);
return ReactiveProxyBuilder.create(commandExecutor, map,
new RedissonMapReactive(map, commandExecutor), RMapReactive.class);
}
@Override
public RMapReactive getMap(org.redisson.api.options.MapOptions options) {
MapParams params = (MapParams) options;
MapOptions ops = createOptions(params);
CommandReactiveExecutor ca = commandExecutor.copy(params);
RedissonMap map = new RedissonMap<>(params.getCodec(), ca, params.getName(), null, ops, writeBehindService);
return ReactiveProxyBuilder.create(commandExecutor, map,
new RedissonMapReactive(map, ca), RMapReactive.class);
}
@Override
public RSetReactive getSet(String name) {
RedissonSet set = new RedissonSet(commandExecutor, name, null);
return ReactiveProxyBuilder.create(commandExecutor, set,
new RedissonSetReactive(set, this), RSetReactive.class);
}
@Override
public RSetReactive getSet(String name, Codec codec) {
RedissonSet set = new RedissonSet(codec, commandExecutor, name, null);
return ReactiveProxyBuilder.create(commandExecutor, set,
new RedissonSetReactive(set, this), RSetReactive.class);
}
@Override
public RSetReactive getSet(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
RedissonSet set = new RedissonSet(params.getCodec(), ca, params.getName(), null);
return ReactiveProxyBuilder.create(commandExecutor, set,
new RedissonSetReactive(set, this), RSetReactive.class);
}
@Override
public RScoredSortedSetReactive getScoredSortedSet(String name) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonScoredSortedSet(commandExecutor, name, null),
new RedissonScoredSortedSetReactive(commandExecutor, name), RScoredSortedSetReactive.class);
}
@Override
public RScoredSortedSetReactive getScoredSortedSet(String name, Codec codec) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonScoredSortedSet(codec, commandExecutor, name, null),
new RedissonScoredSortedSetReactive(codec, commandExecutor, name), RScoredSortedSetReactive.class);
}
@Override
public RScoredSortedSetReactive getScoredSortedSet(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return ReactiveProxyBuilder.create(commandExecutor, new RedissonScoredSortedSet(params.getCodec(), ca, params.getName(), null),
new RedissonScoredSortedSetReactive(params.getCodec(), ca, params.getName()), RScoredSortedSetReactive.class);
}
@Override
public RLexSortedSetReactive getLexSortedSet(String name) {
RedissonLexSortedSet set = new RedissonLexSortedSet(commandExecutor, name, null);
return ReactiveProxyBuilder.create(commandExecutor, set,
new RedissonLexSortedSetReactive(set),
RLexSortedSetReactive.class);
}
@Override
public RLexSortedSetReactive getLexSortedSet(CommonOptions options) {
CommonParams params = (CommonParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
RedissonLexSortedSet set = new RedissonLexSortedSet(ca, params.getName(), null);
return ReactiveProxyBuilder.create(commandExecutor, set,
new RedissonLexSortedSetReactive(set),
RLexSortedSetReactive.class);
}
@Override
public RShardedTopicReactive getShardedTopic(String name) {
RedissonShardedTopic topic = new RedissonShardedTopic(commandExecutor, name);
return ReactiveProxyBuilder.create(commandExecutor, topic,
new RedissonTopicReactive(topic), RShardedTopicReactive.class);
}
@Override
public RShardedTopicReactive getShardedTopic(String name, Codec codec) {
RedissonShardedTopic topic = new RedissonShardedTopic(codec, commandExecutor, name);
return ReactiveProxyBuilder.create(commandExecutor, topic,
new RedissonTopicReactive(topic), RShardedTopicReactive.class);
}
@Override
public RShardedTopicReactive getShardedTopic(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
RedissonShardedTopic topic = new RedissonShardedTopic(params.getCodec(), ca, params.getName());
return ReactiveProxyBuilder.create(commandExecutor, topic,
new RedissonTopicReactive(topic), RShardedTopicReactive.class);
}
@Override
public RTopicReactive getTopic(String name) {
RedissonTopic topic = new RedissonTopic(commandExecutor, name);
return ReactiveProxyBuilder.create(commandExecutor, topic,
new RedissonTopicReactive(topic), RTopicReactive.class);
}
@Override
public RTopicReactive getTopic(String name, Codec codec) {
RedissonTopic topic = new RedissonTopic(codec, commandExecutor, name);
return ReactiveProxyBuilder.create(commandExecutor, topic,
new RedissonTopicReactive(topic), RTopicReactive.class);
}
@Override
public RTopicReactive getTopic(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
RedissonTopic topic = new RedissonTopic(params.getCodec(), ca, params.getName());
return ReactiveProxyBuilder.create(commandExecutor, topic,
new RedissonTopicReactive(topic), RTopicReactive.class);
}
@Override
public RReliableTopicReactive getReliableTopic(String name) {
RedissonReliableTopic topic = new RedissonReliableTopic(commandExecutor, name, null);
return ReactiveProxyBuilder.create(commandExecutor, topic,
new RedissonReliableTopicReactive(topic), RReliableTopicReactive.class);
}
@Override
public RReliableTopicReactive getReliableTopic(String name, Codec codec) {
RedissonReliableTopic topic = new RedissonReliableTopic(codec, commandExecutor, name, null);
return ReactiveProxyBuilder.create(commandExecutor, topic,
new RedissonReliableTopicReactive(topic), RReliableTopicReactive.class);
}
@Override
public RReliableTopicReactive getReliableTopic(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
RedissonReliableTopic topic = new RedissonReliableTopic(params.getCodec(), ca, params.getName(), null);
return ReactiveProxyBuilder.create(commandExecutor, topic,
new RedissonReliableTopicReactive(topic), RReliableTopicReactive.class);
}
@Override
public RPatternTopicReactive getPatternTopic(String pattern) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonPatternTopic(commandExecutor, pattern), RPatternTopicReactive.class);
}
@Override
public RPatternTopicReactive getPatternTopic(String pattern, Codec codec) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonPatternTopic(codec, commandExecutor, pattern), RPatternTopicReactive.class);
}
@Override
public RPatternTopicReactive getPatternTopic(PatternTopicOptions options) {
PatternTopicParams params = (PatternTopicParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return ReactiveProxyBuilder.create(commandExecutor,
new RedissonPatternTopic(params.getCodec(), ca, params.getPattern()), RPatternTopicReactive.class);
}
@Override
public RQueueReactive getQueue(String name) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonQueue(commandExecutor, name, null),
new RedissonListReactive(commandExecutor, name), RQueueReactive.class);
}
@Override
public RQueueReactive getQueue(String name, Codec codec) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonQueue(codec, commandExecutor, name, null),
new RedissonListReactive(codec, commandExecutor, name), RQueueReactive.class);
}
@Override
public RQueueReactive getQueue(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return ReactiveProxyBuilder.create(commandExecutor, new RedissonQueue(params.getCodec(), ca, params.getName(), null),
new RedissonListReactive(params.getCodec(), ca, params.getName()), RQueueReactive.class);
}
@Override
public RRingBufferReactive getRingBuffer(String name) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonRingBuffer(commandExecutor, name, null), RRingBufferReactive.class);
}
@Override
public RRingBufferReactive getRingBuffer(String name, Codec codec) {
return ReactiveProxyBuilder.create(commandExecutor, new RedissonRingBuffer(codec, commandExecutor, name, null), RRingBufferReactive.class);
}
@Override
public RRingBufferReactive getRingBuffer(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
return ReactiveProxyBuilder.create(commandExecutor,
new RedissonRingBuffer(params.getCodec(), ca, params.getName(), null), RRingBufferReactive.class);
}
@Override
public RBlockingQueueReactive getBlockingQueue(String name) {
RedissonBlockingQueue queue = new RedissonBlockingQueue(commandExecutor, name, null);
return ReactiveProxyBuilder.create(commandExecutor, queue,
new RedissonBlockingQueueReactive(queue), RBlockingQueueReactive.class);
}
@Override
public RBlockingQueueReactive getBlockingQueue(String name, Codec codec) {
RedissonBlockingQueue queue = new RedissonBlockingQueue(codec, commandExecutor, name, null);
return ReactiveProxyBuilder.create(commandExecutor, queue,
new RedissonBlockingQueueReactive(queue), RBlockingQueueReactive.class);
}
@Override
public RBlockingQueueReactive getBlockingQueue(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandReactiveExecutor ca = commandExecutor.copy(params);
RedissonBlockingQueue queue = new RedissonBlockingQueue