com.github.lontime.shaded.org.redisson.api.RTransactionReactive 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 reactor.core.publisher.Mono;
/**
* Reactive interface for transaction object allows to execute transactions over Redisson objects.
* Uses locks for write operations and maintains data modification operations list till the commit/rollback operation.
*
* Transaction isolation level: READ_COMMITTED
*
* @author Nikita Koksharov
*
*/
public interface RTransactionReactive {
/**
* Returns transactional object holder instance by name.
*
* @param type of value
* @param name - name of object
* @return Bucket object
*/
RBucketReactive getBucket(String name);
/**
* Returns transactional object holder instance by name
* using provided codec for object.
*
* @param type of value
* @param name - name of object
* @param codec - codec for values
* @return Bucket object
*/
RBucketReactive getBucket(String name, Codec codec);
/**
* Returns transactional map instance by name.
*
* @param type of key
* @param type of value
* @param name - name of object
* @return Map object
*/
RMapReactive getMap(String name);
/**
* Returns transactional 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
* @return Map object
*/
RMapReactive getMap(String name, Codec codec);
/**
* Returns transactional set instance by name.
*
* @param type of value
* @param name - name of object
* @return Set object
*/
RSetReactive getSet(String name);
/**
* Returns transactional set instance by name
* using provided codec for set objects.
*
* @param type of value
* @param name - name of object
* @param codec - codec for values
* @return Set object
*/
RSetReactive getSet(String name, Codec codec);
/**
* Returns transactional 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)}.
*
* @param type of value
* @param name - name of object
* @return SetCache object
*/
RSetCacheReactive getSetCache(String name);
/**
* Returns transactional 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 value
* @param name - name of object
* @param codec - codec for values
* @return SetCache object
*/
RSetCacheReactive getSetCache(String name, Codec codec);
/**
* Returns transactional 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 key
* @param type of value
* @param name - name of object
* @return MapCache object
*/
RMapCacheReactive getMapCache(String name);
/**
* Returns transactional 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 key
* @param type of value
* @param name - object name
* @param codec - codec for keys and values
* @return MapCache object
*/
RMapCacheReactive getMapCache(String name, Codec codec);
/**
* Commits all changes made on this transaction.
*
* @return void
*/
Mono commit();
/**
* Rollback all changes made on this transaction.
* @return void
*/
Mono rollback();
}