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.RedissonRx 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.rx.*;
import java.time.Duration;
import java.util.Arrays;
import java.util.Collection;
/**
* Main infrastructure class allows to get access
* to all Redisson objects on top of Redis server.
*
* @author Nikita Koksharov
*
*/
public class RedissonRx implements RedissonRxClient {
protected final WriteBehindService writeBehindService;
protected final EvictionScheduler evictionScheduler;
protected final CommandRxExecutor commandExecutor;
protected final ConnectionManager connectionManager;
@Deprecated
protected RedissonRx(Config config) {
Config configCopy = new Config(config);
connectionManager = ConfigSupport.createConnectionManager(configCopy);
RedissonObjectBuilder objectBuilder = null;
if (connectionManager.getServiceManager().getCfg().isReferenceEnabled()) {
objectBuilder = new RedissonObjectBuilder(this);
}
commandExecutor = new CommandRxService(connectionManager, objectBuilder);
evictionScheduler = new EvictionScheduler(commandExecutor);
writeBehindService = new WriteBehindService(commandExecutor);
}
protected RedissonRx(ConnectionManager connectionManager, EvictionScheduler evictionScheduler, WriteBehindService writeBehindService) {
this.connectionManager = connectionManager;
RedissonObjectBuilder objectBuilder = null;
if (connectionManager.getServiceManager().getCfg().isReferenceEnabled()) {
objectBuilder = new RedissonObjectBuilder(this);
}
commandExecutor = new CommandRxService(connectionManager, objectBuilder);
this.evictionScheduler = evictionScheduler;
this.writeBehindService = writeBehindService;
}
public CommandRxExecutor getCommandExecutor() {
return commandExecutor;
}
@Override
public RStreamRx getStream(String name) {
return RxProxyBuilder.create(commandExecutor, new RedissonStream(commandExecutor, name), RStreamRx.class);
}
@Override
public RStreamRx getStream(String name, Codec codec) {
return RxProxyBuilder.create(commandExecutor, new RedissonStream(codec, commandExecutor, name), RStreamRx.class);
}
@Override
public RStreamRx getStream(PlainOptions options) {
PlainParams params = (PlainParams) options;
return RxProxyBuilder.create(commandExecutor,
new RedissonStream(params.getCodec(), commandExecutor.copy(params), params.getName()), RStreamRx.class);
}
@Override
public RSearchRx getSearch() {
return getSearch((Codec) null);
}
@Override
public RSearchRx getSearch(Codec codec) {
return RxProxyBuilder.create(commandExecutor, new RedissonSearch(codec, commandExecutor), RSearchRx.class);
}
@Override
public RSearchRx getSearch(OptionalOptions options) {
OptionalParams params = (OptionalParams) options;
return RxProxyBuilder.create(commandExecutor,
new RedissonSearch(params.getCodec(), commandExecutor.copy(params)), RSearchRx.class);
}
@Override
public RGeoRx getGeo(String name) {
RedissonScoredSortedSet set = new RedissonScoredSortedSet(commandExecutor, name, null);
return RxProxyBuilder.create(commandExecutor, new RedissonGeo(commandExecutor, name, null),
new RedissonScoredSortedSetRx(set), RGeoRx.class);
}
@Override
public RGeoRx getGeo(String name, Codec codec) {
RedissonScoredSortedSet set = new RedissonScoredSortedSet(codec, commandExecutor, name, null);
return RxProxyBuilder.create(commandExecutor, new RedissonGeo(codec, commandExecutor, name, null),
new RedissonScoredSortedSetRx(set), RGeoRx.class);
}
@Override
public RGeoRx getGeo(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
RedissonScoredSortedSet set = new RedissonScoredSortedSet(params.getCodec(), ce, params.getName(), null);
return RxProxyBuilder.create(commandExecutor, new RedissonGeo(params.getCodec(), ce, params.getName(), null),
new RedissonScoredSortedSetRx(set), RGeoRx.class);
}
@Override
public RLockRx getFairLock(String name) {
return RxProxyBuilder.create(commandExecutor, new RedissonFairLock(commandExecutor, name), RLockRx.class);
}
@Override
public RLockRx getFairLock(CommonOptions options) {
CommonParams params = (CommonParams) options;
return RxProxyBuilder.create(commandExecutor,
new RedissonFairLock(commandExecutor.copy(params), params.getName()), RLockRx.class);
}
@Override
public RRateLimiterRx getRateLimiter(String name) {
return RxProxyBuilder.create(commandExecutor, new RedissonRateLimiter(commandExecutor, name), RRateLimiterRx.class);
}
@Override
public RRateLimiterRx getRateLimiter(CommonOptions options) {
CommonParams params = (CommonParams) options;
return RxProxyBuilder.create(commandExecutor,
new RedissonRateLimiter(commandExecutor.copy(params), params.getName()), RRateLimiterRx.class);
}
@Override
public RBinaryStreamRx getBinaryStream(String name) {
RedissonBinaryStream stream = new RedissonBinaryStream(commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, stream,
new RedissonBinaryStreamRx(commandExecutor, stream), RBinaryStreamRx.class);
}
@Override
public RBinaryStreamRx getBinaryStream(CommonOptions options) {
CommonParams params = (CommonParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
RedissonBinaryStream stream = new RedissonBinaryStream(ce, params.getName());
return RxProxyBuilder.create(commandExecutor, stream,
new RedissonBinaryStreamRx(ce, stream), RBinaryStreamRx.class);
}
@Override
public RSemaphoreRx getSemaphore(String name) {
return RxProxyBuilder.create(commandExecutor, new RedissonSemaphore(commandExecutor, name), RSemaphoreRx.class);
}
@Override
public RSemaphoreRx getSemaphore(CommonOptions options) {
CommonParams params = (CommonParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
return RxProxyBuilder.create(commandExecutor, new RedissonSemaphore(ce, params.getName()), RSemaphoreRx.class);
}
@Override
public RPermitExpirableSemaphoreRx getPermitExpirableSemaphore(String name) {
return RxProxyBuilder.create(commandExecutor, new RedissonPermitExpirableSemaphore(commandExecutor, name), RPermitExpirableSemaphoreRx.class);
}
@Override
public RPermitExpirableSemaphoreRx getPermitExpirableSemaphore(CommonOptions options) {
CommonParams params = (CommonParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
return RxProxyBuilder.create(commandExecutor,
new RedissonPermitExpirableSemaphore(ce, params.getName()), RPermitExpirableSemaphoreRx.class);
}
@Override
public RReadWriteLockRx getReadWriteLock(String name) {
return new RedissonReadWriteLockRx(commandExecutor, name);
}
@Override
public RReadWriteLockRx getReadWriteLock(CommonOptions options) {
CommonParams params = (CommonParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
return new RedissonReadWriteLockRx(ce, params.getName());
}
@Override
public RLockRx getLock(String name) {
return RxProxyBuilder.create(commandExecutor, new RedissonLock(commandExecutor, name), RLockRx.class);
}
@Override
public RLockRx getLock(CommonOptions options) {
CommonParams params = (CommonParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
return RxProxyBuilder.create(commandExecutor, new RedissonLock(ce, params.getName()), RLockRx.class);
}
@Override
public RLockRx getSpinLock(String name) {
return getSpinLock(name, LockOptions.defaults());
}
@Override
public RLockRx getSpinLock(String name, LockOptions.BackOff backOff) {
RedissonSpinLock spinLock = new RedissonSpinLock(commandExecutor, name, backOff);
return RxProxyBuilder.create(commandExecutor, spinLock, RLockRx.class);
}
@Override
public RFencedLockRx getFencedLock(String name) {
RedissonFencedLock lock = new RedissonFencedLock(commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, lock, RFencedLockRx.class);
}
@Override
public RFencedLockRx getFencedLock(CommonOptions options) {
CommonParams params = (CommonParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
RedissonFencedLock lock = new RedissonFencedLock(ce, params.getName());
return RxProxyBuilder.create(commandExecutor, lock, RFencedLockRx.class);
}
@Override
public RLockRx getMultiLock(RLockRx... locks) {
RLock[] ls = Arrays.stream(locks)
.map(l -> new RedissonLock(commandExecutor, l.getName()))
.toArray(RLock[]::new);
return RxProxyBuilder.create(commandExecutor, new RedissonMultiLock(ls), RLockRx.class);
}
@Override
public RLockRx getMultiLock(String group, Collection values) {
return RxProxyBuilder.create(commandExecutor, new RedissonFasterMultiLock(commandExecutor, group, values), RLockRx.class);
}
@Override
public RLockRx getMultiLock(RLock... locks) {
return RxProxyBuilder.create(commandExecutor, new RedissonMultiLock(locks), RLockRx.class);
}
@Override
public RLockRx getRedLock(RLock... locks) {
return RxProxyBuilder.create(commandExecutor, new RedissonRedLock(locks), RLockRx.class);
}
@Override
public RCountDownLatchRx getCountDownLatch(String name) {
return RxProxyBuilder.create(commandExecutor, new RedissonCountDownLatch(commandExecutor, name), RCountDownLatchRx.class);
}
@Override
public RCountDownLatchRx getCountDownLatch(CommonOptions options) {
CommonParams params = (CommonParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
return RxProxyBuilder.create(commandExecutor, new RedissonCountDownLatch(ce, params.getName()), RCountDownLatchRx.class);
}
@Override
public RMapCacheRx getMapCache(String name, Codec codec) {
RMap map = new RedissonMapCache(codec, evictionScheduler, commandExecutor, name, null, null, null);
return RxProxyBuilder.create(commandExecutor, map,
new RedissonMapCacheRx(map, commandExecutor), RMapCacheRx.class);
}
@Override
public RMapCacheRx getMapCache(String name) {
RedissonMapCache map = new RedissonMapCache(evictionScheduler, commandExecutor, name, null, null, null);
return RxProxyBuilder.create(commandExecutor, map,
new RedissonMapCacheRx(map, commandExecutor), RMapCacheRx.class);
}
@Override
public RMapCacheRx getMapCache(org.redisson.api.options.MapCacheOptions options) {
MapCacheParams params = (MapCacheParams) options;
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.isRemoveEmptyEvictionTask()) {
ops.removeEmptyEvictionTask();
}
if (params.getWriteMode() != null) {
ops.writeMode(MapOptions.WriteMode.valueOf(params.getWriteMode().toString()));
}
if (params.getWriteRetryAttempts() > 0) {
ops.writerRetryAttempts(params.getWriteRetryAttempts());
}
CommandRxExecutor ce = commandExecutor.copy(params);
RedissonMapCache map = new RedissonMapCache<>(params.getCodec(), evictionScheduler,
ce, params.getName(), null, ops, writeBehindService);
return RxProxyBuilder.create(commandExecutor, map,
new RedissonMapCacheRx(map, ce), RMapCacheRx.class);
}
@Override
public RBucketRx getBucket(String name) {
return RxProxyBuilder.create(commandExecutor, new RedissonBucket(commandExecutor, name), RBucketRx.class);
}
@Override
public RBucketRx getBucket(String name, Codec codec) {
return RxProxyBuilder.create(commandExecutor, new RedissonBucket(codec, commandExecutor, name), RBucketRx.class);
}
@Override
public RBucketRx getBucket(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
return RxProxyBuilder.create(commandExecutor,
new RedissonBucket(params.getCodec(), ce, params.getName()), RBucketRx.class);
}
@Override
public RBucketsRx getBuckets() {
return RxProxyBuilder.create(commandExecutor, new RedissonBuckets(commandExecutor), RBucketsRx.class);
}
@Override
public RBucketsRx getBuckets(Codec codec) {
return RxProxyBuilder.create(commandExecutor, new RedissonBuckets(codec, commandExecutor), RBucketsRx.class);
}
@Override
public RBucketsRx getBuckets(OptionalOptions options) {
OptionalParams params = (OptionalParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
return RxProxyBuilder.create(commandExecutor, new RedissonBuckets(params.getCodec(), ce), RBucketsRx.class);
}
@Override
public RJsonBucketRx getJsonBucket(String name, JsonCodec codec) {
return RxProxyBuilder.create(commandExecutor, new RedissonJsonBucket<>(codec, commandExecutor, name), RJsonBucketRx.class);
}
@Override
public RJsonBucketRx getJsonBucket(JsonBucketOptions options) {
JsonBucketParams params = (JsonBucketParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
return RxProxyBuilder.create(commandExecutor, new RedissonJsonBucket<>(params.getCodec(), ce, params.getName()), RJsonBucketRx.class);
}
@Override
public RJsonBucketsRx getJsonBuckets(JsonCodec codec) {
return RxProxyBuilder.create(commandExecutor, new RedissonJsonBuckets(codec, commandExecutor), RJsonBucketsRx.class);
}
@Override
public RHyperLogLogRx getHyperLogLog(String name) {
return RxProxyBuilder.create(commandExecutor, new RedissonHyperLogLog(commandExecutor, name), RHyperLogLogRx.class);
}
@Override
public RHyperLogLogRx getHyperLogLog(String name, Codec codec) {
return RxProxyBuilder.create(commandExecutor, new RedissonHyperLogLog(codec, commandExecutor, name), RHyperLogLogRx.class);
}
@Override
public RHyperLogLogRx getHyperLogLog(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
return RxProxyBuilder.create(commandExecutor, new RedissonHyperLogLog(params.getCodec(), ce, params.getName()), RHyperLogLogRx.class);
}
@Override
public RIdGeneratorRx getIdGenerator(String name) {
return RxProxyBuilder.create(commandExecutor, new RedissonIdGenerator(commandExecutor, name), RIdGeneratorRx.class);
}
@Override
public RIdGeneratorRx getIdGenerator(CommonOptions options) {
CommonParams params = (CommonParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
return RxProxyBuilder.create(commandExecutor, new RedissonIdGenerator(ce, params.getName()), RIdGeneratorRx.class);
}
@Override
public RListRx getList(String name) {
RedissonList list = new RedissonList(commandExecutor, name, null);
return RxProxyBuilder.create(commandExecutor, list,
new RedissonListRx(list), RListRx.class);
}
@Override
public RListRx getList(String name, Codec codec) {
RedissonList list = new RedissonList(codec, commandExecutor, name, null);
return RxProxyBuilder.create(commandExecutor, list,
new RedissonListRx(list), RListRx.class);
}
@Override
public RListRx getList(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
RedissonList list = new RedissonList(params.getCodec(), ce, params.getName(), null);
return RxProxyBuilder.create(commandExecutor, list,
new RedissonListRx(list), RListRx.class);
}
@Override
public RListMultimapRx getListMultimap(String name) {
RedissonListMultimap listMultimap = new RedissonListMultimap<>(commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, listMultimap,
new RedissonListMultimapRx(listMultimap, commandExecutor), RListMultimapRx.class);
}
@Override
public RListMultimapRx getListMultimap(String name, Codec codec) {
RedissonListMultimap listMultimap = new RedissonListMultimap<>(codec, commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, listMultimap,
new RedissonListMultimapRx(listMultimap, commandExecutor), RListMultimapRx.class);
}
@Override
public RListMultimapRx getListMultimap(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
RedissonListMultimap listMultimap = new RedissonListMultimap<>(params.getCodec(), ce, params.getName());
return RxProxyBuilder.create(commandExecutor, listMultimap,
new RedissonListMultimapRx(listMultimap, commandExecutor), RListMultimapRx.class);
}
@Override
public RListMultimapCacheRx getListMultimapCache(String name) {
RedissonListMultimapCache listMultimap = new RedissonListMultimapCache<>(evictionScheduler, commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, listMultimap,
new RedissonListMultimapRx(listMultimap, commandExecutor), RListMultimapCacheRx.class);
}
@Override
public RListMultimapCacheRx getListMultimapCache(String name, Codec codec) {
RedissonListMultimapCache listMultimap = new RedissonListMultimapCache<>(evictionScheduler, codec, commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, listMultimap,
new RedissonListMultimapRx(listMultimap, commandExecutor), RListMultimapCacheRx.class);
}
@Override
public RListMultimapCacheRx getListMultimapCache(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
RedissonListMultimapCache listMultimap = new RedissonListMultimapCache<>(evictionScheduler, params.getCodec(), ce, params.getName());
return RxProxyBuilder.create(commandExecutor, listMultimap,
new RedissonListMultimapRx(listMultimap, ce), RListMultimapCacheRx.class);
}
@Override
public RListMultimapCacheNativeRx getListMultimapCacheNative(String name) {
RedissonListMultimapCacheNative listMultimap = new RedissonListMultimapCacheNative<>(commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, listMultimap,
new RedissonListMultimapRx(listMultimap, commandExecutor), RListMultimapCacheNativeRx.class);
}
@Override
public RListMultimapCacheNativeRx getListMultimapCacheNative(String name, Codec codec) {
RedissonListMultimapCacheNative listMultimap = new RedissonListMultimapCacheNative<>(codec, commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, listMultimap,
new RedissonListMultimapRx(listMultimap, commandExecutor), RListMultimapCacheNativeRx.class);
}
@Override
public RListMultimapCacheNativeRx getListMultimapCacheNative(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
RedissonListMultimapCacheNative listMultimap = new RedissonListMultimapCacheNative<>(params.getCodec(), ce, params.getName());
return RxProxyBuilder.create(commandExecutor, listMultimap,
new RedissonListMultimapRx(listMultimap, ce), RListMultimapCacheNativeRx.class);
}
@Override
public RSetMultimapRx getSetMultimap(String name) {
RedissonSetMultimap setMultimap = new RedissonSetMultimap<>(commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, setMultimap,
new RedissonSetMultimapRx(setMultimap, commandExecutor, this), RSetMultimapRx.class);
}
@Override
public RSetMultimapRx getSetMultimap(String name, Codec codec) {
RedissonSetMultimap setMultimap = new RedissonSetMultimap<>(codec, commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, setMultimap,
new RedissonSetMultimapRx(setMultimap, commandExecutor, this), RSetMultimapRx.class);
}
@Override
public RSetMultimapRx getSetMultimap(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
RedissonSetMultimap setMultimap = new RedissonSetMultimap<>(params.getCodec(), ce, params.getName());
return RxProxyBuilder.create(commandExecutor, setMultimap,
new RedissonSetMultimapRx<>(setMultimap, ce, this), RSetMultimapRx.class);
}
@Override
public RSetMultimapCacheRx getSetMultimapCache(String name) {
RedissonSetMultimapCache setMultimap = new RedissonSetMultimapCache<>(evictionScheduler, commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, setMultimap,
new RedissonSetMultimapRx(setMultimap, commandExecutor, this), RSetMultimapCacheRx.class);
}
@Override
public RSetMultimapCacheRx getSetMultimapCache(String name, Codec codec) {
RedissonSetMultimapCache setMultimap = new RedissonSetMultimapCache<>(evictionScheduler, codec, commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, setMultimap,
new RedissonSetMultimapRx(setMultimap, commandExecutor, this), RSetMultimapCacheRx.class);
}
@Override
public RSetMultimapCacheRx getSetMultimapCache(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
RedissonSetMultimapCache setMultimap = new RedissonSetMultimapCache<>(evictionScheduler, params.getCodec(), ce, params.getName());
return RxProxyBuilder.create(commandExecutor, setMultimap,
new RedissonSetMultimapRx<>(setMultimap, ce, this), RSetMultimapCacheRx.class);
}
@Override
public RSetMultimapCacheNativeRx getSetMultimapCacheNative(String name) {
RedissonSetMultimapCacheNative setMultimap = new RedissonSetMultimapCacheNative<>(commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, setMultimap,
new RedissonSetMultimapRx<>(setMultimap, commandExecutor, this), RSetMultimapCacheNativeRx.class);
}
@Override
public RSetMultimapCacheNativeRx getSetMultimapCacheNative(String name, Codec codec) {
RedissonSetMultimapCacheNative setMultimap = new RedissonSetMultimapCacheNative<>(codec, commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, setMultimap,
new RedissonSetMultimapRx<>(setMultimap, commandExecutor, this), RSetMultimapCacheNativeRx.class);
}
@Override
public RSetMultimapCacheNativeRx getSetMultimapCacheNative(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
RedissonSetMultimapCacheNative setMultimap = new RedissonSetMultimapCacheNative<>(params.getCodec(), ce, params.getName());
return RxProxyBuilder.create(commandExecutor, setMultimap,
new RedissonSetMultimapRx<>(setMultimap, ce, this), RSetMultimapCacheNativeRx.class);
}
@Override
public RMapRx getMap(String name) {
RedissonMap map = new RedissonMap(commandExecutor, name, null, null, null);
return RxProxyBuilder.create(commandExecutor, map,
new RedissonMapRx(map, commandExecutor), RMapRx.class);
}
@Override
public RMapRx getMap(String name, Codec codec) {
RedissonMap map = new RedissonMap(codec, commandExecutor, name, null, null, null);
return RxProxyBuilder.create(commandExecutor, map,
new RedissonMapRx(map, commandExecutor), RMapRx.class);
}
@Override
public RMapRx getMap(org.redisson.api.options.MapOptions options) {
MapParams params = (MapParams) options;
MapOptions ops = createOptions(params);
CommandRxExecutor ce = commandExecutor.copy(params);
RedissonMap map = new RedissonMap<>(params.getCodec(), ce, params.getName(), null, ops, writeBehindService);
return RxProxyBuilder.create(commandExecutor, map,
new RedissonMapRx<>(map, ce), RMapRx.class);
}
@Override
public RSetRx getSet(String name) {
RedissonSet set = new RedissonSet(commandExecutor, name, null);
return RxProxyBuilder.create(commandExecutor, set,
new RedissonSetRx(set, this), RSetRx.class);
}
@Override
public RSetRx getSet(String name, Codec codec) {
RedissonSet set = new RedissonSet(codec, commandExecutor, name, null);
return RxProxyBuilder.create(commandExecutor, set,
new RedissonSetRx(set, this), RSetRx.class);
}
@Override
public RSetRx getSet(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
RedissonSet set = new RedissonSet(params.getCodec(), ce, params.getName(), null);
return RxProxyBuilder.create(commandExecutor, set,
new RedissonSetRx(set, this), RSetRx.class);
}
@Override
public RScoredSortedSetRx getScoredSortedSet(String name) {
RedissonScoredSortedSet set = new RedissonScoredSortedSet(commandExecutor, name, null);
return RxProxyBuilder.create(commandExecutor, set,
new RedissonScoredSortedSetRx(set), RScoredSortedSetRx.class);
}
@Override
public RScoredSortedSetRx getScoredSortedSet(String name, Codec codec) {
RedissonScoredSortedSet set = new RedissonScoredSortedSet(codec, commandExecutor, name, null);
return RxProxyBuilder.create(commandExecutor, set,
new RedissonScoredSortedSetRx(set), RScoredSortedSetRx.class);
}
@Override
public RScoredSortedSetRx getScoredSortedSet(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
RedissonScoredSortedSet set = new RedissonScoredSortedSet(params.getCodec(), ce, params.getName(), null);
return RxProxyBuilder.create(commandExecutor, set,
new RedissonScoredSortedSetRx<>(set), RScoredSortedSetRx.class);
}
@Override
public RLexSortedSetRx getLexSortedSet(String name) {
RedissonLexSortedSet set = new RedissonLexSortedSet(commandExecutor, name, null);
return RxProxyBuilder.create(commandExecutor, set,
new RedissonLexSortedSetRx(set), RLexSortedSetRx.class);
}
@Override
public RLexSortedSetRx getLexSortedSet(CommonOptions options) {
CommonParams params = (CommonParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
RedissonLexSortedSet set = new RedissonLexSortedSet(ce, params.getName(), null);
return RxProxyBuilder.create(commandExecutor, set,
new RedissonLexSortedSetRx(set), RLexSortedSetRx.class);
}
@Override
public RShardedTopicRx getShardedTopic(String name) {
RShardedTopic topic = new RedissonShardedTopic(commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, topic, new RedissonTopicRx(topic), RShardedTopicRx.class);
}
@Override
public RShardedTopicRx getShardedTopic(String name, Codec codec) {
RShardedTopic topic = new RedissonShardedTopic(codec, commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, topic, new RedissonTopicRx(topic), RShardedTopicRx.class);
}
@Override
public RShardedTopicRx getShardedTopic(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
RShardedTopic topic = new RedissonShardedTopic(params.getCodec(), ce, params.getName());
return RxProxyBuilder.create(commandExecutor, topic, new RedissonTopicRx(topic), RShardedTopicRx.class);
}
@Override
public RTopicRx getTopic(String name) {
RTopic topic = new RedissonTopic(commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, topic, new RedissonTopicRx(topic), RTopicRx.class);
}
@Override
public RTopicRx getTopic(String name, Codec codec) {
RTopic topic = new RedissonTopic(codec, commandExecutor, name);
return RxProxyBuilder.create(commandExecutor, topic, new RedissonTopicRx(topic), RTopicRx.class);
}
@Override
public RTopicRx getTopic(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
RTopic topic = new RedissonTopic(params.getCodec(), ce, params.getName());
return RxProxyBuilder.create(commandExecutor, topic, new RedissonTopicRx(topic), RTopicRx.class);
}
@Override
public RReliableTopicRx getReliableTopic(String name) {
return RxProxyBuilder.create(commandExecutor, new RedissonReliableTopic(commandExecutor, name, null), RReliableTopicRx.class);
}
@Override
public RReliableTopicRx getReliableTopic(String name, Codec codec) {
return RxProxyBuilder.create(commandExecutor, new RedissonReliableTopic(codec, commandExecutor, name, null), RReliableTopicRx.class);
}
@Override
public RReliableTopicRx getReliableTopic(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
return RxProxyBuilder.create(commandExecutor,
new RedissonReliableTopic(params.getCodec(), ce, params.getName(), null), RReliableTopicRx.class);
}
@Override
public RPatternTopicRx getPatternTopic(String pattern) {
return RxProxyBuilder.create(commandExecutor, new RedissonPatternTopic(commandExecutor, pattern), RPatternTopicRx.class);
}
@Override
public RPatternTopicRx getPatternTopic(String pattern, Codec codec) {
return RxProxyBuilder.create(commandExecutor, new RedissonPatternTopic(codec, commandExecutor, pattern), RPatternTopicRx.class);
}
@Override
public RPatternTopicRx getPatternTopic(PatternTopicOptions options) {
PatternTopicParams params = (PatternTopicParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
return RxProxyBuilder.create(commandExecutor, new RedissonPatternTopic(params.getCodec(), ce, params.getPattern()), RPatternTopicRx.class);
}
@Override
public RQueueRx getQueue(String name) {
return RxProxyBuilder.create(commandExecutor, new RedissonQueue(commandExecutor, name, null),
new RedissonListRx(new RedissonList(commandExecutor, name, null)), RQueueRx.class);
}
@Override
public RQueueRx getQueue(String name, Codec codec) {
return RxProxyBuilder.create(commandExecutor, new RedissonQueue(codec, commandExecutor, name, null),
new RedissonListRx(new RedissonList(codec, commandExecutor, name, null)), RQueueRx.class);
}
@Override
public RQueueRx getQueue(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
return RxProxyBuilder.create(commandExecutor, new RedissonQueue(params.getCodec(), ce, params.getName(), null),
new RedissonListRx(new RedissonList(params.getCodec(), ce, params.getName(), null)), RQueueRx.class);
}
@Override
public RRingBufferRx getRingBuffer(String name) {
return RxProxyBuilder.create(commandExecutor, new RedissonRingBuffer(commandExecutor, name, null), RRingBufferRx.class);
}
@Override
public RRingBufferRx getRingBuffer(String name, Codec codec) {
return RxProxyBuilder.create(commandExecutor, new RedissonRingBuffer(codec, commandExecutor, name, null), RRingBufferRx.class);
}
@Override
public RRingBufferRx getRingBuffer(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
return RxProxyBuilder.create(commandExecutor,
new RedissonRingBuffer(params.getCodec(), ce, params.getName(), null), RRingBufferRx.class);
}
@Override
public RBlockingQueueRx getBlockingQueue(String name) {
RedissonBlockingQueue queue = new RedissonBlockingQueue(commandExecutor, name, null);
return RxProxyBuilder.create(commandExecutor, queue,
new RedissonBlockingQueueRx(queue), RBlockingQueueRx.class);
}
@Override
public RBlockingQueueRx getBlockingQueue(String name, Codec codec) {
RedissonBlockingQueue queue = new RedissonBlockingQueue(codec, commandExecutor, name, null);
return RxProxyBuilder.create(commandExecutor, queue,
new RedissonBlockingQueueRx(queue), RBlockingQueueRx.class);
}
@Override
public RBlockingQueueRx getBlockingQueue(PlainOptions options) {
PlainParams params = (PlainParams) options;
CommandRxExecutor ce = commandExecutor.copy(params);
RedissonBlockingQueue queue = new RedissonBlockingQueue(params.getCodec(), ce, params.getName(), null);
return RxProxyBuilder.create(commandExecutor, queue,
new RedissonBlockingQueueRx(queue), RBlockingQueueRx.class);
}
@Override
public RDequeRx getDeque(String name) {
RedissonDeque queue = new RedissonDeque(commandExecutor, name, null);
return RxProxyBuilder.create(commandExecutor, queue,
new RedissonListRx(queue), RDequeRx.class);
}
@Override
public RDequeRx getDeque(String name, Codec codec) {
RedissonDeque queue = new RedissonDeque(codec, commandExecutor, name, null);
return RxProxyBuilder.create(commandExecutor, queue,
new RedissonListRx(queue), RDequeRx.class);
}
@Override
public RDequeRx